about summary refs log tree commit diff
path: root/tests/ui/const-generics/associated-type-bound.rs
blob: 7ab9e8c3465785f17423e1551152263829146aa1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//@ check-pass
trait Bar<const N: usize> {}

trait Foo<const N: usize> {
    type Assoc: Bar<N>;
}

impl<const N: usize> Bar<N> for u8 {}
impl Bar<3> for u16 {}

impl<const N: usize> Foo<N> for i8 {
    type Assoc = u8;
}

impl Foo<3> for i16 {
    type Assoc = u16;
}

fn main() {}