fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
894 B20 linesraw
1error: generic parameters may not be used in const operations
2  --> $DIR/issue-76701-ty-param-in-const.rs:1:46
3   |
4LL | fn ty_param<T>() -> [u8; std::mem::size_of::<T>()] {
5   |                                              ^ cannot perform const operation using `T`
6   |
7   = note: type parameters may not be used in const expressions
8   = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
9
10error: generic parameters may not be used in const operations
11  --> $DIR/issue-76701-ty-param-in-const.rs:6:42
12   |
13LL | fn const_param<const N: usize>() -> [u8; N + 1] {
14   |                                          ^ cannot perform const operation using `N`
15   |
16   = help: const parameters may only be used as standalone arguments, i.e. `N`
17   = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
18
19error: aborting due to 2 previous errors
20