Skip to content

Commit

Permalink
Updated E0087 to new format
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Poveda committed Aug 7, 2016
1 parent ddf92ff commit 8b111a7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/librustc_typeck/check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4367,14 +4367,17 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
if i < type_count {
substs.types.push(space, t);
} else if i == type_count {
span_err!(self.tcx.sess, typ.span, E0087,
"too many type parameters provided: \
expected at most {} parameter{}, \
found {} parameter{}",
type_count,
if type_count == 1 {""} else {"s"},
data.types.len(),
if data.types.len() == 1 {""} else {"s"});
struct_span_err!(self.tcx.sess, typ.span, E0087,
"too many type parameters provided: \
expected at most {} parameter{}, \
found {} parameter{}",
type_count,
if type_count == 1 {""} else {"s"},
data.types.len(),
if data.types.len() == 1 {""} else {"s"})
.span_label(typ.span , &format!("expected {} parameter{}",
type_count,
if type_count == 1 {""} else {"s"})).emit();
substs.types.truncate(space, 0);
break;
}
Expand Down
1 change: 1 addition & 0 deletions src/test/compile-fail/E0087.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ fn foo<T>() {}

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

0 comments on commit 8b111a7

Please sign in to comment.