|
| 1 | +warning: this operation will panic at runtime |
| 2 | + --> $DIR/erroneous-const.rs:6:22 |
| 3 | + | |
| 4 | +LL | const VOID: () = [()][2]; |
| 5 | + | ^^^^^^^ index out of bounds: the len is 1 but the index is 2 |
| 6 | + | |
| 7 | +note: the lint level is defined here |
| 8 | + --> $DIR/erroneous-const.rs:2:20 |
| 9 | + | |
| 10 | +LL | #![warn(const_err, unconditional_panic)] |
| 11 | + | ^^^^^^^^^^^^^^^^^^^ |
| 12 | + |
| 13 | +warning: any use of this value will cause an error |
| 14 | + --> $DIR/erroneous-const.rs:6:22 |
| 15 | + | |
| 16 | +LL | const VOID: () = [()][2]; |
| 17 | + | -----------------^^^^^^^- |
| 18 | + | | |
| 19 | + | index out of bounds: the len is 1 but the index is 2 |
| 20 | + | |
| 21 | +note: the lint level is defined here |
| 22 | + --> $DIR/erroneous-const.rs:2:9 |
| 23 | + | |
| 24 | +LL | #![warn(const_err, unconditional_panic)] |
| 25 | + | ^^^^^^^^^ |
| 26 | + |
| 27 | +error[E0080]: evaluation of constant value failed |
| 28 | + --> $DIR/erroneous-const.rs:11:5 |
| 29 | + | |
| 30 | +LL | / if false { |
| 31 | +LL | | let _ = PrintName::<T>::VOID; |
| 32 | +LL | | } |
| 33 | + | |_____^ referenced constant has errors |
| 34 | + |
| 35 | +error[E0080]: could not evaluate static initializer |
| 36 | + --> $DIR/erroneous-const.rs:16:22 |
| 37 | + | |
| 38 | +LL | pub static FOO: () = no_codegen::<i32>(); |
| 39 | + | ^^^^^^^^^^^^^^^^^^^ referenced constant has errors |
| 40 | + |
| 41 | +error: aborting due to 2 previous errors; 2 warnings emitted |
| 42 | + |
| 43 | +For more information about this error, try `rustc --explain E0080`. |
0 commit comments