-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Reword E0277 default error message #121766
Conversation
estebank
commented
Feb 28, 2024
fd85539
to
ede2ddf
Compare
This comment has been minimized.
This comment has been minimized.
ede2ddf
to
ad5c16d
Compare
This comment has been minimized.
This comment has been minimized.
ad5c16d
to
492bbf0
Compare
This comment has been minimized.
This comment has been minimized.
492bbf0
to
e2ddb78
Compare
Do you mind adding a fleshed out PR description that explains the motivation for this change? And also what it actually implements alongside the main message reordering, like erasing lifetimes from the predicate? For example, I assume that you're erasing lifetimes because you were getting split-up binders in error messages like "the trait In general, over-documenting rather than under-documenting is probably best for those who are exploring past PRs, and right now the PR is a bit light on the wording, especially given its size. |
@compiler-errors FWIW, I opened the PR for the benefit of the zulip chat conversation (which sadly ended up going to discuss an separate topic that I made the mistake of raising on the same thread) with the anticipation that the feedback might require many further changes to this code. I assigned to @oli-obk because we had been talking about making this change and needing input from t-types, so I knew he wouldn't r+ it until that conversation happened. I should probably have opened it as a draft PR. |
``` error[E0277]: the trait `Copy` is not implemented for `X` --> $DIR/trait-impl-bound-suggestions.rs:14:52 | LL | fn return_the_constrained_type(&self, x: X) -> ConstrainedStruct<X> { | ^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `X` ```
e2ddb78
to
f80daf4
Compare
@compiler-errors I need to edit the commit descriptions, but I split the changes into independent commits so that you can see what each change affects in the output.
That's what originally caught my attention, but as I was looking at it I noticed that the flat out removal of lifetimes made the message read clearer without too much lost information. This might be different if the only reason a bound failed was due to outlives restrictions, which we could handle independently. Another thing that would be nice not to lose would be |
☔ The latest upstream changes (presumably #121890) made this pull request unmergeable. Please resolve the merge conflicts. |
this patchset needs a rebase @rustbot author |