On mismatched argument count point at arguments

This commit is contained in:
Esteban Küber 2020-02-05 21:08:07 -08:00
parent a19edd6b16
commit 683ebc2dec
35 changed files with 214 additions and 105 deletions

View file

@ -1,8 +1,10 @@
error[E0057]: this function takes 0 parameters but 1 parameter was supplied
error[E0057]: this function takes 0 arguments but 1 argument was supplied
--> $DIR/issue-16939.rs:5:9
|
LL | |t| f(t);
| ^^^^ expected 0 parameters
| ^ - supplied 1 argument
| |
| expected 0 arguments
error: aborting due to previous error

View file

@ -1,11 +1,13 @@
error[E0061]: this function takes 2 parameters but 1 parameter was supplied
error[E0061]: this function takes 2 arguments but 1 argument was supplied
--> $DIR/issue-18819.rs:16:5
|
LL | fn print_x(_: &dyn Foo<Item=bool>, extra: &str) {
| ----------------------------------------------- defined here
...
LL | print_x(X);
| ^^^^^^^^^^ expected 2 parameters
| ^^^^^^^ - supplied 1 argument
| |
| expected 2 arguments
error: aborting due to previous error

View file

@ -1,13 +1,13 @@
macro_rules! some_macro {
($other: expr) => ({
$other(None)
//~^ this function takes 0 parameters but 1 parameter was supplied
$other(None) //~ NOTE supplied 1 argument
})
}
fn some_function() {}
fn some_function() {} //~ NOTE defined here
fn main() {
some_macro!(some_function);
//~^ in this expansion of some_macro!
//~^ ERROR this function takes 0 arguments but 1 argument was supplied
//~| NOTE expected 0 arguments
}

View file

@ -1,16 +1,14 @@
error[E0061]: this function takes 0 parameters but 1 parameter was supplied
--> $DIR/issue-26094.rs:3:9
error[E0061]: this function takes 0 arguments but 1 argument was supplied
--> $DIR/issue-26094.rs:10:17
|
LL | $other(None)
| ^^^^^^^^^^^^ expected 0 parameters
| ---- supplied 1 argument
...
LL | fn some_function() {}
| ------------------ defined here
...
LL | some_macro!(some_function);
| --------------------------- in this macro invocation
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
| ^^^^^^^^^^^^^ expected 0 arguments
error: aborting due to previous error

View file

@ -2,5 +2,5 @@ fn main() {
let needlesArr: Vec<char> = vec!['a', 'f'];
needlesArr.iter().fold(|x, y| {
});
//~^^ ERROR this function takes 2 parameters but 1 parameter was supplied
//~^^ ERROR this function takes 2 arguments but 1 argument was supplied
}

View file

@ -1,8 +1,12 @@
error[E0061]: this function takes 2 parameters but 1 parameter was supplied
error[E0061]: this function takes 2 arguments but 1 argument was supplied
--> $DIR/issue-3044.rs:3:23
|
LL | needlesArr.iter().fold(|x, y| {
| ^^^^ expected 2 parameters
LL | needlesArr.iter().fold(|x, y| {
| _______________________^^^^_-
| | |
| | expected 2 arguments
LL | | });
| |_____- supplied 1 argument
error: aborting due to previous error

View file

@ -3,4 +3,4 @@
fn foo(a: usize) {}
//~^ defined here
fn main() { foo(5, 6) }
//~^ ERROR this function takes 1 parameter but 2 parameters were supplied
//~^ ERROR this function takes 1 argument but 2 arguments were supplied

View file

@ -1,11 +1,13 @@
error[E0061]: this function takes 1 parameter but 2 parameters were supplied
error[E0061]: this function takes 1 argument but 2 arguments were supplied
--> $DIR/issue-4935.rs:5:13
|
LL | fn foo(a: usize) {}
| ---------------- defined here
LL |
LL | fn main() { foo(5, 6) }
| ^^^^^^^^^ expected 1 parameter
| ^^^ - - supplied 2 arguments
| |
| expected 1 argument
error: aborting due to previous error