about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJonathan Turner <jonathandturner@users.noreply.github.com>2016-08-08 13:25:58 -0700
committerGitHub <noreply@github.com>2016-08-08 13:25:58 -0700
commit0e4e8e9544c986fe0e738e381f007714bf193ba5 (patch)
tree374973fb36384cd841f3c4df2a891e8bd1d9ae61
parent3d2d5c4c0f99bf1ac9bd06d878152387195a434e (diff)
parentf07f09352222c16f11cfd49aab4f83706ea3549e (diff)
downloadrust-0e4e8e9544c986fe0e738e381f007714bf193ba5.tar.gz
rust-0e4e8e9544c986fe0e738e381f007714bf193ba5.zip
Rollup merge of #35470 - munyari:e0214, r=jonathandturner
Update E0214 to the new error format

Part of #35233

Addresses #35383
"r? @jonathandturner
-rw-r--r--src/librustc_typeck/astconv.rs7
-rw-r--r--src/test/compile-fail/E0214.rs4
2 files changed, 8 insertions, 3 deletions
diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs
index 4454285a21d..3bc9b4b69c3 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 59609345ee5..e9c3cb72c11 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
 }