about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJesus Garlea <chamoysvoice@gmail.com>2016-09-30 10:58:27 -0500
committerJesus Garlea <chamoysvoice@gmail.com>2016-09-30 15:15:16 -0500
commitf4fdf814debd804c3325a6e2cb89c21bd5e9b991 (patch)
tree6f55447bce13d0318ef62018a514b4e9711605fd
parent1d64acdceb6f0eebbc5e8774972b86e4cf192a0f (diff)
downloadrust-f4fdf814debd804c3325a6e2cb89c21bd5e9b991.tar.gz
rust-f4fdf814debd804c3325a6e2cb89c21bd5e9b991.zip
Update E0220 error format
squash! Update E0220 error format

Update Error E0220 to new format
-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 f5e289c3302..e28a4566e0e 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