Skip to content

Commit 8b111a7

Browse files
author
Christian Poveda
committed
Updated E0087 to new format
1 parent ddf92ff commit 8b111a7

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

src/librustc_typeck/check/mod.rs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4367,14 +4367,17 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
43674367
if i < type_count {
43684368
substs.types.push(space, t);
43694369
} else if i == type_count {
4370-
span_err!(self.tcx.sess, typ.span, E0087,
4371-
"too many type parameters provided: \
4372-
expected at most {} parameter{}, \
4373-
found {} parameter{}",
4374-
type_count,
4375-
if type_count == 1 {""} else {"s"},
4376-
data.types.len(),
4377-
if data.types.len() == 1 {""} else {"s"});
4370+
struct_span_err!(self.tcx.sess, typ.span, E0087,
4371+
"too many type parameters provided: \
4372+
expected at most {} parameter{}, \
4373+
found {} parameter{}",
4374+
type_count,
4375+
if type_count == 1 {""} else {"s"},
4376+
data.types.len(),
4377+
if data.types.len() == 1 {""} else {"s"})
4378+
.span_label(typ.span , &format!("expected {} parameter{}",
4379+
type_count,
4380+
if type_count == 1 {""} else {"s"})).emit();
43784381
substs.types.truncate(space, 0);
43794382
break;
43804383
}

src/test/compile-fail/E0087.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ fn foo<T>() {}
1212

1313
fn main() {
1414
foo::<f64, bool>(); //~ ERROR E0087
15+
//~^ NOTE expected
1516
}

0 commit comments

Comments
 (0)