Use impl's generics when suggesting fix on bad impl Copy#99741
Merged
bors merged 1 commit intorust-lang:masterfrom Jul 31, 2022
Merged
Use impl's generics when suggesting fix on bad impl Copy#99741bors merged 1 commit intorust-lang:masterfrom
impl's generics when suggesting fix on bad impl Copy#99741bors merged 1 commit intorust-lang:masterfrom
Conversation
Contributor
|
r? @fee1-dead (rust-highfive has picked a reviewer for you, use r? to override) |
eb74e15 to
1390220
Compare
fee1-dead
approved these changes
Jul 31, 2022
Comment on lines
+10
to
+14
| note: the `Copy` impl for `OnlyCopyIfDisplay<S>` requires that `S: std::fmt::Display` | ||
| --> $DIR/missing-bound-in-manual-copy-impl-2.rs:4:19 | ||
| | | ||
| LL | struct Wrapper<T>(T); | ||
| | ^ |
Member
There was a problem hiding this comment.
Sorry for the late review. This span could be better but we can leave it as followup.
Contributor
Author
There was a problem hiding this comment.
Thanks. You're right, this is super misleading. I'll fix it.
Member
|
@bors r+ |
Collaborator
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jul 31, 2022
Rollup of 5 pull requests Successful merges: - rust-lang#99186 (Use LocalDefId for closures more) - rust-lang#99741 (Use `impl`'s generics when suggesting fix on bad `impl Copy`) - rust-lang#99844 (Introduce an ArchiveBuilderBuilder) - rust-lang#99921 (triagebot.yml: CC Enselic when rustdoc-json-types changes) - rust-lang#99974 (Suggest removing a semicolon and boxing the expressions for if-else) 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.
See the UI test for a more complicated example, but we weren't correctly suggesting to add bounds given a manual
implwhose generics didn't match the struct generics.Coincidentally this fix didn't cause any regressions for
derive(Copy)impls, I think because those use the same spans in the impl generics as the struct generics, so the machinery still applies the same change.