rust/src/test/ui/iterators/iter-step-overflow-ndebug.rs

13 lines
329 B
Rust
Raw Normal View History

// run-pass
2016-09-12 10:23:02 -05:00
// compile-flags: -C debug_assertions=no
fn main() {
let mut it = u8::max_value()..;
2016-11-02 09:11:53 -05:00
assert_eq!(it.next().unwrap(), 255);
2016-10-22 15:27:31 -05:00
assert_eq!(it.next().unwrap(), u8::min_value());
2016-09-12 10:23:02 -05:00
let mut it = i8::max_value()..;
2016-11-02 09:11:53 -05:00
assert_eq!(it.next().unwrap(), 127);
2016-10-22 15:27:31 -05:00
assert_eq!(it.next().unwrap(), i8::min_value());
2016-09-12 10:23:02 -05:00
}