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