]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/associated-type-bound.rs
Auto merge of #79342 - CDirkx:ipaddr-const, r=oli-obk
[rust.git] / src / test / ui / const-generics / associated-type-bound.rs
1 // run-pass
2 // revisions: full min
3 #![cfg_attr(full, allow(incomplete_features))]
4 #![cfg_attr(full, feature(const_generics))]
5 #![cfg_attr(min, feature(min_const_generics))]
6
7 trait Bar<const N: usize> {}
8
9 trait Foo<const N: usize> {
10     type Assoc: Bar<N>;
11 }
12
13 impl<const N: usize> Bar<N> for u8 {}
14 impl Bar<3> for u16 {}
15
16 impl<const N: usize> Foo<N> for i8 {
17     type Assoc = u8;
18 }
19
20 impl Foo<3> for i16 {
21     type Assoc = u16;
22 }
23
24 fn main() {}