-
Notifications
You must be signed in to change notification settings - Fork 13k
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
A bit more polish on const eval errors #85767
Conversation
cc @rust-lang/wg-const-eval |
@@ -1,4 +1,4 @@ | |||
error[E0080]: evaluation of constant value failed | |||
error[E0080]: evaluation of `test::<0_usize>::{constant#0}` failed |
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.
we already report such paths (with {constant#0}) in other situations. It's not ideal, but maybe better than not mentioning the path?
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.
For reference, there are indeed a few cases in the ui tests where this happens today, for example
rust/src/test/ui/mir/issue-80742.stderr
Lines 10 to 14 in ce0d64e
::: $DIR/issue-80742.rs:23:10 | |
| | |
LL | [u8; size_of::<T>() + 1]: , | |
| -------------- inside `Inline::<dyn Debug>::{constant#0}` at $DIR/issue-80742.rs:23:10 | |
(After/if this PR is merged, I'll work on changing these messages: to keep the originating span, but not the full instance path, so that they are not duplicated)
@bors r+ |
📌 Commit c31ca9a has been approved by |
☀️ Test successful - checks-actions |
This PR adds a bit more polish to the const eval errors:
So we get this slight improvement for our beloved
stdarch
example, on nightly:to this PR's:
with this PR.
Of course this is an idea from Oli, so maybe r? @oli-obk if they have the time.