about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/librustc_typeck/astconv.rs6
-rw-r--r--src/test/compile-fail/E0220.rs5
-rw-r--r--src/test/compile-fail/unboxed-closure-sugar-wrong-trait.rs3
-rw-r--r--src/test/ui/span/type-binding.stderr2
4 files changed, 10 insertions, 6 deletions
diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs
index 2f6fe8d77d2..568e44a9519 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<ty::PolyTraitRef<'tcx>, 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 17e2b18b374..c5a1824514d 100644
--- a/src/test/compile-fail/E0220.rs
+++ b/src/test/compile-fail/E0220.rs
@@ -13,7 +13,8 @@ trait Trait {
 }
 
 type Foo = Trait<F=i32>; //~ 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 12097576102..50f4f3b98b3 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<F:Trait(isize) -> 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 3cd1791a34f..dc37acaf3f9 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: Deref<Trget = i32>>(_: T) {}
-   |                    ^^^^^^^^^^^
+   |                    ^^^^^^^^^^^ associated type `Trget` not found
 
 error: aborting due to previous error