]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-eval/erroneous-const.stderr
Merge commit 'd0cf3481a84e3aa68c2f185c460e282af36ebc42' into clippyup
[rust.git] / src / test / ui / consts / const-eval / erroneous-const.stderr
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 length 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 length 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    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
27    = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
28
29 error[E0080]: could not evaluate static initializer
30   --> $DIR/erroneous-const.rs:15:17
31    |
32 LL |         let _ = PrintName::<T>::VOID;
33    |                 ^^^^^^^^^^^^^^^^^^^^
34    |                 |
35    |                 referenced constant has errors
36    |                 inside `no_codegen::<i32>` at $DIR/erroneous-const.rs:15:17
37 ...
38 LL | pub static FOO: () = no_codegen::<i32>();
39    |                      ------------------- inside `FOO` at $DIR/erroneous-const.rs:19:22
40
41 error: aborting due to previous error; 2 warnings emitted
42
43 For more information about this error, try `rustc --explain E0080`.