2019-07-08 14:10:58 -05:00
|
|
|
//@ run-pass
|
|
|
|
//@ only-32bit too impatient for 2⁶⁴ items
|
2019-08-12 19:29:34 -05:00
|
|
|
//@ compile-flags: -C debug_assertions=no -C opt-level=3
|
2019-07-08 14:10:58 -05:00
|
|
|
|
|
|
|
fn main() {
|
2020-10-24 18:21:40 -05:00
|
|
|
let n = usize::MAX as u64;
|
|
|
|
assert_eq!((0..).by_ref().position(|i| i >= n), Some(usize::MAX));
|
2019-07-08 14:10:58 -05:00
|
|
|
assert_eq!((0..).by_ref().position(|i| i > n), Some(0));
|
|
|
|
assert_eq!((0..=n + 1).by_ref().position(|_| false), None);
|
|
|
|
}
|