]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/type_of_anon_const.rs
Rollup merge of #75201 - Hirrolot:hirrolot/fix-clippy-warnings, r=varkor
[rust.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
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 }