2021-10-20 17:31:08 -05:00
|
|
|
struct Ooopsies<const N: u8 = { u8::MAX + 1 }>;
|
|
|
|
//~^ error: evaluation of constant value failed
|
|
|
|
|
|
|
|
trait Trait<const N: u8> {}
|
|
|
|
impl Trait<3> for () {}
|
2022-07-18 18:25:14 -05:00
|
|
|
struct WhereClause<const N: u8 = 2>
|
|
|
|
where
|
|
|
|
(): Trait<N>;
|
|
|
|
//~^ error: the trait bound `(): Trait<2>` is not satisfied
|
2021-10-20 17:31:08 -05:00
|
|
|
|
|
|
|
trait Traitor<T, const N: u8> {}
|
2022-07-18 18:25:14 -05:00
|
|
|
struct WhereClauseTooGeneric<T = u32, const N: u8 = 2>(T)
|
|
|
|
where
|
|
|
|
(): Traitor<T, N>;
|
2021-10-20 17:31:08 -05:00
|
|
|
|
2021-10-20 18:16:49 -05:00
|
|
|
// no error on struct def
|
2021-10-20 17:31:08 -05:00
|
|
|
struct DependentDefaultWfness<const N: u8 = 1, T = WhereClause<N>>(T);
|
|
|
|
fn foo() -> DependentDefaultWfness {
|
2022-07-18 18:25:14 -05:00
|
|
|
//~^ error: the trait bound `(): Trait<1>` is not satisfied
|
2021-10-20 17:31:08 -05:00
|
|
|
loop {}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|