Closed
Description
This code compiles with a warning:
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.
Metadata
Metadata
Assignees
Labels
No labels