Skip to content

Commit f6cc95a

Browse files
committed
Update E0057 error message to new format
1 parent 17a2be8 commit f6cc95a

File tree

5 files changed

+10
-13
lines changed

5 files changed

+10
-13
lines changed

src/librustc_typeck/check/mod.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -2486,12 +2486,10 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
24862486
arg_count,
24872487
if arg_count == 1 {" was"} else {"s were"}),
24882488
error_code);
2489-
24902489
err.span_label(sp, &format!("expected {}{} parameter{}",
2491-
if variadic {"at least "} else {""},
2492-
expected_count,
2493-
if expected_count == 1 {""} else {"s"}));
2494-
2490+
if variadic {"at least "} else {""},
2491+
expected_count,
2492+
if expected_count == 1 {""} else {"s"}));
24952493
let input_types = fn_inputs.iter().map(|i| format!("{:?}", i)).collect::<Vec<String>>();
24962494
if input_types.len() > 0 {
24972495
err.note(&format!("the following parameter type{} expected: {}",

src/test/compile-fail/issue-18819.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ fn print_x(_: &Foo<Item=bool>, extra: &str) {
2323
}
2424

2525
fn main() {
26-
print_x(X);
27-
//~^ ERROR this function takes 2 parameters but 1 parameter was supplied
28-
//~| NOTE the following parameter types were expected: &Foo<Item=bool>, &str
26+
print_x(X); //~error this function takes 2 parameters but 1 parameter was supplied
27+
//~^ NOTE the following parameter types were expected: &Foo<Item=bool>, &str
2928
//~| NOTE expected 2 parameters
3029
}

src/test/compile-fail/issue-3044.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ fn main() {
1414
needlesArr.iter().fold(|x, y| {
1515
});
1616
//~^^ ERROR this function takes 2 parameters but 1 parameter was supplied
17-
//~| NOTE the following parameter types were expected
17+
//~^^^ NOTE the following parameter types were expected
1818
//~| NOTE expected 2 parameters
19+
//
1920
// the first error is, um, non-ideal.
2021
}

src/test/compile-fail/issue-4935.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
// Regression test for issue #4935
1212

1313
fn foo(a: usize) {}
14-
fn main() { foo(5, 6) }
15-
//~^ ERROR this function takes 1 parameter but 2 parameters were supplied
16-
//~| NOTE the following parameter type was expected
14+
fn main() { foo(5, 6) } //~ ERROR this function takes 1 parameter but 2 parameters were supplied
15+
//~^ NOTE the following parameter type was expected
1716
//~| NOTE expected 1 parameter

src/test/compile-fail/not-enough-arguments.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ fn foo(a: isize, b: isize, c: isize, d:isize) {
1919
fn main() {
2020
foo(1, 2, 3);
2121
//~^ ERROR this function takes 4 parameters but 3
22-
//~| NOTE the following parameter types were expected
22+
//~^^ NOTE the following parameter types were expected
2323
//~| NOTE expected 4 parameters
2424
}

0 commit comments

Comments
 (0)