]> git.lizzy.rs Git - rust.git/blob - tests/ui/const-generics/type_of_anon_const.rs
Rollup merge of #106644 - alexcrichton:update-wasi-toolchain, r=cuviper
[rust.git] / tests / ui / const-generics / type_of_anon_const.rs
1 // run-pass
2 trait T<const A: usize> {
3     fn l<const N: bool>() -> usize;
4     fn r<const N: bool>() -> bool;
5 }
6
7 struct S;
8
9 impl<const N: usize> T<N> for S {
10     fn l<const M: bool>() -> usize { N }
11     fn r<const M: bool>() -> bool { M }
12 }
13
14 fn main() {
15    assert_eq!(<S as T<123>>::l::<true>(), 123);
16    assert!(<S as T<123>>::r::<true>());
17 }