summaryrefslogtreecommitdiffstats
path: root/tests/ui/const-generics/associated-type-bound.rs
blob: 3044736b47e05515122be179890921544e2e4eb8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// run-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() {}