summaryrefslogtreecommitdiffstats
path: root/src/test/ui/issues/issue-33461.rs
blob: 4e01d4d3061f93409c5d0df304965424120cd703 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// run-pass
#![allow(unused_variables)]
use std::marker::PhantomData;

struct TheType<T> {
    t: PhantomData<T>
}

pub trait TheTrait {
    type TheAssociatedType;
}

impl TheTrait for () {
    type TheAssociatedType = ();
}

pub trait Shape<P: TheTrait> {
    fn doit(&self) {
    }
}

impl<P: TheTrait> Shape<P> for TheType<P::TheAssociatedType> {
}

fn main() {
    let ball = TheType { t: PhantomData };
    let handle: &dyn Shape<()> = &ball;
}