Fix incorrect Box::pin suggestion#89390
Merged
bors merged 5 commits intorust-lang:masterfrom Oct 14, 2021
Merged
Conversation
Contributor
|
r? @cjgillot (rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
1673b80 to
68595d4
Compare
Member
Author
|
r? @estebank |
estebank
reviewed
Oct 8, 2021
Contributor
There was a problem hiding this comment.
Do we have positive tests for these where the type involved can be coerced and the suggestion occurs?
r=me with either an answer or a new test (to avoid regressions there, I'm on the road right now or I'd check myself)
Member
Author
There was a problem hiding this comment.
Looks like yep, ui/inference/deref-suggestion
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.
Member
Author
|
@bors r=estebank |
Collaborator
|
📌 Commit a8558e9 has been approved by |
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Oct 14, 2021
Fix incorrect Box::pin suggestion 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 still marked MaybeIncorrect because we allow predicates that are still ambiguous and can't be proven. Fixes rust-lang#72117.
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Oct 14, 2021
…askrgr Rollup of 6 pull requests Successful merges: - rust-lang#89390 (Fix incorrect Box::pin suggestion) - rust-lang#89433 (Fix ctrl-c causing reads of stdin to return empty on Windows.) - rust-lang#89823 (Switch order of terms to prevent overflow) - rust-lang#89865 (Allow static linking LLVM with ThinLTO) - rust-lang#89873 (Add missing word to `FromStr` trait documentation) - rust-lang#89878 (Fix missing remaining compiler specific cfg information) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Oct 15, 2021
Suggest Box::pin when Pin::new is used instead This fixes an incorrect diagnostic. **Based on rust-lang#89390**; only the last commit is specific to this PR. "Ignore whitespace changes" also helps here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The suggestion checked if
Pin<Box<T>>could be coeerced to the expectedtype, 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 still marked MaybeIncorrect because we allow predicates that
are still ambiguous and can't be proven.
Fixes #72117.