]> git.proxmox.com Git - rustc.git/blame - src/test/ui/const-generics/issues/issue-73899.rs
New upstream version 1.55.0+dfsg1
[rustc.git] / src / test / ui / const-generics / issues / issue-73899.rs
CommitLineData
fc512014
XL
1// run-pass
2#![feature(const_evaluatable_checked)]
3#![feature(const_generics)]
4#![allow(incomplete_features)]
5
6trait Foo {}
7
8impl<const N: usize> Foo for [(); N] where Self: FooImpl<{ N == 0 }> {}
9
10trait FooImpl<const IS_ZERO: bool> {}
11
12impl FooImpl<{ 0u8 == 0u8 }> for [(); 0] {}
13
14impl<const N: usize> FooImpl<{ 0u8 != 0u8 }> for [(); N] {}
15
16fn foo<T: Foo>(_v: T) {}
17
18fn main() {
19 foo([]);
20 foo([()]);
21}