summaryrefslogtreecommitdiffstats
path: root/tests/ui/suggestions/assoc_fn_without_self.rs
blob: 35c16ef3e9f7cdbf7d6b4ca02373c40c0a80bef6 (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
26
27
28
fn main() {}

struct S;

impl S {
    fn foo() {}

    fn bar(&self) {}

    fn baz(a: u8, b: u8) {}

    fn b() {
        fn c() {
            foo(); //~ ERROR cannot find function `foo` in this scope
        }
        foo(); //~ ERROR cannot find function `foo` in this scope
        bar(); //~ ERROR cannot find function `bar` in this scope
        baz(2, 3); //~ ERROR cannot find function `baz` in this scope
    }
    fn d(&self) {
        fn c() {
            foo(); //~ ERROR cannot find function `foo` in this scope
        }
        foo(); //~ ERROR cannot find function `foo` in this scope
        bar(); //~ ERROR cannot find function `bar` in this scope
        baz(2, 3); //~ ERROR cannot find function `baz` in this scope
    }
}