Skip to content

Commit 625a010

Browse files
author
Jonathan Turner
authored
Rollup merge of rust-lang#35470 - munyari:e0214, r=jonathandturner
Update E0214 to the new error format Part of rust-lang#35233 Addresses rust-lang#35383 "r? @jonathandturner
2 parents 3fdd637 + f07f093 commit 625a010

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/librustc_typeck/astconv.rs

Lines changed: 5 additions & 2 deletions
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

Lines changed: 3 additions & 1 deletion
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)