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