1 #![feature(const_generics_defaults)]
3 struct Ooopsies<const N: u8 = { u8::MAX + 1 }>;
4 //~^ error: evaluation of constant value failed
6 trait Trait<const N: u8> {}
7 impl Trait<3> for () {}
8 struct WhereClause<const N: u8 = 2> where (): Trait<N>;
9 //~^ error: the trait bound `(): Trait<2_u8>` is not satisfied
11 trait Traitor<T, const N: u8> {}
12 struct WhereClauseTooGeneric<T = u32, const N: u8 = 2>(T) where (): Traitor<T, N>;
14 // no error on struct def
15 struct DependentDefaultWfness<const N: u8 = 1, T = WhereClause<N>>(T);
16 fn foo() -> DependentDefaultWfness {
17 //~^ error: the trait bound `(): Trait<1_u8>` is not satisfied