rust/tests/ui/iterators/skip-count-overflow.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

9 lines
218 B
Rust
Raw Normal View History

//@ run-pass
//@ only-32bit too impatient for 2⁶⁴ items
//@ compile-flags: -C overflow-checks -C opt-level=3
fn main() {
2020-06-02 02:59:11 -05:00
let i = (0..usize::MAX).chain(0..10).skip(usize::MAX);
assert_eq!(i.count(), 10);
}