Skip to content

Commit

Permalink
Rollup merge of rust-lang#35470 - munyari:e0214, r=jonathandturner
Browse files Browse the repository at this point in the history
Update E0214 to the new error format

Part of rust-lang#35233

Addresses rust-lang#35383
"r? @jonathandturner
  • Loading branch information
Jonathan Turner authored Aug 7, 2016
2 parents 3fdd637 + f07f093 commit 625a010
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/librustc_typeck/astconv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
4 changes: 3 additions & 1 deletion src/test/compile-fail/E0214.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 625a010

Please sign in to comment.