]> git.lizzy.rs Git - rust.git/blob - tests/ui/issues/issue-35976.rs
Rollup merge of #106860 - anden3:doc-double-spaces, r=Dylan-DPC
[rust.git] / tests / ui / issues / issue-35976.rs
1 // revisions: imported unimported
2 //[imported] check-pass
3
4 mod private {
5     pub trait Future {
6         //[unimported]~^^ HELP perhaps add a `use` for it
7         fn wait(&self) where Self: Sized;
8     }
9
10     impl Future for Box<dyn Future> {
11         fn wait(&self) { }
12     }
13 }
14
15 #[cfg(imported)]
16 use private::Future;
17
18 fn bar(arg: Box<dyn private::Future>) {
19     // Importing the trait means that we don't autoderef `Box<dyn Future>`
20     arg.wait();
21     //[unimported]~^ ERROR the `wait` method cannot be invoked on a trait object
22 }
23
24 fn main() {}