]> git.lizzy.rs Git - rust.git/blob - tests/ui/consts/non-const-value-in-const.stderr
Rollup merge of #106951 - tmiasko:rm-simplify-initial, r=oli-obk
[rust.git] / tests / ui / consts / non-const-value-in-const.stderr
1 error[E0435]: attempt to use a non-constant value in a constant
2   --> $DIR/non-const-value-in-const.rs:3:20
3    |
4 LL |     const Y: i32 = x;
5    |     -------        ^ non-constant value
6    |     |
7    |     help: consider using `let` instead of `const`: `let Y`
8
9 error[E0435]: attempt to use a non-constant value in a constant
10   --> $DIR/non-const-value-in-const.rs:6:17
11    |
12 LL |     let x = 5;
13    |     ----- help: consider using `const` instead of `let`: `const x`
14 ...
15 LL |     let _ = [0; x];
16    |                 ^ non-constant value
17
18 error: aborting due to 2 previous errors
19
20 For more information about this error, try `rustc --explain E0435`.