Skip to content

Commit

Permalink
Rollup merge of rust-lang#35449 - poveda-ruiz:master, r=jonathandturner
Browse files Browse the repository at this point in the history
Updated E0087 to new format

Part of rust-lang#35233. r? @jonathandturner
  • Loading branch information
steveklabnik authored Aug 10, 2016
2 parents 7a1015e + 8b111a7 commit 41b00f1
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 @@ -4372,14 +4372,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 41b00f1

Please sign in to comment.