diagnostic about typoed trait bound could be better #95208
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:
Better might be to add something like this:
This is the converse sitution to #84566.
I think that spotting the likely mistake location might involve trying to speculatively resolve path prefixes. Eg, here
T
resolves butT::fmt
doesn't.In general, syntax error messages from rustc are often poor. I wonder if it would be worth considering, as an alternative to guesswork such as the above (which has to be implmeneted separately for every kind of slip), something like:
The text was updated successfully, but these errors were encountered: