]> git.proxmox.com Git - rustc.git/blob - src/test/ui/const-generics/type_of_anon_const.rs
New upstream version 1.44.1+dfsg1
[rustc.git] / src / test / ui / const-generics / type_of_anon_const.rs
1 // run-pass
2
3 #![feature(const_generics)]
4 //~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
5
6 trait T<const A: usize> {
7 fn l<const N: bool>() -> usize;
8 fn r<const N: bool>() -> bool;
9 }
10
11 struct S;
12
13 impl<const N: usize> T<N> for S {
14 fn l<const M: bool>() -> usize { N }
15 fn r<const M: bool>() -> bool { M }
16 }
17
18 fn main() {
19 assert_eq!(<S as T<123>>::l::<true>(), 123);
20 assert!(<S as T<123>>::r::<true>());
21 }