@@ -5,17 +5,19 @@ LL | struct A {
55 | -------- method `foo` not found for this struct
66...
77LL | _a.foo();
8- | ---^^^--
9- | | |
10- | | this is an associated function, not a method
11- | help: use associated function syntax instead: `A::foo(_a)`
8+ | ^^^ this is an associated function, not a method
129 |
1310 = note: found the following associated functions; to be used as methods, functions must have a `self` parameter
1411note: the candidate is defined in the trait `M`
1512 --> $DIR/suggest-assoc-fn-call-for-impl-trait.rs:8:5
1613 |
1714LL | fn foo(_a: Self);
1815 | ^^^^^^^^^^^^^^^^^
16+ help: use associated function syntax instead
17+ |
18+ LL - _a.foo();
19+ LL + A::foo(_a);
20+ |
1921
2022error[E0599]: no method named `baz` found for struct `A` in the current scope
2123 --> $DIR/suggest-assoc-fn-call-for-impl-trait.rs:23:8
@@ -24,17 +26,19 @@ LL | struct A {
2426 | -------- method `baz` not found for this struct
2527...
2628LL | _a.baz(0);
27- | ---^^^---
28- | | |
29- | | this is an associated function, not a method
30- | help: use associated function syntax instead: `A::baz(0)`
29+ | ^^^ this is an associated function, not a method
3130 |
3231 = note: found the following associated functions; to be used as methods, functions must have a `self` parameter
3332note: the candidate is defined in the trait `M`
3433 --> $DIR/suggest-assoc-fn-call-for-impl-trait.rs:10:5
3534 |
3635LL | fn baz(_a: i32);
3736 | ^^^^^^^^^^^^^^^^
37+ help: use associated function syntax instead
38+ |
39+ LL - _a.baz(0);
40+ LL + A::baz(0);
41+ |
3842
3943error[E0599]: no method named `bar` found for struct `A` in the current scope
4044 --> $DIR/suggest-assoc-fn-call-for-impl-trait.rs:27:8
@@ -43,17 +47,19 @@ LL | struct A {
4347 | -------- method `bar` not found for this struct
4448...
4549LL | _b.bar();
46- | ---^^^--
47- | | |
48- | | this is an associated function, not a method
49- | help: use associated function syntax instead: `A::bar(_b)`
50+ | ^^^ this is an associated function, not a method
5051 |
5152 = note: found the following associated functions; to be used as methods, functions must have a `self` parameter
5253note: the candidate is defined in the trait `M`
5354 --> $DIR/suggest-assoc-fn-call-for-impl-trait.rs:9:5
5455 |
5556LL | fn bar(_a: Self);
5657 | ^^^^^^^^^^^^^^^^^
58+ help: use associated function syntax instead
59+ |
60+ LL - _b.bar();
61+ LL + A::bar(_b);
62+ |
5763
5864error: aborting due to 3 previous errors
5965
0 commit comments