Improve error output for "expected value, found type parameter" #124634
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
D-terse
Diagnostics: An error or lint that doesn't give enough information about the problem at hand.
E-help-wanted
Call for participation: Help is requested to fix this issue.
E-needs-mcve
Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Code
Current output
Desired output
Rationale and extra context
In some cases rustc correctly suggests that the turbofish syntax is required.
Here, however, it looks like user intent is ambiguous and the compiler expects a comparison operator (which expects a value on the right of the < operator) but the error help doesn't offer the "correct" suggestion. So it may be helpful to offer an aldditional suggestion whenever the output is "expected value, found type parameter": use turbofish syntax.
I suspect this shouldn't require gathering or printing any more information than the compiler already has at-hand in this context -- a static, alternative, suggestion is likely all that'd be needed.
Other cases
No response
Rust Version
Anything else?
Might be as easy to close this issue as looking for that string in the rustc source and modifying an existing output string.
The text was updated successfully, but these errors were encountered: