|
| 1 | +error[E0599]: no method named `new` found for struct `A` in the current scope |
| 2 | + --> $DIR/disambiguate-associated-function-first-arg.rs:5:8 |
| 3 | + | |
| 4 | +LL | struct A {} |
| 5 | + | -------- method `new` not found for this struct |
| 6 | +... |
| 7 | +LL | _a.new(1); |
| 8 | + | ^^^ this is an associated function, not a method |
| 9 | + | |
| 10 | + = note: found the following associated functions; to be used as methods, functions must have a `self` parameter |
| 11 | +note: candidate #1 is defined in the trait `M` |
| 12 | + --> $DIR/disambiguate-associated-function-first-arg.rs:10:5 |
| 13 | + | |
| 14 | +LL | fn new(_a: i32); |
| 15 | + | ^^^^^^^^^^^^^^^^ |
| 16 | +note: candidate #2 is defined in the trait `N` |
| 17 | + --> $DIR/disambiguate-associated-function-first-arg.rs:17:5 |
| 18 | + | |
| 19 | +LL | fn new(_a: Self, _b: i32); |
| 20 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 21 | +note: candidate #3 is defined in the trait `O` |
| 22 | + --> $DIR/disambiguate-associated-function-first-arg.rs:24:5 |
| 23 | + | |
| 24 | +LL | fn new(_a: Self, _b: i32); |
| 25 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 26 | +help: disambiguate the associated function for candidate #1 |
| 27 | + | |
| 28 | +LL | <A as M>::new(1); |
| 29 | + | ~~~~~~~~~~~~~~~~ |
| 30 | +help: disambiguate the associated function for candidate #2 |
| 31 | + | |
| 32 | +LL | <A as N>::new(_a, 1); |
| 33 | + | ~~~~~~~~~~~~~~~~~~~~ |
| 34 | +help: disambiguate the associated function for candidate #3 |
| 35 | + | |
| 36 | +LL | <A as O>::new(_a, 1); |
| 37 | + | ~~~~~~~~~~~~~~~~~~~~ |
| 38 | + |
| 39 | +error: aborting due to 1 previous error |
| 40 | + |
| 41 | +For more information about this error, try `rustc --explain E0599`. |
0 commit comments