diff options
Diffstat (limited to 'tests/ui/iterators/iter-count-overflow-ndebug.rs')
-rw-r--r-- | tests/ui/iterators/iter-count-overflow-ndebug.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/ui/iterators/iter-count-overflow-ndebug.rs b/tests/ui/iterators/iter-count-overflow-ndebug.rs new file mode 100644 index 000000000..dcaaff671 --- /dev/null +++ b/tests/ui/iterators/iter-count-overflow-ndebug.rs @@ -0,0 +1,8 @@ +// run-pass +// only-32bit too impatient for 2⁶⁴ items +// compile-flags: -C debug_assertions=no -C opt-level=3 + +fn main() { + assert_eq!((0..usize::MAX).by_ref().count(), usize::MAX); + assert_eq!((0..=usize::MAX).by_ref().count(), 0); +} |