summary refs log tree commit diff
path: root/src/test/ui/const-generics/lazy-normalization/issue-71922.rs
blob: 36513f94a9e97562431adca9dc10b06c0fa67139 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// run-pass
#![feature(const_generics)]
#![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>(_: T) {}

fn main() {
    foo([]);
    foo([()]);
}