]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/generic_const_exprs/issue-73899.rs
Move generic error message to separate branches
[rust.git] / src / test / ui / const-generics / generic_const_exprs / issue-73899.rs
1 // run-pass
2 #![feature(generic_const_exprs)]
3 #![allow(incomplete_features)]
4
5 trait Foo {}
6
7 impl<const N: usize> Foo for [(); N] where Self: FooImpl<{ N == 0 }> {}
8
9 trait FooImpl<const IS_ZERO: bool> {}
10
11 impl FooImpl<{ 0u8 == 0u8 }> for [(); 0] {}
12
13 impl<const N: usize> FooImpl<{ 0u8 != 0u8 }> for [(); N] {}
14
15 fn foo<T: Foo>(_v: T) {}
16
17 fn main() {
18     foo([]);
19     foo([()]);
20 }