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
let x:u8 = 256;// warning: literal out of range for u8
I can think of no use case for allowing overflowing literals. The lint has existed since 2012, back before we had any firm story regarding integer overflow and back when literal underflow was also allowed (in modern Rust, integer literal underflow is a parse error). This is a prime candidate for a lint that advances to deny for the 2018 edition.
The text was updated successfully, but these errors were encountered:
This code compiles with a warning:
I can think of no use case for allowing overflowing literals. The lint has existed since 2012, back before we had any firm story regarding integer overflow and back when literal underflow was also allowed (in modern Rust, integer literal underflow is a parse error). This is a prime candidate for a lint that advances to deny for the 2018 edition.
The text was updated successfully, but these errors were encountered: