From f07f09352222c16f11cfd49aab4f83706ea3549e Mon Sep 17 00:00:00 2001 From: "Panashe M. Fundira" Date: Sun, 7 Aug 2016 13:21:23 -0400 Subject: [PATCH] Update E0214 to the new error format --- src/librustc_typeck/astconv.rs | 7 +++++-- src/test/compile-fail/E0214.rs | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs index 50ffa52e88ba4..3fcd53954137d 100644 --- a/src/librustc_typeck/astconv.rs +++ b/src/librustc_typeck/astconv.rs @@ -360,8 +360,11 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o { self.convert_angle_bracketed_parameters(rscope, span, decl_generics, data) } hir::ParenthesizedParameters(..) => { - span_err!(tcx.sess, span, E0214, - "parenthesized parameters may only be used with a trait"); + struct_span_err!(tcx.sess, span, E0214, + "parenthesized parameters may only be used with a trait") + .span_label(span, &format!("only traits may use parentheses")) + .emit(); + let ty_param_defs = decl_generics.types.get_slice(TypeSpace); (Substs::empty(), ty_param_defs.iter().map(|_| tcx.types.err).collect(), diff --git a/src/test/compile-fail/E0214.rs b/src/test/compile-fail/E0214.rs index 59609345ee523..e9c3cb72c11b0 100644 --- a/src/test/compile-fail/E0214.rs +++ b/src/test/compile-fail/E0214.rs @@ -9,5 +9,7 @@ // except according to those terms. fn main() { - let v: Vec(&str) = vec!["foo"]; //~ ERROR E0214 + let v: Vec(&str) = vec!["foo"]; + //~^ ERROR E0214 + //~| NOTE only traits may use parentheses }