-
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
ICE when doing some casts on constant expressions #9867
Comments
Triage bump, updated example: extern {
fn read();
}
static a: u64 = read as u64;
fn main() {
println!("{:u}", a);
} This hits |
Getting a similar issue in my code. Alternative example:
Version is 0.10-pre (50e3aa3 2014-03-17 05:17:02 -0700)
NB this is for the arm-none-eabi target, but looks like the same issue- at least related. Can file a separate bug if it seems to be unrelated. |
What is VIC_INT in your example? |
Oops- had renamed to foo in one place, not the other. Fixed in above comment. Thanks for the catch. |
I think all the examples in here were fixed when issue #17458 was fixed. |
🎆 |
[arithmetic-side-effects] Consider negative numbers and add more tests Same as rust-lang#9867. Opening again because it is not possible to randomly choose a reviewer in an ongoing PR like in the rust repo. --- changelog: PF: [`arithmetic_side_effects`]: No longer lints on corner cases with negative number literals [rust-lang#9867](rust-lang/rust-clippy#9867) <!-- changelog_checked -->
The following code does not compile :
It fails with the following message :
Where as the following code, that does the same type of cast but in a non-constant expression, is valid :
Maybe I'm missing some point, but I don't see any good reason to disallow this type of casts at compile-time.
The text was updated successfully, but these errors were encountered: