|
| 1 | +error: this arithmetic operation will overflow |
| 2 | + --> $DIR/issue-117949.rs:16:24 |
| 3 | + | |
| 4 | +LL | format_args!("{}", 5 * i32::MAX); |
| 5 | + | ^^^^^^^^^^^^ attempt to compute `5_i32 * i32::MAX`, which would overflow |
| 6 | + | |
| 7 | + = note: `#[deny(arithmetic_overflow)]` on by default |
| 8 | + |
| 9 | +error: this arithmetic operation will overflow |
| 10 | + --> $DIR/issue-117949.rs:15:24 |
| 11 | + | |
| 12 | +LL | format_args!("{}", -5 - i32::MAX); |
| 13 | + | ^^^^^^^^^^^^^ attempt to compute `-5_i32 - i32::MAX`, which would overflow |
| 14 | + |
| 15 | +error: this arithmetic operation will overflow |
| 16 | + --> $DIR/issue-117949.rs:14:24 |
| 17 | + | |
| 18 | +LL | format_args!("{}", 1 + i32::MAX); |
| 19 | + | ^^^^^^^^^^^^ attempt to compute `1_i32 + i32::MAX`, which would overflow |
| 20 | + |
| 21 | +error: this arithmetic operation will overflow |
| 22 | + --> $DIR/issue-117949.rs:13:24 |
| 23 | + | |
| 24 | +LL | format_args!("{}", 1 >> 32); |
| 25 | + | ^^^^^^^ attempt to shift right by `32_i32`, which would overflow |
| 26 | + |
| 27 | +error: this arithmetic operation will overflow |
| 28 | + --> $DIR/issue-117949.rs:12:24 |
| 29 | + | |
| 30 | +LL | format_args!("{}", 1 << 32); |
| 31 | + | ^^^^^^^ attempt to shift left by `32_i32`, which would overflow |
| 32 | + |
| 33 | +error: this operation will panic at runtime |
| 34 | + --> $DIR/issue-117949.rs:17:24 |
| 35 | + | |
| 36 | +LL | format_args!("{}", 1 / 0); |
| 37 | + | ^^^^^ attempt to divide `1_i32` by zero |
| 38 | + | |
| 39 | + = note: `#[deny(unconditional_panic)]` on by default |
| 40 | + |
| 41 | +error: this operation will panic at runtime |
| 42 | + --> $DIR/issue-117949.rs:18:24 |
| 43 | + | |
| 44 | +LL | format_args!("{}", 1 % 0); |
| 45 | + | ^^^^^ attempt to calculate the remainder of `1_i32` with a divisor of zero |
| 46 | + |
| 47 | +error: this operation will panic at runtime |
| 48 | + --> $DIR/issue-117949.rs:19:24 |
| 49 | + | |
| 50 | +LL | format_args!("{}", [1, 2, 3][4]); |
| 51 | + | ^^^^^^^^^^^^ index out of bounds: the length is 3 but the index is 4 |
| 52 | + |
| 53 | +error: aborting due to 8 previous errors |
| 54 | + |
0 commit comments