]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/dont-wrap-ambiguous-receivers.rs
Rollup merge of #107595 - michaelwoerister:retry_proc_macro_loading, r=petrochenkov
[rust.git] / tests / ui / suggestions / dont-wrap-ambiguous-receivers.rs
1 mod banana {
2     //~^ HELP the following traits are implemented but not in scope
3     pub struct Chaenomeles;
4
5     pub trait Apple {
6         fn pick(&self) {}
7     }
8     impl Apple for Chaenomeles {}
9
10     pub trait Peach {
11         fn pick(&self, a: &mut ()) {}
12     }
13     impl<Mango: Peach> Peach for Box<Mango> {}
14     impl Peach for Chaenomeles {}
15 }
16
17 fn main() {
18     banana::Chaenomeles.pick()
19     //~^ ERROR no method named
20     //~| HELP items from traits can only be used if the trait is in scope
21 }