Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
b-naber committed Dec 5, 2021
1 parent 87ec568 commit 9520925
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/test/ui/const-generics/issues/issue-90455.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#![feature(generic_const_exprs, adt_const_params)]
#![allow(incomplete_features)]

struct FieldElement<const N: &'static str> {
n: [u64; num_limbs(N)],
//~^ ERROR unconstrained generic constant
}
const fn num_limbs(_: &str) -> usize {
0
}

fn main() {}
10 changes: 10 additions & 0 deletions src/test/ui/const-generics/issues/issue-90455.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
error: unconstrained generic constant
--> $DIR/issue-90455.rs:5:8
|
LL | n: [u64; num_limbs(N)],
| ^^^^^^^^^^^^^^^^^^^
|
= help: try adding a `where` bound using this expression: `where [(); num_limbs(N)]:`

error: aborting due to previous error

0 comments on commit 9520925

Please sign in to comment.