|
| 1 | +error[E0599]: no method named `foo` found for struct `A` in the current scope |
| 2 | + --> $DIR/suggest-assoc-fn-call-for-impl-trait.rs:21:8 |
| 3 | + | |
| 4 | +LL | struct A { |
| 5 | + | -------- method `foo` not found for this struct |
| 6 | +... |
| 7 | +LL | _a.foo(); |
| 8 | + | ---^^^-- |
| 9 | + | | | |
| 10 | + | | this is an associated function, not a method |
| 11 | + | help: use associated function syntax instead: `A::foo(_a)` |
| 12 | + | |
| 13 | + = note: found the following associated functions; to be used as methods, functions must have a `self` parameter |
| 14 | +note: the candidate is defined in the trait `M` |
| 15 | + --> $DIR/suggest-assoc-fn-call-for-impl-trait.rs:8:5 |
| 16 | + | |
| 17 | +LL | fn foo(_a: Self); |
| 18 | + | ^^^^^^^^^^^^^^^^^ |
| 19 | + |
| 20 | +error[E0599]: no method named `baz` found for struct `A` in the current scope |
| 21 | + --> $DIR/suggest-assoc-fn-call-for-impl-trait.rs:23:8 |
| 22 | + | |
| 23 | +LL | struct A { |
| 24 | + | -------- method `baz` not found for this struct |
| 25 | +... |
| 26 | +LL | _a.baz(0); |
| 27 | + | ---^^^--- |
| 28 | + | | | |
| 29 | + | | this is an associated function, not a method |
| 30 | + | help: use associated function syntax instead: `A::baz(0)` |
| 31 | + | |
| 32 | + = note: found the following associated functions; to be used as methods, functions must have a `self` parameter |
| 33 | +note: the candidate is defined in the trait `M` |
| 34 | + --> $DIR/suggest-assoc-fn-call-for-impl-trait.rs:10:5 |
| 35 | + | |
| 36 | +LL | fn baz(_a: i32); |
| 37 | + | ^^^^^^^^^^^^^^^^ |
| 38 | + |
| 39 | +error[E0599]: no method named `bar` found for struct `A` in the current scope |
| 40 | + --> $DIR/suggest-assoc-fn-call-for-impl-trait.rs:27:8 |
| 41 | + | |
| 42 | +LL | struct A { |
| 43 | + | -------- method `bar` not found for this struct |
| 44 | +... |
| 45 | +LL | _b.bar(); |
| 46 | + | ---^^^-- |
| 47 | + | | | |
| 48 | + | | this is an associated function, not a method |
| 49 | + | help: use associated function syntax instead: `A::bar(_b)` |
| 50 | + | |
| 51 | + = note: found the following associated functions; to be used as methods, functions must have a `self` parameter |
| 52 | +note: the candidate is defined in the trait `M` |
| 53 | + --> $DIR/suggest-assoc-fn-call-for-impl-trait.rs:9:5 |
| 54 | + | |
| 55 | +LL | fn bar(_a: Self); |
| 56 | + | ^^^^^^^^^^^^^^^^^ |
| 57 | + |
| 58 | +error: aborting due to 3 previous errors |
| 59 | + |
| 60 | +For more information about this error, try `rustc --explain E0599`. |
0 commit comments