We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2fab321 commit fcc88faCopy full SHA for fcc88fa
src/test/ui/const-generics/issues/issue-80375.rs
@@ -0,0 +1,4 @@
1
+struct MyArray<const COUNT: usize>([u8; COUNT + 1]);
2
+//~^ ERROR generic parameters may not be used in const operations
3
+
4
+fn main() {}
src/test/ui/const-generics/issues/issue-80375.stderr
@@ -0,0 +1,11 @@
+error: generic parameters may not be used in const operations
+ --> $DIR/issue-80375.rs:1:41
+ |
+LL | struct MyArray<const COUNT: usize>([u8; COUNT + 1]);
5
+ | ^^^^^ cannot perform const operation using `COUNT`
6
7
+ = help: const parameters may only be used as standalone arguments, i.e. `COUNT`
8
+ = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
9
10
+error: aborting due to previous error
11
0 commit comments