From f4fdf814debd804c3325a6e2cb89c21bd5e9b991 Mon Sep 17 00:00:00 2001 From: Jesus Garlea Date: Fri, 30 Sep 2016 10:58:27 -0500 Subject: [PATCH] Update E0220 error format squash! Update E0220 error format Update Error E0220 to new format --- src/librustc_typeck/astconv.rs | 6 ++++-- src/test/compile-fail/E0220.rs | 5 +++-- src/test/compile-fail/unboxed-closure-sugar-wrong-trait.rs | 3 ++- src/test/ui/span/type-binding.stderr | 2 +- 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, 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; //~ 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 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) {} - | ^^^^^^^^^^^ + | ^^^^^^^^^^^ associated type `Trget` not found error: aborting due to previous error