2019-07-08 12:03:21 -07:00
|
|
|
// run-pass
|
|
|
|
// only-32bit too impatient for 2⁶⁴ items
|
2019-10-18 14:47:54 -07:00
|
|
|
// ignore-wasm32-bare compiled with panic=abort by default
|
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;
|
|
|
|
use std::usize::MAX;
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
assert_eq!((0..MAX).by_ref().count(), MAX);
|
|
|
|
|
|
|
|
let r = panic::catch_unwind(|| {
|
|
|
|
(0..=MAX).by_ref().count()
|
|
|
|
});
|
|
|
|
assert!(r.is_err());
|
|
|
|
}
|