fork/rust

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

borsAuto merge of #67350 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum73528e339aa

1.40.0
1.2 KiB44 linesraw
1error: this expression will panic at runtime
2  --> $DIR/const-err2.rs:16:13
3   |
4LL |     let a = -std::i8::MIN;
5   |             ^^^^^^^^^^^^^ attempt to negate with overflow
6   |
7note: lint level defined here
8  --> $DIR/const-err2.rs:9:9
9   |
10LL | #![deny(const_err)]
11   |         ^^^^^^^^^
12
13error: this expression will panic at runtime
14  --> $DIR/const-err2.rs:18:13
15   |
16LL |     let b = 200u8 + 200u8 + 200u8;
17   |             ^^^^^^^^^^^^^ attempt to add with overflow
18
19error: this expression will panic at runtime
20  --> $DIR/const-err2.rs:20:13
21   |
22LL |     let c = 200u8 * 4;
23   |             ^^^^^^^^^ attempt to multiply with overflow
24
25error: this expression will panic at runtime
26  --> $DIR/const-err2.rs:22:13
27   |
28LL |     let d = 42u8 - (42u8 + 1);
29   |             ^^^^^^^^^^^^^^^^^ attempt to subtract with overflow
30
31error: index out of bounds: the len is 1 but the index is 1
32  --> $DIR/const-err2.rs:24:14
33   |
34LL |     let _e = [5u8][1];
35   |              ^^^^^^^^
36
37error: this expression will panic at runtime
38  --> $DIR/const-err2.rs:24:14
39   |
40LL |     let _e = [5u8][1];
41   |              ^^^^^^^^ index out of bounds: the len is 1 but the index is 1
42
43error: aborting due to 6 previous errors
44