From 77a282455e35d7349ed26f488d516d3d53fc14e3 Mon Sep 17 00:00:00 2001 From: crypto-universe Date: Mon, 8 Aug 2016 00:45:33 +0200 Subject: [PATCH] New format for E0221 Issue #35386 --- src/librustc_typeck/astconv.rs | 1 + src/test/compile-fail/E0221.rs | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs index b4e9fb5c65bb3..edf5fef2531da 100644 --- a/src/librustc_typeck/astconv.rs +++ b/src/librustc_typeck/astconv.rs @@ -1285,6 +1285,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o { "ambiguous associated type `{}` in bounds of `{}`", assoc_name, ty_param_name); + err.span_label(span, &format!("ambiguous associated type `{}`", assoc_name)); for bound in &bounds { span_note!(&mut err, span, diff --git a/src/test/compile-fail/E0221.rs b/src/test/compile-fail/E0221.rs index 213ec5a048880..651054580408d 100644 --- a/src/test/compile-fail/E0221.rs +++ b/src/test/compile-fail/E0221.rs @@ -18,7 +18,11 @@ trait Foo { trait Bar : Foo { type A: T2; fn do_something() { - let _: Self::A; //~ ERROR E0221 + let _: Self::A; + //~^ ERROR E0221 + //~| NOTE ambiguous associated type `A` + //~| NOTE associated type `Self` could derive from `Foo` + //~| NOTE associated type `Self` could derive from `Bar` } }