-
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
Match checking doesn't handle static constants correctly. #12501
Comments
The ICE seems to have been fixed without mentioning this issue. |
cc #23897 |
@eddyb I cannot reproduce the issue now; i.e. when I try (e.g. by plugging in mismatched types for the initializer, and also experimenting with using can you make another example at this point demonstrating the issue here? |
e.g. here is one version of updated code, but it compiles and runs (playpen): #![feature(negate_unsigned)]
fn main() {
const MAX: usize = -1;
match 0 {
1usize...MAX => {},
_ => {}
}
} |
@pnkfelix it must have been fixed by adding more type information to const_eval, I guess. |
closing, assumed fixed |
internal: Update dashmap and freeze its version
I would guess it doesn't go (properly) through const eval, causing weird errors like this one:
If the value of
MAX
is changed to-1u
, the code compiles, showing that match checking looks at the value of thestatic MAX
but not at its type or computed value.Further experimentation - using
-1 as uint
forMAX
- produces this ICE:The text was updated successfully, but these errors were encountered: