Remove duplicated "parameter" in E0089 text

Closes #39732
This commit is contained in:
Jake Goulding 2017-02-10 21:09:54 -05:00
parent 717ac960b5
commit 79d32e9948
2 changed files with 4 additions and 8 deletions

View File

@ -4566,14 +4566,11 @@ fn check_path_parameter_count(&self,
} else if !infer_types && types.len() < required_len {
let adjust = |len| if len > 1 { "parameters" } else { "parameter" };
let required_param_str = adjust(required_len);
let actual_param_str = adjust(types.len());
struct_span_err!(self.tcx.sess, span, E0089,
"too few type parameters provided: \
expected {} {}, found {} {}",
expected {}, found {}",
count(required_len),
required_param_str,
count(types.len()),
actual_param_str)
count(types.len()))
.span_label(span, &format!("expected {} type {}", required_len, required_param_str))
.emit();
}

View File

@ -11,7 +11,6 @@
fn foo<T, U>() {}
fn main() {
foo::<f64>();
//~^ ERROR E0089
//~| NOTE expected 2 type parameters
foo::<f64>(); //~ ERROR expected 2 parameters, found 1 parameter [E0089]
//~| NOTE expected 2 type parameters
}