We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Now that inclusive ranges are stabilized, we have a good way to write (for example) 0..=255u8. Right now compiling:
0..=255u8
fn main() { for i in 0..256u8 { println!("{}", i); } }
will give the error message:
warning: literal out of range for u8 --> src/main.rs:2:17 | 2 | for i in 0..256u8 { | ^^^^^ | = note: #[warn(overflowing_literals)] on by default
I believe it should additionally suggest using 0..=255u8 as a teaching aid.
The text was updated successfully, but these errors were encountered:
This is a duplicate of #47213.
Sorry, something went wrong.
No branches or pull requests
Now that inclusive ranges are stabilized, we have a good way to write (for example)
0..=255u8
. Right now compiling:will give the error message:
I believe it should additionally suggest using
0..=255u8
as a teaching aid.The text was updated successfully, but these errors were encountered: