From 40b7ace386144d584faa9d7eca27ffdc35ceb6b8 Mon Sep 17 00:00:00 2001 From: Matthias Rabault Date: Fri, 5 Aug 2016 17:43:44 +0200 Subject: [PATCH 1/2] Update E0229 to new format --- src/librustc/middle/astconv_util.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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, From 51a270f5e7a1911118bb177b6d53dbba621748b8 Mon Sep 17 00:00:00 2001 From: Matthias Rabault Date: Fri, 5 Aug 2016 20:11:26 +0200 Subject: [PATCH 2/2] Fix E0229 unit tests --- src/test/compile-fail/E0229.rs | 4 +++- src/test/compile-fail/issue-23543.rs | 1 + src/test/compile-fail/issue-23544.rs | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) 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() {}