Fix ICE, generalize 'move generics to trait' suggestion for >0 non-rcvr arguments#101427
Merged
bors merged 1 commit intorust-lang:masterfrom Sep 6, 2022
Merged
Fix ICE, generalize 'move generics to trait' suggestion for >0 non-rcvr arguments#101427bors merged 1 commit intorust-lang:masterfrom
bors merged 1 commit intorust-lang:masterfrom
Conversation
Contributor
|
r? @wesleywiser (rust-highfive has picked a reviewer for you, use r? to override) |
compiler-errors
commented
Sep 5, 2022
Contributor
Author
There was a problem hiding this comment.
Nothing enforces this assertion as a precondition, and also it's artificially quite limiting. There's no reason we can't make this suggestion for when there are >1 arguments, and so I generalized it -- that's where most of this new logic comes from.
compiler-errors
commented
Sep 5, 2022
src/test/ui/suggestions/move-generic-to-trait-in-method-with-params.stderr
Outdated
Show resolved
Hide resolved
04bf53a to
763b3a5
Compare
cjgillot
reviewed
Sep 5, 2022
Contributor
cjgillot
left a comment
There was a problem hiding this comment.
I'm usually not a fan of span_to_snippet, but I don't see how else this would work here.
r=me with a few nits
compiler/rustc_typeck/src/structured_errors/wrong_number_of_generic_args.rs
Outdated
Show resolved
Hide resolved
compiler/rustc_typeck/src/structured_errors/wrong_number_of_generic_args.rs
Outdated
Show resolved
Hide resolved
compiler/rustc_typeck/src/structured_errors/wrong_number_of_generic_args.rs
Outdated
Show resolved
Hide resolved
Collaborator
|
☔ The latest upstream changes (presumably #101261) made this pull request unmergeable. Please resolve the merge conflicts. |
763b3a5 to
8219177
Compare
8219177 to
bee48e3
Compare
Contributor
Author
|
@bors r=cjgillot |
Collaborator
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Sep 6, 2022
Rollup of 5 pull requests Successful merges: - rust-lang#100658 (TyCtxt::get_attr should check that no duplicates are allowed) - rust-lang#101021 (Migrate ``rustc_middle`` diagnostic) - rust-lang#101287 (Document eager evaluation of `bool::then_some` argument) - rust-lang#101412 (Some more cleanup in `core`) - rust-lang#101427 (Fix ICE, generalize 'move generics to trait' suggestion for >0 non-rcvr arguments) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
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.
Fixes #101421
cc #100838