-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Improve error message for E0081 #97456
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
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @lcnr (or someone else) soon. Please see the contribution instructions for more information. |
Note that this was done by using the (existing) |
You probably need to re-bless your test stderr. Did you run |
This comment has been minimized.
This comment has been minimized.
Hmm I could have sworn i blessed the tests... strange |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Do you need to |
I'm on it. Ended up pulling from origin somehow and now i have to recompile everything locally to make the changes. I have the dream combo of weak laptop + slow connection so everything takes ages 😞 |
Moving the note to its own span seems kinda noisy:
Could also just remove it all-together |
This comment was marked as resolved.
This comment was marked as resolved.
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 actually kinda miss that "assigned value that was incremented from the previous value" error... could you add that back? Maybe pointing at the previous value, instead of the current one?
Something like
enum Foo {
A = 1, // first assignment of `0` here
B = 0, //~ assigned value for `C` was incremented from the previous value
C,
@Bryysen, let's go with #97456 (comment). |
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.
two tiny nitpicks, then we're good to go!
This comment has been minimized.
This comment has been minimized.
Previously whenever a duplicate discriminant was detected for an Enum, we would print the discriminant bits in the diagnostic without any casting. This caused us to display incorrect values for negative discriminants. After this PR we format the discriminant signedness correctly. Also reworded some of the original error messages.
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.
Wonderful, thanks for dealing with the back-and-forth of my comments. I will approve as soon as CI is green.
@bors r+ rollup |
📌 Commit f671bc9 has been approved by |
☀️ Test successful - checks-actions |
Finished benchmarking commit (abc7681): comparison url. Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results
CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression Footnotes |
Closes #97319