]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-73899.rs
Rollup merge of #79293 - Havvy:test-eval-order-compound-assign, r=Mark-Simulacrum
[rust.git] / src / test / ui / issues / issue-73899.rs
1 // run-pass
2 #![feature(const_evaluatable_checked)]
3 #![feature(const_generics)]
4 #![allow(incomplete_features)]
5
6 trait Foo {}
7
8 impl<const N: usize> Foo for [(); N] where Self: FooImpl<{ N == 0 }> {}
9
10 trait FooImpl<const IS_ZERO: bool> {}
11
12 impl FooImpl<{ 0u8 == 0u8 }> for [(); 0] {}
13
14 impl<const N: usize> FooImpl<{ 0u8 != 0u8 }> for [(); N] {}
15
16 fn foo<T: Foo>(_v: T) {}
17
18 fn main() {
19     foo([]);
20     foo([()]);
21 }