]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/type_of_anon_const.rs
Rollup merge of #87742 - npmccallum:naked_ffi, r=Amanieu
[rust.git] / src / test / ui / const-generics / type_of_anon_const.rs
1 // run-pass
2 // revisions: full min
3
4 #![cfg_attr(full, feature(const_generics))]
5 #![cfg_attr(full, allow(incomplete_features))]
6
7 trait T<const A: usize> {
8     fn l<const N: bool>() -> usize;
9     fn r<const N: bool>() -> bool;
10 }
11
12 struct S;
13
14 impl<const N: usize> T<N> for S {
15     fn l<const M: bool>() -> usize { N }
16     fn r<const M: bool>() -> bool { M }
17 }
18
19 fn main() {
20    assert_eq!(<S as T<123>>::l::<true>(), 123);
21    assert!(<S as T<123>>::r::<true>());
22 }