This commit is contained in:
b-naber 2021-11-03 15:36:38 +01:00
parent 87ec5680c9
commit 95209252f5
2 changed files with 22 additions and 0 deletions

View File

@ -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() {}

View File

@ -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