-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Don't crash on non-existent path in constant. #28686
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
// FIXME: There's probably a better way to make sure we don't | ||
// panic here. | ||
if def.depth != 0 { | ||
signal!(e, NonConstPath); |
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.
You could extend the error enum to have a specific variant for this situation, as NonConstPath
signifies a valid but not constant path imo
☔ The latest upstream changes (presumably #28702) made this pull request unmergeable. Please resolve the merge conflicts. |
The behavior here isn't really ideal, but we can't really do much better given the current state of constant evaluation. Fixes rust-lang#28670, and probably a bunch of duplicates.
cc743f1
to
1763fcb
Compare
Updated with a new error kind and better comments. |
@bors r+ rollup |
📌 Commit 1763fcb has been approved by |
…=nikomatsakis The behavior here isn't really ideal, but we can't really do much better given the current state of constant evaluation. The changes to ExprUseVisitor are to avoid a compile error; apparently that bit of code is extremely sensitive to changes in other areas of the compiler. Fixes rust-lang#28670, and probably a bunch of duplicates.
…=nikomatsakis The behavior here isn't really ideal, but we can't really do much better given the current state of constant evaluation. The changes to ExprUseVisitor are to avoid a compile error; apparently that bit of code is extremely sensitive to changes in other areas of the compiler. Fixes rust-lang#28670, and probably a bunch of duplicates.
The behavior here isn't really ideal, but we can't really do much better
given the current state of constant evaluation.
The changes to ExprUseVisitor are to avoid a compile error; apparently
that bit of code is extremely sensitive to changes in other areas of the
compiler.
Fixes #28670, and probably a bunch of duplicates.