summary refs log tree commit diff
path: root/src/test/ui/const-generics/issues/issue-61935.rs
blob: 5c987e63a9e070c480478143c48393a317db1979 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// check-pass

#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete

trait Foo {}

impl<const N: usize> Foo for [(); N]
    where
        Self:FooImpl<{N==0}>
{}

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([()]);
}