-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Fix wrong suggestion for adding where clauses #97640
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Merged
bors
merged 1 commit into
rust-lang:master
from
TaKO8Ki:fix-wrong-suggestion-for-adding-where-clauses
Jun 3, 2022
Merged
Fix wrong suggestion for adding where clauses #97640
bors
merged 1 commit into
rust-lang:master
from
TaKO8Ki:fix-wrong-suggestion-for-adding-where-clauses
Jun 3, 2022
Conversation
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
(rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
7f6a1c8
to
b9df277
Compare
lcnr
reviewed
Jun 2, 2022
@@ -591,8 +591,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> { | |||
}) if !param_ty => { |
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you instead move that check to here?
a method called suggest_arbitrary_trait_bound
should ideally do just that unconditionally
b9df277
to
2898890
Compare
📌 Commit 2898890 has been approved by |
@bors r- |
@bors r+ rollup 😅 |
📌 Commit 2898890 has been approved by |
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Jun 2, 2022
…ding-where-clauses, r=lcnr Fix wrong suggestion for adding where clauses closes rust-lang#97576
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jun 3, 2022
…askrgr Rollup of 5 pull requests Successful merges: - rust-lang#97502 (rustdoc: Add more test coverage) - rust-lang#97627 (update explicit impls error msg) - rust-lang#97640 (Fix wrong suggestion for adding where clauses) - rust-lang#97645 (don't use a `span_note` for ignored impls) - rust-lang#97655 (Improve documentation for constructors of pinned `Box`es) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Dylan-DPC
added a commit
to Dylan-DPC/rust
that referenced
this pull request
Jun 11, 2022
…dy, r=cjgillot Tidy up miscellaneous bounds suggestions Just some small fixes to suggestions - Generalizes `Ty::is_suggestable` into a `TypeVisitor`, so that it can be called on things other than `Ty` - Makes `impl Trait` in arg position no longer suggestible (generalizing the fix in rust-lang#97640) - Fixes `impl Trait` not being replaced with fresh type param when it's deeply nested in function signature (fixes rust-lang#97760) - Fixes some poor handling of `where` clauses with no predicates (also rust-lang#97760) - Uses `InferCtxt::resolve_numeric_literals_with_default` so we suggest `i32` instead of `{integer}` (fixes rust-lang#97677) Sorry there aren't many tests the fixes. Most of them would just be duplicates of other tests with empty `where` clauses or `impl Trait` in arg position instead of generic params. Let me know if you'd want more test coverage.
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jun 12, 2022
…, r=cjgillot Tidy up miscellaneous bounds suggestions Just some small fixes to suggestions - Generalizes `Ty::is_suggestable` into a `TypeVisitor`, so that it can be called on things other than `Ty` - Makes `impl Trait` in arg position no longer suggestible (generalizing the fix in rust-lang#97640) - Fixes `impl Trait` not being replaced with fresh type param when it's deeply nested in function signature (fixes rust-lang#97760) - Fixes some poor handling of `where` clauses with no predicates (also rust-lang#97760) - Uses `InferCtxt::resolve_numeric_literals_with_default` so we suggest `i32` instead of `{integer}` (fixes rust-lang#97677) Sorry there aren't many tests the fixes. Most of them would just be duplicates of other tests with empty `where` clauses or `impl Trait` in arg position instead of generic params. Let me know if you'd want more test coverage.
# for free
to join this conversation on GitHub.
Already have an account?
# 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.
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.
closes #97576