]> git.proxmox.com Git - rustc.git/blame - src/test/ui/consts/array-literal-index-oob.stderr
New upstream version 1.48.0~beta.8+dfsg1
[rustc.git] / src / test / ui / consts / array-literal-index-oob.stderr
CommitLineData
74b04a01 1warning: this operation will panic at runtime
dfeec247 2 --> $DIR/array-literal-index-oob.rs:7:8
48663c56 3 |
dfeec247 4LL | &{ [1, 2, 3][4] };
1b1a35ee 5 | ^^^^^^^^^^^^ index out of bounds: the length is 3 but the index is 4
48663c56 6 |
74b04a01
XL
7note: the lint level is defined here
8 --> $DIR/array-literal-index-oob.rs:4:20
dfeec247 9 |
74b04a01
XL
10LL | #![warn(const_err, unconditional_panic)]
11 | ^^^^^^^^^^^^^^^^^^^
48663c56 12
dfeec247
XL
13warning: reaching this expression at runtime will panic or abort
14 --> $DIR/array-literal-index-oob.rs:7:8
48663c56 15 |
dfeec247
XL
16LL | &{ [1, 2, 3][4] };
17 | ---^^^^^^^^^^^^--
18 | |
19 | indexing out of bounds: the len is 3 but the index is 4
74b04a01
XL
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 | ^^^^^^^^^
48663c56 26
dfeec247
XL
27warning: erroneous constant used
28 --> $DIR/array-literal-index-oob.rs:7:5
29 |
30LL | &{ [1, 2, 3][4] };
31 | ^^^^^^^^^^^^^^^^^ referenced constant has errors
48663c56 32
ba9703b0
XL
33warning: 3 warnings emitted
34