]> git.lizzy.rs Git - rust.git/blob - src/test/ui/iterators/iter-count-overflow-debug.rs
Add 'src/tools/rust-analyzer/' from commit '977e12a0bdc3e329af179ef3a9d466af9eb613bb'
[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 }