2020-11-22 07:53:31 -06:00
|
|
|
// run-pass
|
2021-08-25 04:21:39 -05:00
|
|
|
#![feature(generic_const_exprs)]
|
2020-11-22 07:53:31 -06:00
|
|
|
#![allow(incomplete_features)]
|
|
|
|
|
|
|
|
trait Foo {}
|
|
|
|
|
|
|
|
impl<const N: usize> Foo for [(); N] where Self: FooImpl<{ N == 0 }> {}
|
|
|
|
|
|
|
|
trait FooImpl<const IS_ZERO: bool> {}
|
|
|
|
|
|
|
|
impl FooImpl<{ 0u8 == 0u8 }> for [(); 0] {}
|
|
|
|
|
|
|
|
impl<const N: usize> FooImpl<{ 0u8 != 0u8 }> for [(); N] {}
|
|
|
|
|
|
|
|
fn foo<T: Foo>(_v: T) {}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
foo([]);
|
|
|
|
foo([()]);
|
|
|
|
}
|