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