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