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
955 B32 linesraw
1warning: this operation will panic at runtime
2  --> $DIR/array-literal-index-oob.rs:7:8
3   |
4LL |     &{ [1, 2, 3][4] };
5   |        ^^^^^^^^^^^^ index out of bounds: the len is 3 but the index is 4
6   |
7note: the lint level is defined here
8  --> $DIR/array-literal-index-oob.rs:4:20
9   |
10LL | #![warn(const_err, unconditional_panic)]
11   |                    ^^^^^^^^^^^^^^^^^^^
12
13warning: reaching this expression at runtime will panic or abort
14  --> $DIR/array-literal-index-oob.rs:7:8
15   |
16LL |     &{ [1, 2, 3][4] };
17   |     ---^^^^^^^^^^^^--
18   |        |
19   |        indexing out of bounds: the len is 3 but the index is 4
20   |
21note: the lint level is defined here
22  --> $DIR/array-literal-index-oob.rs:4:9
23   |
24LL | #![warn(const_err, unconditional_panic)]
25   |         ^^^^^^^^^
26
27warning: erroneous constant used
28  --> $DIR/array-literal-index-oob.rs:7:5
29   |
30LL |     &{ [1, 2, 3][4] };
31   |     ^^^^^^^^^^^^^^^^^ referenced constant has errors
32