2017-08-01 14:38:52 -05:00
|
|
|
mod private {
|
|
|
|
pub trait Future {
|
|
|
|
fn wait(&self) where Self: Sized;
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Future for Box<Future> {
|
|
|
|
fn wait(&self) { }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//use private::Future;
|
|
|
|
|
|
|
|
fn bar(arg: Box<private::Future>) {
|
|
|
|
arg.wait();
|
2017-08-03 06:50:06 -05:00
|
|
|
//~^ ERROR the `wait` method cannot be invoked on a trait object
|
2017-08-01 14:38:52 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
|
|
|
|
}
|