]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-33461.rs
Auto merge of #99099 - Stargateur:phantomdata_debug, r=joshtriplett
[rust.git] / src / test / 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 }