summaryrefslogtreecommitdiffstats
path: root/src/test/ui/self/suggest-self-2.rs
blob: 1e001827e475feda512e1bdc6607132519610389 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
struct Foo {}

impl Foo {
    fn foo(&self) {
        bar(self);
        //~^ ERROR cannot find function `bar` in this scope
        //~| HELP try calling `bar` as a method

        bar(&&self, 102);
        //~^ ERROR cannot find function `bar` in this scope
        //~| HELP try calling `bar` as a method

        bar(&mut self, 102, &"str");
        //~^ ERROR cannot find function `bar` in this scope
        //~| HELP try calling `bar` as a method

        bar();
        //~^ ERROR cannot find function `bar` in this scope

        self.bar();
        //~^ ERROR no method named `bar` found for reference
    }
}

fn main() {}