os-rust/tests/ui/iterators/iter-step-overflow-ndebug.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

13 lines
299 B
Rust
Raw Normal View History

//@ run-pass
2016-09-12 11:23:02 -04:00
//@ compile-flags: -C debug_assertions=no
fn main() {
2020-06-02 07:59:11 +00:00
let mut it = u8::MAX..;
2016-11-02 10:11:53 -04:00
assert_eq!(it.next().unwrap(), 255);
2020-06-02 07:59:11 +00:00
assert_eq!(it.next().unwrap(), u8::MIN);
2016-09-12 11:23:02 -04:00
2020-06-02 07:59:11 +00:00
let mut it = i8::MAX..;
2016-11-02 10:11:53 -04:00
assert_eq!(it.next().unwrap(), 127);
2020-06-02 07:59:11 +00:00
assert_eq!(it.next().unwrap(), i8::MIN);
2016-09-12 11:23:02 -04:00
}