-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.Category: This is a bug.D-confusingDiagnostics: Confusing error or lint that should be reworked.Diagnostics: Confusing error or lint that should be reworked.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
I came across an interesting case today where the span for a diagnostic isn't quite leading to the best location. When compiling the example code below
struct A;
trait IntoWasmAbi {
type Abi;
fn into_abi(self) -> Self::Abi;
}
type T = <A as IntoWasmAbi>::Abi;
fn foo(a: T) {}
you get:
error[E0277]: the trait bound `A: IntoWasmAbi` is not satisfied
--> src/lib.rs:10:1
|
10 | fn foo(a: T) {}
| ^^^^^^^^^^^^^^^ the trait `IntoWasmAbi` is not implemented for `A`
but it's sort of misleading because neither A
nor IntoWasmAbi
is mentioned in the highlight. It'd be ideal if the error would point to the type
definition to indicat that's where the source of the error comes from.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.Category: This is a bug.D-confusingDiagnostics: Confusing error or lint that should be reworked.Diagnostics: Confusing error or lint that should be reworked.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.