rust/tests/ui/const-generics/issues/issue-76701-ty-param-in-const.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
894 B
Plaintext
Raw Normal View History

2020-10-12 16:27:59 -05:00
error: generic parameters may not be used in const operations
--> $DIR/issue-76701-ty-param-in-const.rs:1:46
|
LL | fn ty_param<T>() -> [u8; std::mem::size_of::<T>()] {
| ^ cannot perform const operation using `T`
|
2020-10-12 16:27:59 -05:00
= note: type parameters may not be used in const expressions
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
2020-10-12 16:27:59 -05:00
error: generic parameters may not be used in const operations
--> $DIR/issue-76701-ty-param-in-const.rs:6:42
|
LL | fn const_param<const N: usize>() -> [u8; N + 1] {
| ^ cannot perform const operation using `N`
|
2020-10-12 16:27:59 -05:00
= help: const parameters may only be used as standalone arguments, i.e. `N`
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
error: aborting due to 2 previous errors