]> git.lizzy.rs Git - rust.git/blob - tests/ui/const-generics/generic_const_exprs/abstract-const-as-cast-2.rs
Merge commit '7f27e2e74ef957baa382dc05cf08df6368165c74' into clippyup
[rust.git] / tests / ui / const-generics / generic_const_exprs / abstract-const-as-cast-2.rs
1 #![feature(generic_const_exprs)]
2 #![allow(incomplete_features)]
3
4 struct Evaluatable<const N: u128> {}
5
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]:`
9 where
10     Evaluatable<{N as u128}>:;
11
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}]:`
15
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]:`
19
20 fn main() {}