Skip to content

Commit fcc88fa

Browse files
Add regression test for #80375
1 parent 2fab321 commit fcc88fa

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -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() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error: generic parameters may not be used in const operations
2+
--> $DIR/issue-80375.rs:1:41
3+
|
4+
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

Comments
 (0)