fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #71868 - Mark-Simulacrum:stable-1.43.1, r=pietroalbini8d69840ab92

1.43.1
1.5 KiB48 linesraw
1error: this arithmetic operation will overflow
2  --> $DIR/const-err2.rs:19:13
3   |
4LL |     let a = -std::i8::MIN;
5   |             ^^^^^^^^^^^^^ attempt to negate with overflow
6   |
7   = note: `#[deny(arithmetic_overflow)]` on by default
8
9error: this arithmetic operation will overflow
10  --> $DIR/const-err2.rs:21:18
11   |
12LL |     let a_i128 = -std::i128::MIN;
13   |                  ^^^^^^^^^^^^^^^ attempt to negate with overflow
14
15error: this arithmetic operation will overflow
16  --> $DIR/const-err2.rs:23:13
17   |
18LL |     let b = 200u8 + 200u8 + 200u8;
19   |             ^^^^^^^^^^^^^ attempt to add with overflow
20
21error: this arithmetic operation will overflow
22  --> $DIR/const-err2.rs:25:18
23   |
24LL |     let b_i128 = std::i128::MIN - std::i128::MAX;
25   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to subtract with overflow
26
27error: this arithmetic operation will overflow
28  --> $DIR/const-err2.rs:27:13
29   |
30LL |     let c = 200u8 * 4;
31   |             ^^^^^^^^^ attempt to multiply with overflow
32
33error: this arithmetic operation will overflow
34  --> $DIR/const-err2.rs:29:13
35   |
36LL |     let d = 42u8 - (42u8 + 1);
37   |             ^^^^^^^^^^^^^^^^^ attempt to subtract with overflow
38
39error: this operation will panic at runtime
40  --> $DIR/const-err2.rs:31:14
41   |
42LL |     let _e = [5u8][1];
43   |              ^^^^^^^^ index out of bounds: the len is 1 but the index is 1
44   |
45   = note: `#[deny(unconditional_panic)]` on by default
46
47error: aborting due to 7 previous errors
48