]>
Commit | Line | Data |
---|---|---|
f9f354fc XL |
1 | // run-pass |
2 | #![feature(const_generics)] | |
3 | #![allow(incomplete_features)] | |
4 | trait Foo {} | |
5 | ||
6 | impl<const N: usize> Foo for [(); N] where Self: FooImpl<{ N == 0 }> {} | |
7 | ||
8 | trait FooImpl<const IS_ZERO: bool> {} | |
9 | ||
10 | impl FooImpl<{ 0u8 == 0u8 }> for [(); 0] {} | |
11 | ||
12 | impl<const N: usize> FooImpl<{ 0u8 != 0u8 }> for [(); N] {} | |
13 | ||
14 | fn foo<T: Foo>(_: T) {} | |
15 | ||
16 | fn main() { | |
17 | foo([]); | |
18 | foo([()]); | |
19 | } |