You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ rustc cast.rs
cast.rs:5:5: 5:19 warning: attempted to negate with overflow, #[warn(const_err)] on by default
cast.rs:5 i8::MIN as f32;
^~~~~~~~~~~~~~
The "evaluated" expression -128 as f32 doesn't trigger the warning. But if you expand the definition of i8::MIN i.e. ((-1 as i8) << 8 - 1) as f32 you also get a warning.
Neither of these three equivalent expressions should trigger a warning.