diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs index f5e289c33028e..e28a4566e0ea6 100644 --- a/src/librustc_typeck/astconv.rs +++ b/src/librustc_typeck/astconv.rs @@ -1241,10 +1241,12 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o { -> Result, ErrorReported> { if bounds.is_empty() { - span_err!(self.tcx().sess, span, E0220, + struct_span_err!(self.tcx().sess, span, E0220, "associated type `{}` not found for `{}`", assoc_name, - ty_param_name); + ty_param_name) + .span_label(span, &format!("associated type `{}` not found", assoc_name)) + .emit(); return Err(ErrorReported); } diff --git a/src/test/compile-fail/E0220.rs b/src/test/compile-fail/E0220.rs index 17e2b18b3745e..c5a1824514d74 100644 --- a/src/test/compile-fail/E0220.rs +++ b/src/test/compile-fail/E0220.rs @@ -13,7 +13,8 @@ trait Trait { } type Foo = Trait; //~ ERROR E0220 - //~^ ERROR E0191 - + //~| NOTE associated type `F` not found + //~| ERROR E0191 + //~| NOTE missing associated type `Bar` value fn main() { } diff --git a/src/test/compile-fail/unboxed-closure-sugar-wrong-trait.rs b/src/test/compile-fail/unboxed-closure-sugar-wrong-trait.rs index 1209757610251..50f4f3b98b337 100644 --- a/src/test/compile-fail/unboxed-closure-sugar-wrong-trait.rs +++ b/src/test/compile-fail/unboxed-closure-sugar-wrong-trait.rs @@ -15,6 +15,7 @@ trait Trait {} fn f isize>(x: F) {} //~^ ERROR E0244 //~| NOTE expected no type arguments, found 1 -//~| ERROR associated type `Output` not found +//~| ERROR E0220 +//~| NOTE associated type `Output` not found fn main() {} diff --git a/src/test/ui/span/type-binding.stderr b/src/test/ui/span/type-binding.stderr index 3cd1791a34ff7..dc37acaf3f98e 100644 --- a/src/test/ui/span/type-binding.stderr +++ b/src/test/ui/span/type-binding.stderr @@ -2,7 +2,7 @@ error[E0220]: associated type `Trget` not found for `std::ops::Deref` --> $DIR/type-binding.rs:16:20 | 16 | fn homura>(_: T) {} - | ^^^^^^^^^^^ + | ^^^^^^^^^^^ associated type `Trget` not found error: aborting due to previous error