]> git.lizzy.rs Git - rust.git/blob - src/test/ui/iterators/iter-count-overflow-debug.rs
Merge commit 'e329249b6a3a98830d860c74c8234a8dd9407436' into clippyup
[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 // ignore-wasm32-bare compiled with panic=abort by default
5 // compile-flags: -C debug_assertions=yes -C opt-level=3
6
7 use std::panic;
8
9 fn main() {
10     assert_eq!((0..usize::MAX).by_ref().count(), usize::MAX);
11
12     let r = panic::catch_unwind(|| {
13         (0..=usize::MAX).by_ref().count()
14     });
15     assert!(r.is_err());
16 }