2019-07-08 14:03:21 -05:00
|
|
|
// run-pass
|
|
|
|
// only-32bit too impatient for 2⁶⁴ items
|
2021-12-03 09:32:51 -06:00
|
|
|
// needs-unwind
|
2019-08-12 19:29:34 -05:00
|
|
|
// compile-flags: -C debug_assertions=yes -C opt-level=3
|
2019-07-08 14:03:21 -05:00
|
|
|
|
|
|
|
use std::panic;
|
|
|
|
|
|
|
|
fn main() {
|
2020-10-24 18:21:40 -05:00
|
|
|
assert_eq!((0..usize::MAX).by_ref().count(), usize::MAX);
|
2019-07-08 14:03:21 -05:00
|
|
|
|
|
|
|
let r = panic::catch_unwind(|| {
|
2020-10-24 18:21:40 -05:00
|
|
|
(0..=usize::MAX).by_ref().count()
|
2019-07-08 14:03:21 -05:00
|
|
|
});
|
|
|
|
assert!(r.is_err());
|
|
|
|
}
|