Skip to content
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

Turn the overflowing_literals lint from warn to deny for the 2018 edition #50633

Closed
bstrie opened this issue May 10, 2018 · 2 comments
Closed

Comments

@bstrie
Copy link
Contributor

bstrie commented May 10, 2018

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.

@steveklabnik
Copy link
Member

steveklabnik commented May 10, 2018

Changes to lints currently require an RFC; this should be pursued over there.

@bstrie
Copy link
Contributor Author

bstrie commented May 11, 2018

RFC filed: rust-lang/rfcs#2438

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants