Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggest Box::pin when Pin::new is used instead #89870

Merged
merged 6 commits into from
Oct 15, 2021
Merged

Conversation

tmandry
Copy link
Member

@tmandry tmandry commented Oct 14, 2021

This fixes an incorrect diagnostic.

Based on #89390; only the last commit is specific to this PR. "Ignore whitespace changes" also helps here.

The suggestion checked if Pin<Box<T>> could be coeerced to the expected
type, but did not check predicates created by the coercion. We now
look for predicates that definitely cannot be satisfied before giving
the suggestion.

The suggestion is marked MaybeIncorrect because we allow predicates that
are still ambiguous and can't be proven.
This only changed two tests and I consider both changes an improvement.
@rust-highfive
Copy link
Collaborator

r? @oli-obk

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 14, 2021
@tmandry
Copy link
Member Author

tmandry commented Oct 14, 2021

r? @estebank since this is a continuation of #89390

@rust-highfive rust-highfive assigned estebank and unassigned oli-obk Oct 14, 2021
@estebank
Copy link
Contributor

r=me once the parent PR lands

@apiraino apiraino added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Oct 14, 2021
@tmandry
Copy link
Member Author

tmandry commented Oct 14, 2021

@bors r=estebank

@bors
Copy link
Contributor

bors commented Oct 14, 2021

📌 Commit d18502d has been approved by estebank

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 14, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 15, 2021
…askrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#86011 (move implicit `Sized` predicate to end of list)
 - rust-lang#89821 (Add a strange test for `unsafe_code` lint.)
 - rust-lang#89859 (add dedicated error variant for writing the discriminant of an uninhabited enum variant)
 - rust-lang#89870 (Suggest Box::pin when Pin::new is used instead)
 - rust-lang#89880 (Use non-checking TLS relocation in aarch64 asm! sym test.)
 - rust-lang#89885 (add long explanation for E0183)
 - rust-lang#89894 (Remove unused dependencies from rustc_const_eval)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit e2c28ad into rust-lang:master Oct 15, 2021
@rustbot rustbot added this to the 1.57.0 milestone Oct 15, 2021
@tmandry tmandry deleted the box-pin branch November 5, 2021 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants