]> git.lizzy.rs Git - rust.git/blob - src/test/ui/self/suggest-self-2.rs
Unify output of "variant not found" errors
[rust.git] / src / test / ui / self / suggest-self-2.rs
1 struct Foo {}
2
3 impl Foo {
4     fn foo(&self) {
5         bar(self);
6         //~^ ERROR cannot find function `bar` in this scope
7         //~| HELP try calling `bar` as a method
8
9         bar(&&self, 102);
10         //~^ ERROR cannot find function `bar` in this scope
11         //~| HELP try calling `bar` as a method
12
13         bar(&mut self, 102, &"str");
14         //~^ ERROR cannot find function `bar` in this scope
15         //~| HELP try calling `bar` as a method
16
17         bar();
18         //~^ ERROR cannot find function `bar` in this scope
19
20         self.bar();
21         //~^ ERROR no method named `bar` found for reference
22     }
23 }
24
25 fn main() {}