Skip to content

Commit a570928

Browse files
authored
Rollup merge of #80419 - LeSeulArtichaut:80375-test-case, r=lcnr
Add regression test for #80375 This will also make sure that #80375 is handled if #79135 has to be reverted (which won't happen 🤞). Closes #80375. r? `@lcnr`
2 parents 7800c70 + fcc88fa commit a570928

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)