]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/type_of_anon_const.rs
Auto merge of #79342 - CDirkx:ipaddr-const, r=oli-obk
[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 #![cfg_attr(min, feature(min_const_generics))]
7
8 trait T<const A: usize> {
9     fn l<const N: bool>() -> usize;
10     fn r<const N: bool>() -> bool;
11 }
12
13 struct S;
14
15 impl<const N: usize> T<N> for S {
16     fn l<const M: bool>() -> usize { N }
17     fn r<const M: bool>() -> bool { M }
18 }
19
20 fn main() {
21    assert_eq!(<S as T<123>>::l::<true>(), 123);
22    assert!(<S as T<123>>::r::<true>());
23 }