]> git.lizzy.rs Git - rust.git/blob - src/test/ui/iterators/iter-count-overflow-debug.rs
Auto merge of #100845 - timvermeulen:iter_compare, r=scottmcm
[rust.git] / src / test / ui / iterators / iter-count-overflow-debug.rs
1 // run-pass
2 // only-32bit too impatient for 2⁶⁴ items
3 // needs-unwind
4 // compile-flags: -C debug_assertions=yes -C opt-level=3
5
6 use std::panic;
7
8 fn main() {
9     assert_eq!((0..usize::MAX).by_ref().count(), usize::MAX);
10
11     let r = panic::catch_unwind(|| {
12         (0..=usize::MAX).by_ref().count()
13     });
14     assert!(r.is_err());
15 }