E0277 wrong span in diagnostic with explicit Sized
bound
#85998
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-trait-system
Area: Trait system
A-type-system
Area: Type system
D-papercut
Diagnostics: An error or lint that needs small tweaks.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Given the following code: (playground)
The current output is:
Ideally the output should look like:
When the implicit
Sized
bound is added for generic type parameters, it goes at the front of the emitted predicate list. This means that its span, which is limited to the identifier of the generic, is what shows up in the error. It would be better if the error span pointed to the actual occurrence of the explicitSized
bound. Moving that implicit predicate to the end of the list would improve at least some of the error spans where there is an explicitSized
bound.I'm working on a pull request for this issue.
@rustbot claim
@rustbot label +A-traits +A-typesystem +D-papercut
The text was updated successfully, but these errors were encountered: