1 #![feature(generic_const_exprs)]
2 #![allow(incomplete_features)]
4 struct Evaluatable<const N: u128> {}
6 struct Foo<const N: u8>([u8; N as usize])
7 //~^ Error: unconstrained generic constant
8 //~| help: try adding a `where` bound using this expression: `where [(); N as usize]:`
10 Evaluatable<{N as u128}>:;
12 struct Foo2<const N: u8>(Evaluatable::<{N as u128}>) where Evaluatable<{N as usize as u128 }>:;
13 //~^ Error: unconstrained generic constant
14 //~| help: try adding a `where` bound using this expression: `where [(); {N as u128}]:`
16 struct Bar<const N: u8>([u8; (N + 2) as usize]) where [(); (N + 1) as usize]:;
17 //~^ Error: unconstrained generic constant
18 //~| help: try adding a `where` bound using this expression: `where [(); (N + 2) as usize]:`