Move /src/test to /tests
This commit is contained in:
parent
ca855e6e42
commit
cf2dff2b1e
27592 changed files with 0 additions and 0 deletions
14
tests/ui/iterators/iter-sum-overflow-ndebug.rs
Normal file
14
tests/ui/iterators/iter-sum-overflow-ndebug.rs
Normal file
|
@ -0,0 +1,14 @@
|
|||
// run-pass
|
||||
// compile-flags: -C debug_assertions=no
|
||||
|
||||
fn main() {
|
||||
assert_eq!([1i32, i32::MAX].iter().sum::<i32>(),
|
||||
1i32.wrapping_add(i32::MAX));
|
||||
assert_eq!([2i32, i32::MAX].iter().product::<i32>(),
|
||||
2i32.wrapping_mul(i32::MAX));
|
||||
|
||||
assert_eq!([1i32, i32::MAX].iter().cloned().sum::<i32>(),
|
||||
1i32.wrapping_add(i32::MAX));
|
||||
assert_eq!([2i32, i32::MAX].iter().cloned().product::<i32>(),
|
||||
2i32.wrapping_mul(i32::MAX));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue