Closed
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.