From eb469d60b6bba039b94d55ddf3b44e7f81bf3bda Mon Sep 17 00:00:00 2001 From: Federico Ravasio Date: Sat, 6 Aug 2016 15:29:12 +0200 Subject: [PATCH] Updated E0225 to new format. --- src/librustc_typeck/astconv.rs | 7 +++++-- src/test/compile-fail/E0225.rs | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs index a11df5ae05d6f..749dcc4e1c614 100644 --- a/src/librustc_typeck/astconv.rs +++ b/src/librustc_typeck/astconv.rs @@ -2091,8 +2091,11 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o { if !trait_bounds.is_empty() { let b = &trait_bounds[0]; - span_err!(self.tcx().sess, b.trait_ref.path.span, E0225, - "only the builtin traits can be used as closure or object bounds"); + let span = b.trait_ref.path.span; + struct_span_err!(self.tcx().sess, span, E0225, + "only the builtin traits can be used as closure or object bounds") + .span_label(span, &format!("non-builtin trait used as bounds")) + .emit(); } let region_bound = diff --git a/src/test/compile-fail/E0225.rs b/src/test/compile-fail/E0225.rs index 190350c5a5571..b013788ceff85 100644 --- a/src/test/compile-fail/E0225.rs +++ b/src/test/compile-fail/E0225.rs @@ -9,5 +9,7 @@ // except according to those terms. fn main() { - let _: Box; //~ ERROR E0225 + let _: Box; + //~^ ERROR only the builtin traits can be used as closure or object bounds [E0225] + //~| NOTE non-builtin trait used as bounds }