Closed
Description
The range for u8
does not work properly, it panics at the (valid) value 255. If this behavior is expected for bytes it should be documentated.
I tried this code to check correctness and it panics:
fn main() { assert_eq!((0u8..).last(), Some(255)); }
thread 'main' panicked at 'arithmetic operation overflowed', ../src/libcore/ops.rs:211
note: Run withRUST_BACKTRACE=1
for a backtrace.
Rusty greedings, Christopher
#24119