summaryrefslogtreecommitdiffstats
path: root/tests/ui/suggestions/suggest-assoc-fn-call-without-receiver.rs
blob: 07e614f0c15e5ee6d64688638db98caac0a38a9d (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
29
30
// run-rustfix

struct A {}

impl A {
    fn hello(_a: i32) {}
    fn test(_a: Self, _b: i32) {}
}

struct B<T> {
    _b: T
}
impl<T> B<T> {
    fn hello(_a: i32) {}
    fn test(_a: Self, _b: i32) {}
}

fn main() {
    let _a = A {};
    _a.hello(1);
    //~^ ERROR no method named `hello` found
    _a.test(1);
    //~^ ERROR no method named `test` found

    let _b = B {_b: ""};
    _b.hello(1);
    //~^ ERROR no method named `hello` found
    _b.test(1);
    //~^ ERROR no method named `test` found
}