Skip to content

Commit f07f093

Browse files
committed
Update E0214 to the new error format
1 parent f5e7a59 commit f07f093

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/librustc_typeck/astconv.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,11 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
360360
self.convert_angle_bracketed_parameters(rscope, span, decl_generics, data)
361361
}
362362
hir::ParenthesizedParameters(..) => {
363-
span_err!(tcx.sess, span, E0214,
364-
"parenthesized parameters may only be used with a trait");
363+
struct_span_err!(tcx.sess, span, E0214,
364+
"parenthesized parameters may only be used with a trait")
365+
.span_label(span, &format!("only traits may use parentheses"))
366+
.emit();
367+
365368
let ty_param_defs = decl_generics.types.get_slice(TypeSpace);
366369
(Substs::empty(),
367370
ty_param_defs.iter().map(|_| tcx.types.err).collect(),

src/test/compile-fail/E0214.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,7 @@
99
// except according to those terms.
1010

1111
fn main() {
12-
let v: Vec(&str) = vec!["foo"]; //~ ERROR E0214
12+
let v: Vec(&str) = vec!["foo"];
13+
//~^ ERROR E0214
14+
//~| NOTE only traits may use parentheses
1315
}

0 commit comments

Comments
 (0)