]> git.lizzy.rs Git - rust.git/commitdiff
Update E0220 error format
authorJesus Garlea <chamoysvoice@gmail.com>
Fri, 30 Sep 2016 15:58:27 +0000 (10:58 -0500)
committerJesus Garlea <chamoysvoice@gmail.com>
Fri, 30 Sep 2016 20:15:16 +0000 (15:15 -0500)
squash! Update E0220 error format

Update Error E0220 to new format

src/librustc_typeck/astconv.rs
src/test/compile-fail/E0220.rs
src/test/compile-fail/unboxed-closure-sugar-wrong-trait.rs
src/test/ui/span/type-binding.stderr

index f5e289c33028e3010044b751c8ee4499cf5a9a3e..e28a4566e0ea6d01e9f503c0492bf0ffc6511889 100644 (file)
@@ -1241,10 +1241,12 @@ fn one_bound_for_assoc_type(&self,
         -> 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);
         }
 
index 17e2b18b3745e55a14a3e2ef99193d4a842503e5..c5a1824514d74ad6b7790d690bc5eb168062c3dc 100644 (file)
@@ -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() {
 }
index 1209757610251cd8477b890325a24bdaf7727b2a..50f4f3b98b337173f42103b3a049e7c6e34dd6f0 100644 (file)
@@ -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() {}
index 3cd1791a34ff7233cf05d598bfede1f5d3b29d6d..dc37acaf3f98eb3a5b320bebfb3c4d65bc40dc13 100644 (file)
@@ -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