add test
This commit is contained in:
parent
87ec5680c9
commit
95209252f5
12
src/test/ui/const-generics/issues/issue-90455.rs
Normal file
12
src/test/ui/const-generics/issues/issue-90455.rs
Normal 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() {}
|
10
src/test/ui/const-generics/issues/issue-90455.stderr
Normal file
10
src/test/ui/const-generics/issues/issue-90455.stderr
Normal 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
|
||||
|
Loading…
Reference in New Issue
Block a user