]> git.lizzy.rs Git - rust.git/blob - src/test/ui/traits/do-not-mention-type-params-by-name-in-suggestion-issue-96292.stderr
Add regression test for #82830
[rust.git] / src / test / ui / traits / do-not-mention-type-params-by-name-in-suggestion-issue-96292.stderr
1 error[E0282]: type annotations needed
2   --> $DIR/do-not-mention-type-params-by-name-in-suggestion-issue-96292.rs:17:11
3    |
4 LL |     thing.method(42);
5    |     ------^^^^^^----
6    |     |     |
7    |     |     cannot infer type for type parameter `T` declared on the trait `Method`
8    |     this method call resolves to `T`
9
10 error[E0283]: type annotations needed
11   --> $DIR/do-not-mention-type-params-by-name-in-suggestion-issue-96292.rs:17:11
12    |
13 LL |     thing.method(42);
14    |     ------^^^^^^----
15    |     |     |
16    |     |     cannot infer type for type parameter `T` declared on the trait `Method`
17    |     this method call resolves to `T`
18    |
19 note: multiple `impl`s satisfying `Thing<bool>: Method<_>` found
20   --> $DIR/do-not-mention-type-params-by-name-in-suggestion-issue-96292.rs:7:1
21    |
22 LL | impl<X> Method<i32> for Thing<X> {
23    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
24 ...
25 LL | impl<X> Method<u32> for Thing<X> {
26    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
27 help: use the fully qualified path for the potential candidates
28    |
29 LL |     <Thing<_> as Method<i32>>::method(thing, 42);
30    |     ++++++++++++++++++++++++++++++++++     ~
31 LL |     <Thing<_> as Method<u32>>::method(thing, 42);
32    |     ++++++++++++++++++++++++++++++++++     ~
33
34 error: aborting due to 2 previous errors
35
36 Some errors have detailed explanations: E0282, E0283.
37 For more information about an error, try `rustc --explain E0282`.