]> git.lizzy.rs Git - rust.git/blob - src/test/ui/iterators/iter-count-overflow-ndebug.rs
Force optimization in 32-bit iter overflow tests
[rust.git] / src / test / ui / iterators / iter-count-overflow-ndebug.rs
1 // run-pass
2 // only-32bit too impatient for 2⁶⁴ items
3 // compile-flags: -C debug_assertions=no -C opt-level=3
4
5 use std::panic;
6 use std::usize::MAX;
7
8 fn main() {
9     assert_eq!((0..MAX).by_ref().count(), MAX);
10     assert_eq!((0..=MAX).by_ref().count(), 0);
11 }