2018-08-30 14:18:55 +02:00
|
|
|
// run-pass
|
2018-09-25 23:51:35 +02:00
|
|
|
#![allow(unused_variables)]
|
2016-05-07 15:00:49 +08:00
|
|
|
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 };
|
2019-05-28 14:47:21 -04:00
|
|
|
let handle: &dyn Shape<()> = &ball;
|
2016-05-07 15:00:49 +08:00
|
|
|
}
|