Skip to content
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

Merged

Conversation

compiler-errors
Copy link
Member

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

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Mar 8, 2023
@rustbot
Copy link
Collaborator

rustbot commented Mar 8, 2023

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@@ -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`
Copy link
Member Author

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.

@compiler-errors compiler-errors removed the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Mar 8, 2023
for (field, ty, reason) in fields {
// Only report an error once per type.
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Contributor

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.

Copy link
Member Author

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.

Copy link
Member

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!

Copy link
Member Author

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 🤣

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The screenshot in question:
2023-03-03_15-05

And ye, thanks for fixing this, errs <3

@WaffleLapkin
Copy link
Member

r? @WaffleLapkin
@bors r+ rollup

@bors
Copy link
Contributor

bors commented Mar 8, 2023

📌 Commit 0f4255e has been approved by WaffleLapkin

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 8, 2023
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Mar 8, 2023
…-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
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 8, 2023
…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
@bors bors merged commit 031b528 into rust-lang:master Mar 9, 2023
@rustbot rustbot added this to the 1.70.0 milestone Mar 9, 2023
@compiler-errors compiler-errors deleted the tweak-illegal-copy-impl-message branch August 11, 2023 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants