]> git.lizzy.rs Git - rust.git/blob - tests/ui/issues/issue-33461.rs
Rollup merge of #106752 - sulami:master, r=estebank
[rust.git] / tests / ui / issues / issue-33461.rs
1 // run-pass
2 #![allow(unused_variables)]
3 use std::marker::PhantomData;
4
5 struct TheType<T> {
6     t: PhantomData<T>
7 }
8
9 pub trait TheTrait {
10     type TheAssociatedType;
11 }
12
13 impl TheTrait for () {
14     type TheAssociatedType = ();
15 }
16
17 pub trait Shape<P: TheTrait> {
18     fn doit(&self) {
19     }
20 }
21
22 impl<P: TheTrait> Shape<P> for TheType<P::TheAssociatedType> {
23 }
24
25 fn main() {
26     let ball = TheType { t: PhantomData };
27     let handle: &dyn Shape<()> = &ball;
28 }