-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Tweak illegal Copy
impl message
#108884
Tweak illegal Copy
impl message
#108884
Conversation
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
@@ -324,7 +324,7 @@ pub trait StructuralEq { | |||
/// attempt to derive a `Copy` implementation, we'll get an error: | |||
/// | |||
/// ```text | |||
/// the trait `Copy` may not be implemented for this type; field `points` does not implement `Copy` | |||
/// the trait `Copy` cannot be implemented for this type; field `points` does not implement `Copy` |
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.
Lol, this is just a documentation change.
for (field, ty, reason) in fields { | ||
// Only report an error once per type. |
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.
so if more than one field isn't copy, it won't report all fields? am i understanding that right?
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.
It does not highlight subsequent fields with identical types.
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.
oh once per field type, got it.
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.
This is actually unrelated to the example code you gave me, and was something that @fee1-dead had pointed out somewhere else a few days ago. It just came to mind when I was making the change.
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.
I think it was from @WaffleLapkin? Anyways thanks for working on this!
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.
oops, just remember seeing a screenshot of a really bad error message somewhere 🤣
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.
r? @WaffleLapkin |
…-impl-message, r=WaffleLapkin Tweak illegal `Copy` impl message The phrase "may not" can both mean "is not able to" and "possibly does not". Disambiguate this by just using "cannot". `@Lokathor` expressed being annoyed by this [here](https://twitter.com/Lokathor/status/1633200313544089602?s=20). Also drive-by fix for this extremely noisy message: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=6a37275bc810f7846bfe191845b7d11d. r? diagnostics
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#108686 (rustdoc: include link on all.html location header) - rust-lang#108846 (StableMIR: Proof-of-concept implementation + test ) - rust-lang#108873 (Simplify `sort_by` calls) - rust-lang#108883 (Suppress copy impl error when post-normalized type references errors) - rust-lang#108884 (Tweak illegal `Copy` impl message) - rust-lang#108887 (Rename `MapInPlace` as `FlatMapInPlace`.) - rust-lang#108901 (fix: evaluate with wrong obligation stack) - rust-lang#108903 (Move Clippy tests back to their intended directory) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
The phrase "may not" can both mean "is not able to" and "possibly does not". Disambiguate this by just using "cannot".
@Lokathor expressed being annoyed by this here.
Also drive-by fix for this extremely noisy message: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=6a37275bc810f7846bfe191845b7d11d.
r? diagnostics