blob: 0d42ff1895cdb109f47329284c4870fe8455e904 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete
trait Foo {}
impl<const N: usize> Foo for [(); N]
where
Self:FooImpl<{N==0}>
//~^ERROR constant expression depends on a generic parameter
{}
trait FooImpl<const IS_ZERO: bool>{}
impl FooImpl<true> for [(); 0] {}
impl<const N:usize> FooImpl<false> for [();N] {}
fn foo(_: impl Foo) {}
fn main() {
foo([]);
foo([()]);
}
|