Updated E0087 to new format

This commit is contained in:
Christian Poveda 2016-08-07 00:29:24 -05:00
parent ddf92ffae4
commit 8b111a7cf5
2 changed files with 12 additions and 8 deletions

View file

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

View file

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