]> git.proxmox.com Git - rustc.git/blobdiff - 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
index e93aa324784c3820629c81cfa1c7f99acb56d1ad..5916ea6d323e603e9e039d775912d1bbd5b3952a 100644 (file)
@@ -1,14 +1,14 @@
-warning: index out of bounds: the len is 3 but the index is 4
+warning: this operation will panic at runtime
   --> $DIR/array-literal-index-oob.rs:7:8
    |
 LL |     &{ [1, 2, 3][4] };
-   |        ^^^^^^^^^^^^
+   |        ^^^^^^^^^^^^ index out of bounds: the length is 3 but the index is 4
    |
-note: lint level defined here
-  --> $DIR/array-literal-index-oob.rs:4:9
+note: the lint level is defined here
+  --> $DIR/array-literal-index-oob.rs:4:20
    |
-LL | #![warn(const_err)]
-   |         ^^^^^^^^^
+LL | #![warn(const_err, unconditional_panic)]
+   |                    ^^^^^^^^^^^^^^^^^^^
 
 warning: reaching this expression at runtime will panic or abort
   --> $DIR/array-literal-index-oob.rs:7:8
@@ -17,6 +17,12 @@ LL |     &{ [1, 2, 3][4] };
    |     ---^^^^^^^^^^^^--
    |        |
    |        indexing out of bounds: the len is 3 but the index is 4
+   |
+note: the lint level is defined here
+  --> $DIR/array-literal-index-oob.rs:4:9
+   |
+LL | #![warn(const_err, unconditional_panic)]
+   |         ^^^^^^^^^
 
 warning: erroneous constant used
   --> $DIR/array-literal-index-oob.rs:7:5
@@ -24,3 +30,5 @@ warning: erroneous constant used
 LL |     &{ [1, 2, 3][4] };
    |     ^^^^^^^^^^^^^^^^^ referenced constant has errors
 
+warning: 3 warnings emitted
+