]> git.lizzy.rs Git - rust.git/blob - tests/ui/const-generics/legacy-const-generics-bad.stderr
Auto merge of #106908 - cjgillot:copyprop-ssa, r=oli-obk
[rust.git] / tests / ui / const-generics / legacy-const-generics-bad.stderr
1 error[E0435]: attempt to use a non-constant value in a constant
2   --> $DIR/legacy-const-generics-bad.rs:7:35
3    |
4 LL |     let a = 1;
5    |     ----- help: consider using `const` instead of `let`: `const a`
6 LL |     legacy_const_generics::foo(0, a, 2);
7    |                                   ^ non-constant value
8
9 error: generic parameters may not be used in const operations
10   --> $DIR/legacy-const-generics-bad.rs:12:35
11    |
12 LL |     legacy_const_generics::foo(0, N + 1, 2);
13    |                                   ^ cannot perform const operation using `N`
14    |
15    = help: const parameters may only be used as standalone arguments, i.e. `N`
16    = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
17
18 error: aborting due to 2 previous errors
19
20 For more information about this error, try `rustc --explain E0435`.