Rollup merge of #35449 - poveda-ruiz:master, r=jonathandturner

Updated E0087 to new format

Part of #35233. r? @jonathandturner
This commit is contained in:
Jonathan Turner 2016-08-08 13:25:56 -07:00 committed by GitHub
commit c479f0210c
2 changed files with 12 additions and 8 deletions

View File

@ -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;
}

View File

@ -12,4 +12,5 @@ fn foo<T>() {}
fn main() {
foo::<f64, bool>(); //~ ERROR E0087
//~^ NOTE expected
}