Errors with incorrectly typed parameters to trait functions incorrectly point to function #46658
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
WG-diagnostics
Working group: Diagnostics
When a parameter of an unexpected type is passed to a trait function, the resulting error message points to the function and not the parameter. Since the function is defined elsewhere (perhaps in another crate altogether), clearly the error is with the parameter and the error message should be altered to reflect that by pointing to the parameter.
Example:
generates the following error:
The text of the error message is correct (it is describing the problem with the parameter) but the arrows point to the impl fn and not the parameter.
The text was updated successfully, but these errors were encountered: