-
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
-(-0.0)
raises const_err "attempt to negate with overflow"
#64059
Comments
cc @oli-obk |
Huh... const X: f32 = -(-0.0);
const Y: f64 = -(-0.0); compiles fine. rust/src/librustc_mir/transform/const_prop.rs Line 414 in d0677b9
is the cause. It was created just for signed integers, and I believe we don't need this anymore. We are now emitting the warning on the So in order to fix this (and deduplicate a bunch of warnings in our test suite), remove rust/src/librustc_mir/transform/const_prop.rs Lines 410 to 421 in d0677b9
--bless
|
Fix const_err with `-(-0.0)` Fixes rust-lang#64059 r? @oli-obk
Fix const_err with `-(-0.0)` Fixes rust-lang#64059 r? @oli-obk
Fix const_err with `-(-0.0)` Fixes rust-lang#64059 r? @oli-obk
Fix const_err with `-(-0.0)` Fixes rust-lang#64059 r? @oli-obk
Fix const_err with `-(-0.0)` Fixes rust-lang#64059 r? @oli-obk
Meta
The text was updated successfully, but these errors were encountered: