1 // check-pass 2 #![feature(generic_const_exprs)] 3 #![allow(incomplete_features)] 4 5 trait If<const COND: bool> {} 6 impl If<true> for () {} 7 8 trait IsZero<const N: u8> { 9 type Answer; 10 } 11 12 struct True; 13 struct False; 14 15 impl<const N: u8> IsZero<N> for () 16 where (): If<{N == 0}> { 17 type Answer = True; 18 } 19 20 trait Foobar<const N: u8> {} 21 22 impl<const N: u8> Foobar<N> for () 23 where (): IsZero<N, Answer = True> {} 24 25 impl<const N: u8> Foobar<N> for () 26 where (): IsZero<N, Answer = False> {} 27 main()28fn main() {} 29