diff --git a/src/librustc/middle/astconv_util.rs b/src/librustc/middle/astconv_util.rs index e856eb84ff2c3..911f08fc1b31f 100644 --- a/src/librustc/middle/astconv_util.rs +++ b/src/librustc/middle/astconv_util.rs @@ -42,8 +42,9 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { pub fn prohibit_projection(self, span: Span) { - span_err!(self.sess, span, E0229, - "associated type bindings are not allowed here"); + let mut err = struct_span_err!(self.sess, span, E0229, + "associated type bindings are not allowed here"); + err.span_label(span, &format!("associate type not allowed here")).emit(); } pub fn prim_ty_to_ty(self, diff --git a/src/test/compile-fail/E0229.rs b/src/test/compile-fail/E0229.rs index 45d5c59592f75..6ff0baeeb4d4b 100644 --- a/src/test/compile-fail/E0229.rs +++ b/src/test/compile-fail/E0229.rs @@ -20,7 +20,9 @@ impl Foo for isize { fn boo(&self) -> usize { 42 } } -fn baz(x: &>::A) {} //~ ERROR E0229 +fn baz(x: &>::A) {} +//~^ ERROR associated type bindings are not allowed here [E0229] +//~| NOTE associate type not allowed here fn main() { } diff --git a/src/test/compile-fail/issue-23543.rs b/src/test/compile-fail/issue-23543.rs index 4ed44154c4748..f1c559b6b889f 100644 --- a/src/test/compile-fail/issue-23543.rs +++ b/src/test/compile-fail/issue-23543.rs @@ -16,6 +16,7 @@ pub trait D { fn f(self) where T: A; //~^ ERROR associated type bindings are not allowed here [E0229] + //~| NOTE associate type not allowed here } fn main() {} diff --git a/src/test/compile-fail/issue-23544.rs b/src/test/compile-fail/issue-23544.rs index 1d7c2187045ea..3959c22d1d489 100644 --- a/src/test/compile-fail/issue-23544.rs +++ b/src/test/compile-fail/issue-23544.rs @@ -14,6 +14,7 @@ pub trait D { fn f(self) where T: A; //~^ ERROR associated type bindings are not allowed here [E0229] + //~| NOTE associate type not allowed here } fn main() {}