Incorrect disambiguation suggestion for associated function, when fully-qualified syntax is required #88806
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Given the following code:
The current output is:
The disambiguation suggestion
Runner::speed()
does not work; it leads to a "cannot infer type" error (E0283). In this case, the suggestion should use the fully qualified syntax, specifying both the type and the trait, e.g.<Jake as Runner>::speed()
.For comparison, here's a case where the suggestion to qualify by only the trait name does work:
In this case, rustc suggests
F::m(&x)
, which is accepted as unambiguous (thanks to the&x
passed in as&self
, iiuc).The text was updated successfully, but these errors were encountered: