-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.
Description
I would expect that the the following prints would lead to the same result, instead rust complains about 256 being out of range for u8, which is correct, but because end is exclusive, it should't complain.
#![feature(inclusive_range_syntax)]
fn main() {
let range_a = 0..256;
let range_b = 0..=255;
println!("{:?}", range_a.collect::<Vec<u8>>());
println!("{:?}", range_b.collect::<Vec<u8>>());
}
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.