]> git.lizzy.rs Git - rust.git/blob - tests/ui/iterators/iter-count-overflow-debug.rs
Rollup merge of #106323 - starkat99:stabilize-f16c_target_feature, r=petrochenkov
[rust.git] / tests / 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 }