mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 08:44:35 +00:00
Use verbose style for argument removal suggestion
This commit is contained in:
parent
c422581297
commit
8e9a3661a8
@ -1384,7 +1384,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||
Some(format!("provide the argument{}", if plural { "s" } else { "" }))
|
||||
}
|
||||
SuggestionText::Remove(plural) => {
|
||||
err.multipart_suggestion(
|
||||
err.multipart_suggestion_verbose(
|
||||
format!("remove the extra argument{}", if plural { "s" } else { "" }),
|
||||
suggestions,
|
||||
Applicability::HasPlaceholders,
|
||||
|
@ -16,16 +16,18 @@ error[E0061]: this function takes 0 arguments but 1 argument was supplied
|
||||
--> $DIR/basic.rs:21:5
|
||||
|
|
||||
LL | extra("");
|
||||
| ^^^^^ --
|
||||
| |
|
||||
| unexpected argument of type `&'static str`
|
||||
| help: remove the extra argument
|
||||
| ^^^^^ -- unexpected argument of type `&'static str`
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/basic.rs:14:4
|
||||
|
|
||||
LL | fn extra() {}
|
||||
| ^^^^^
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL - extra("");
|
||||
LL + extra();
|
||||
|
|
||||
|
||||
error[E0061]: this function takes 1 argument but 0 arguments were supplied
|
||||
--> $DIR/basic.rs:22:5
|
||||
|
@ -2,61 +2,69 @@ error[E0057]: this function takes 0 arguments but 1 argument was supplied
|
||||
--> $DIR/exotic-calls.rs:2:5
|
||||
|
|
||||
LL | t(1i32);
|
||||
| ^ ----
|
||||
| |
|
||||
| unexpected argument of type `i32`
|
||||
| help: remove the extra argument
|
||||
| ^ ---- unexpected argument of type `i32`
|
||||
|
|
||||
note: callable defined here
|
||||
--> $DIR/exotic-calls.rs:1:11
|
||||
|
|
||||
LL | fn foo<T: Fn()>(t: T) {
|
||||
| ^^^^
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL - t(1i32);
|
||||
LL + t();
|
||||
|
|
||||
|
||||
error[E0057]: this function takes 0 arguments but 1 argument was supplied
|
||||
--> $DIR/exotic-calls.rs:7:5
|
||||
|
|
||||
LL | t(1i32);
|
||||
| ^ ----
|
||||
| |
|
||||
| unexpected argument of type `i32`
|
||||
| help: remove the extra argument
|
||||
| ^ ---- unexpected argument of type `i32`
|
||||
|
|
||||
note: type parameter defined here
|
||||
--> $DIR/exotic-calls.rs:6:11
|
||||
|
|
||||
LL | fn bar(t: impl Fn()) {
|
||||
| ^^^^^^^^^
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL - t(1i32);
|
||||
LL + t();
|
||||
|
|
||||
|
||||
error[E0057]: this function takes 0 arguments but 1 argument was supplied
|
||||
--> $DIR/exotic-calls.rs:16:5
|
||||
|
|
||||
LL | baz()(1i32)
|
||||
| ^^^^^ ----
|
||||
| |
|
||||
| unexpected argument of type `i32`
|
||||
| help: remove the extra argument
|
||||
| ^^^^^ ---- unexpected argument of type `i32`
|
||||
|
|
||||
note: opaque type defined here
|
||||
--> $DIR/exotic-calls.rs:11:13
|
||||
|
|
||||
LL | fn baz() -> impl Fn() {
|
||||
| ^^^^^^^^^
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL - baz()(1i32)
|
||||
LL + baz()()
|
||||
|
|
||||
|
||||
error[E0057]: this function takes 0 arguments but 1 argument was supplied
|
||||
--> $DIR/exotic-calls.rs:22:5
|
||||
|
|
||||
LL | x(1i32);
|
||||
| ^ ----
|
||||
| |
|
||||
| unexpected argument of type `i32`
|
||||
| help: remove the extra argument
|
||||
| ^ ---- unexpected argument of type `i32`
|
||||
|
|
||||
note: closure defined here
|
||||
--> $DIR/exotic-calls.rs:21:13
|
||||
|
|
||||
LL | let x = || {};
|
||||
| ^^
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL - x(1i32);
|
||||
LL + x();
|
||||
|
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
|
@ -2,16 +2,18 @@ error[E0061]: this function takes 0 arguments but 1 argument was supplied
|
||||
--> $DIR/extra_arguments.rs:19:3
|
||||
|
|
||||
LL | empty("");
|
||||
| ^^^^^ --
|
||||
| |
|
||||
| unexpected argument of type `&'static str`
|
||||
| help: remove the extra argument
|
||||
| ^^^^^ -- unexpected argument of type `&'static str`
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/extra_arguments.rs:1:4
|
||||
|
|
||||
LL | fn empty() {}
|
||||
| ^^^^^
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL - empty("");
|
||||
LL + empty();
|
||||
|
|
||||
|
||||
error[E0061]: this function takes 0 arguments but 2 arguments were supplied
|
||||
--> $DIR/extra_arguments.rs:20:3
|
||||
@ -36,31 +38,35 @@ error[E0061]: this function takes 1 argument but 2 arguments were supplied
|
||||
--> $DIR/extra_arguments.rs:22:3
|
||||
|
|
||||
LL | one_arg(1, 1);
|
||||
| ^^^^^^^ ---
|
||||
| | |
|
||||
| | unexpected argument of type `{integer}`
|
||||
| help: remove the extra argument
|
||||
| ^^^^^^^ - unexpected argument of type `{integer}`
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/extra_arguments.rs:2:4
|
||||
|
|
||||
LL | fn one_arg<T>(_a: T) {}
|
||||
| ^^^^^^^ -----
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL - one_arg(1, 1);
|
||||
LL + one_arg(1);
|
||||
|
|
||||
|
||||
error[E0061]: this function takes 1 argument but 2 arguments were supplied
|
||||
--> $DIR/extra_arguments.rs:23:3
|
||||
|
|
||||
LL | one_arg(1, "");
|
||||
| ^^^^^^^ ----
|
||||
| | |
|
||||
| | unexpected argument of type `&'static str`
|
||||
| help: remove the extra argument
|
||||
| ^^^^^^^ -- unexpected argument of type `&'static str`
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/extra_arguments.rs:2:4
|
||||
|
|
||||
LL | fn one_arg<T>(_a: T) {}
|
||||
| ^^^^^^^ -----
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL - one_arg(1, "");
|
||||
LL + one_arg(1);
|
||||
|
|
||||
|
||||
error[E0061]: this function takes 1 argument but 3 arguments were supplied
|
||||
--> $DIR/extra_arguments.rs:24:3
|
||||
@ -85,61 +91,69 @@ error[E0061]: this function takes 2 arguments but 3 arguments were supplied
|
||||
--> $DIR/extra_arguments.rs:26:3
|
||||
|
|
||||
LL | two_arg_same(1, 1, 1);
|
||||
| ^^^^^^^^^^^^ ---
|
||||
| | |
|
||||
| | unexpected argument of type `{integer}`
|
||||
| help: remove the extra argument
|
||||
| ^^^^^^^^^^^^ - unexpected argument of type `{integer}`
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/extra_arguments.rs:3:4
|
||||
|
|
||||
LL | fn two_arg_same(_a: i32, _b: i32) {}
|
||||
| ^^^^^^^^^^^^ ------- -------
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL - two_arg_same(1, 1, 1);
|
||||
LL + two_arg_same(1, 1);
|
||||
|
|
||||
|
||||
error[E0061]: this function takes 2 arguments but 3 arguments were supplied
|
||||
--> $DIR/extra_arguments.rs:27:3
|
||||
|
|
||||
LL | two_arg_same(1, 1, 1.0);
|
||||
| ^^^^^^^^^^^^ -----
|
||||
| | |
|
||||
| | unexpected argument of type `{float}`
|
||||
| help: remove the extra argument
|
||||
| ^^^^^^^^^^^^ --- unexpected argument of type `{float}`
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/extra_arguments.rs:3:4
|
||||
|
|
||||
LL | fn two_arg_same(_a: i32, _b: i32) {}
|
||||
| ^^^^^^^^^^^^ ------- -------
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL - two_arg_same(1, 1, 1.0);
|
||||
LL + two_arg_same(1, 1);
|
||||
|
|
||||
|
||||
error[E0061]: this function takes 2 arguments but 3 arguments were supplied
|
||||
--> $DIR/extra_arguments.rs:29:3
|
||||
|
|
||||
LL | two_arg_diff(1, 1, "");
|
||||
| ^^^^^^^^^^^^ ---
|
||||
| | |
|
||||
| | unexpected argument of type `{integer}`
|
||||
| help: remove the extra argument
|
||||
| ^^^^^^^^^^^^ - unexpected argument of type `{integer}`
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/extra_arguments.rs:4:4
|
||||
|
|
||||
LL | fn two_arg_diff(_a: i32, _b: &str) {}
|
||||
| ^^^^^^^^^^^^ ------- --------
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL - two_arg_diff(1, 1, "");
|
||||
LL + two_arg_diff(1, "");
|
||||
|
|
||||
|
||||
error[E0061]: this function takes 2 arguments but 3 arguments were supplied
|
||||
--> $DIR/extra_arguments.rs:30:3
|
||||
|
|
||||
LL | two_arg_diff(1, "", "");
|
||||
| ^^^^^^^^^^^^ ----
|
||||
| | |
|
||||
| | unexpected argument of type `&'static str`
|
||||
| help: remove the extra argument
|
||||
| ^^^^^^^^^^^^ -- unexpected argument of type `&'static str`
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/extra_arguments.rs:4:4
|
||||
|
|
||||
LL | fn two_arg_diff(_a: i32, _b: &str) {}
|
||||
| ^^^^^^^^^^^^ ------- --------
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL - two_arg_diff(1, "", "");
|
||||
LL + two_arg_diff(1, "");
|
||||
|
|
||||
|
||||
error[E0061]: this function takes 2 arguments but 4 arguments were supplied
|
||||
--> $DIR/extra_arguments.rs:31:3
|
||||
@ -183,51 +197,56 @@ error[E0061]: this function takes 2 arguments but 3 arguments were supplied
|
||||
--> $DIR/extra_arguments.rs:35:3
|
||||
|
|
||||
LL | two_arg_same(1, 1, "");
|
||||
| ^^^^^^^^^^^^ --------
|
||||
| | |
|
||||
| | unexpected argument of type `&'static str`
|
||||
| help: remove the extra argument
|
||||
| ^^^^^^^^^^^^ -- unexpected argument of type `&'static str`
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/extra_arguments.rs:3:4
|
||||
|
|
||||
LL | fn two_arg_same(_a: i32, _b: i32) {}
|
||||
| ^^^^^^^^^^^^ ------- -------
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL - two_arg_same(1, 1, "");
|
||||
LL + two_arg_same(1, 1);
|
||||
|
|
||||
|
||||
error[E0061]: this function takes 2 arguments but 3 arguments were supplied
|
||||
--> $DIR/extra_arguments.rs:36:3
|
||||
|
|
||||
LL | two_arg_diff(1, 1, "");
|
||||
| ^^^^^^^^^^^^ ---
|
||||
| | |
|
||||
| | unexpected argument of type `{integer}`
|
||||
| help: remove the extra argument
|
||||
| ^^^^^^^^^^^^ - unexpected argument of type `{integer}`
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/extra_arguments.rs:4:4
|
||||
|
|
||||
LL | fn two_arg_diff(_a: i32, _b: &str) {}
|
||||
| ^^^^^^^^^^^^ ------- --------
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL - two_arg_diff(1, 1, "");
|
||||
LL + two_arg_diff(1, "");
|
||||
|
|
||||
|
||||
error[E0061]: this function takes 2 arguments but 3 arguments were supplied
|
||||
--> $DIR/extra_arguments.rs:37:3
|
||||
|
|
||||
LL | two_arg_same(
|
||||
| ^^^^^^^^^^^^
|
||||
LL | 1,
|
||||
LL | 1,
|
||||
| ______-
|
||||
LL | | ""
|
||||
| | --
|
||||
| |_____||
|
||||
| |help: remove the extra argument
|
||||
| unexpected argument of type `&'static str`
|
||||
...
|
||||
LL | ""
|
||||
| -- unexpected argument of type `&'static str`
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/extra_arguments.rs:3:4
|
||||
|
|
||||
LL | fn two_arg_same(_a: i32, _b: i32) {}
|
||||
| ^^^^^^^^^^^^ ------- -------
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL - 1,
|
||||
LL - ""
|
||||
LL + 1
|
||||
|
|
||||
|
||||
error[E0061]: this function takes 2 arguments but 3 arguments were supplied
|
||||
--> $DIR/extra_arguments.rs:43:3
|
||||
@ -235,18 +254,18 @@ error[E0061]: this function takes 2 arguments but 3 arguments were supplied
|
||||
LL | two_arg_diff(
|
||||
| ^^^^^^^^^^^^
|
||||
LL | 1,
|
||||
| ______-
|
||||
LL | | 1,
|
||||
| | -
|
||||
| | |
|
||||
| |_____unexpected argument of type `{integer}`
|
||||
| help: remove the extra argument
|
||||
LL | 1,
|
||||
| - unexpected argument of type `{integer}`
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/extra_arguments.rs:4:4
|
||||
|
|
||||
LL | fn two_arg_diff(_a: i32, _b: &str) {}
|
||||
| ^^^^^^^^^^^^ ------- --------
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL - 1,
|
||||
|
|
||||
|
||||
error[E0061]: this function takes 0 arguments but 2 arguments were supplied
|
||||
--> $DIR/extra_arguments.rs:8:9
|
||||
@ -310,61 +329,69 @@ error[E0061]: this function takes 1 argument but 2 arguments were supplied
|
||||
--> $DIR/extra_arguments.rs:53:3
|
||||
|
|
||||
LL | one_arg(1, panic!());
|
||||
| ^^^^^^^ ----------
|
||||
| | |
|
||||
| | unexpected argument
|
||||
| help: remove the extra argument
|
||||
| ^^^^^^^ -------- unexpected argument
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/extra_arguments.rs:2:4
|
||||
|
|
||||
LL | fn one_arg<T>(_a: T) {}
|
||||
| ^^^^^^^ -----
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL - one_arg(1, panic!());
|
||||
LL + one_arg(1);
|
||||
|
|
||||
|
||||
error[E0061]: this function takes 1 argument but 2 arguments were supplied
|
||||
--> $DIR/extra_arguments.rs:54:3
|
||||
|
|
||||
LL | one_arg(panic!(), 1);
|
||||
| ^^^^^^^ ---
|
||||
| | |
|
||||
| | unexpected argument of type `{integer}`
|
||||
| help: remove the extra argument
|
||||
| ^^^^^^^ - unexpected argument of type `{integer}`
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/extra_arguments.rs:2:4
|
||||
|
|
||||
LL | fn one_arg<T>(_a: T) {}
|
||||
| ^^^^^^^ -----
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL - one_arg(panic!(), 1);
|
||||
LL + one_arg(panic!());
|
||||
|
|
||||
|
||||
error[E0061]: this function takes 1 argument but 2 arguments were supplied
|
||||
--> $DIR/extra_arguments.rs:55:3
|
||||
|
|
||||
LL | one_arg(stringify!($e), 1);
|
||||
| ^^^^^^^ ---
|
||||
| | |
|
||||
| | unexpected argument of type `{integer}`
|
||||
| help: remove the extra argument
|
||||
| ^^^^^^^ - unexpected argument of type `{integer}`
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/extra_arguments.rs:2:4
|
||||
|
|
||||
LL | fn one_arg<T>(_a: T) {}
|
||||
| ^^^^^^^ -----
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL - one_arg(stringify!($e), 1);
|
||||
LL + one_arg(stringify!($e));
|
||||
|
|
||||
|
||||
error[E0061]: this function takes 1 argument but 2 arguments were supplied
|
||||
--> $DIR/extra_arguments.rs:60:3
|
||||
|
|
||||
LL | one_arg(for _ in 1.. {}, 1);
|
||||
| ^^^^^^^ ---
|
||||
| | |
|
||||
| | unexpected argument of type `{integer}`
|
||||
| help: remove the extra argument
|
||||
| ^^^^^^^ - unexpected argument of type `{integer}`
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/extra_arguments.rs:2:4
|
||||
|
|
||||
LL | fn one_arg<T>(_a: T) {}
|
||||
| ^^^^^^^ -----
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL - one_arg(for _ in 1.. {}, 1);
|
||||
LL + one_arg(for _ in 1.. {});
|
||||
|
|
||||
|
||||
error: aborting due to 22 previous errors
|
||||
|
||||
|
@ -32,91 +32,103 @@ error[E0061]: this function takes 1 argument but 2 arguments were supplied
|
||||
--> $DIR/suggest-better-removing-issue-126246.rs:10:5
|
||||
|
|
||||
LL | add_one(2, 2);
|
||||
| ^^^^^^^ ---
|
||||
| | |
|
||||
| | unexpected argument of type `{integer}`
|
||||
| help: remove the extra argument
|
||||
| ^^^^^^^ - unexpected argument of type `{integer}`
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/suggest-better-removing-issue-126246.rs:1:4
|
||||
|
|
||||
LL | fn add_one(x: i32) -> i32 {
|
||||
| ^^^^^^^ ------
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL - add_one(2, 2);
|
||||
LL + add_one(2);
|
||||
|
|
||||
|
||||
error[E0061]: this function takes 1 argument but 2 arguments were supplied
|
||||
--> $DIR/suggest-better-removing-issue-126246.rs:11:5
|
||||
|
|
||||
LL | add_one(no_such_local, 10);
|
||||
| ^^^^^^^ ---------------
|
||||
| |
|
||||
| unexpected argument
|
||||
| help: remove the extra argument
|
||||
| ^^^^^^^ ------------- unexpected argument
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/suggest-better-removing-issue-126246.rs:1:4
|
||||
|
|
||||
LL | fn add_one(x: i32) -> i32 {
|
||||
| ^^^^^^^ ------
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL - add_one(no_such_local, 10);
|
||||
LL + add_one(10);
|
||||
|
|
||||
|
||||
error[E0061]: this function takes 1 argument but 2 arguments were supplied
|
||||
--> $DIR/suggest-better-removing-issue-126246.rs:13:5
|
||||
|
|
||||
LL | add_one(10, no_such_local);
|
||||
| ^^^^^^^ ---------------
|
||||
| | |
|
||||
| | unexpected argument
|
||||
| help: remove the extra argument
|
||||
| ^^^^^^^ ------------- unexpected argument
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/suggest-better-removing-issue-126246.rs:1:4
|
||||
|
|
||||
LL | fn add_one(x: i32) -> i32 {
|
||||
| ^^^^^^^ ------
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL - add_one(10, no_such_local);
|
||||
LL + add_one(10);
|
||||
|
|
||||
|
||||
error[E0061]: this function takes 2 arguments but 3 arguments were supplied
|
||||
--> $DIR/suggest-better-removing-issue-126246.rs:15:5
|
||||
|
|
||||
LL | add_two(10, no_such_local, 10);
|
||||
| ^^^^^^^ ---------------
|
||||
| | |
|
||||
| | unexpected argument
|
||||
| help: remove the extra argument
|
||||
| ^^^^^^^ ------------- unexpected argument
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/suggest-better-removing-issue-126246.rs:5:4
|
||||
|
|
||||
LL | fn add_two(x: i32, y: i32) -> i32 {
|
||||
| ^^^^^^^ ------ ------
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL - add_two(10, no_such_local, 10);
|
||||
LL + add_two(10, 10);
|
||||
|
|
||||
|
||||
error[E0061]: this function takes 2 arguments but 3 arguments were supplied
|
||||
--> $DIR/suggest-better-removing-issue-126246.rs:17:5
|
||||
|
|
||||
LL | add_two(no_such_local, 10, 10);
|
||||
| ^^^^^^^ ---------------
|
||||
| |
|
||||
| unexpected argument
|
||||
| help: remove the extra argument
|
||||
| ^^^^^^^ ------------- unexpected argument
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/suggest-better-removing-issue-126246.rs:5:4
|
||||
|
|
||||
LL | fn add_two(x: i32, y: i32) -> i32 {
|
||||
| ^^^^^^^ ------ ------
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL - add_two(no_such_local, 10, 10);
|
||||
LL + add_two(10, 10);
|
||||
|
|
||||
|
||||
error[E0061]: this function takes 2 arguments but 3 arguments were supplied
|
||||
--> $DIR/suggest-better-removing-issue-126246.rs:19:5
|
||||
|
|
||||
LL | add_two(10, 10, no_such_local);
|
||||
| ^^^^^^^ ---------------
|
||||
| | |
|
||||
| | unexpected argument
|
||||
| help: remove the extra argument
|
||||
| ^^^^^^^ ------------- unexpected argument
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/suggest-better-removing-issue-126246.rs:5:4
|
||||
|
|
||||
LL | fn add_two(x: i32, y: i32) -> i32 {
|
||||
| ^^^^^^^ ------ ------
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL - add_two(10, 10, no_such_local);
|
||||
LL + add_two(10, 10);
|
||||
|
|
||||
|
||||
error: aborting due to 11 previous errors
|
||||
|
||||
|
@ -18,16 +18,18 @@ error[E0057]: this function takes 1 argument but 2 arguments were supplied
|
||||
--> $DIR/E0057.rs:5:13
|
||||
|
|
||||
LL | let c = f(2, 3);
|
||||
| ^ ---
|
||||
| | |
|
||||
| | unexpected argument of type `{integer}`
|
||||
| help: remove the extra argument
|
||||
| ^ - unexpected argument of type `{integer}`
|
||||
|
|
||||
note: closure defined here
|
||||
--> $DIR/E0057.rs:2:13
|
||||
|
|
||||
LL | let f = |x| x * 3;
|
||||
| ^^^
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL - let c = f(2, 3);
|
||||
LL + let c = f(2);
|
||||
|
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
@ -57,31 +57,35 @@ error[E0061]: this function takes 0 arguments but 1 argument was supplied
|
||||
--> $DIR/opaque-used-in-extraneous-argument.rs:17:20
|
||||
|
|
||||
LL | let old_path = frob("hello");
|
||||
| ^^^^ -------
|
||||
| |
|
||||
| unexpected argument of type `&'static str`
|
||||
| help: remove the extra argument
|
||||
| ^^^^ ------- unexpected argument of type `&'static str`
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/opaque-used-in-extraneous-argument.rs:5:4
|
||||
|
|
||||
LL | fn frob() -> impl Fn<P, Output = T> + '_ {}
|
||||
| ^^^^
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL - let old_path = frob("hello");
|
||||
LL + let old_path = frob();
|
||||
|
|
||||
|
||||
error[E0061]: this function takes 0 arguments but 1 argument was supplied
|
||||
--> $DIR/opaque-used-in-extraneous-argument.rs:20:5
|
||||
|
|
||||
LL | open_parent(&old_path)
|
||||
| ^^^^^^^^^^^ ---------
|
||||
| |
|
||||
| unexpected argument of type `&impl FnOnce<{type error}, Output = {type error}> + Fn<{type error}> + 'static`
|
||||
| help: remove the extra argument
|
||||
| ^^^^^^^^^^^ --------- unexpected argument of type `&impl FnOnce<{type error}, Output = {type error}> + Fn<{type error}> + 'static`
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/opaque-used-in-extraneous-argument.rs:12:4
|
||||
|
|
||||
LL | fn open_parent<'path>() {
|
||||
| ^^^^^^^^^^^
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL - open_parent(&old_path)
|
||||
LL + open_parent()
|
||||
|
|
||||
|
||||
error: aborting due to 7 previous errors
|
||||
|
||||
|
@ -55,16 +55,18 @@ error[E0061]: this function takes 0 arguments but 1 argument was supplied
|
||||
--> $DIR/ice-ifer-var-leaked-out-of-rollback-122098.rs:21:31
|
||||
|
|
||||
LL | LendingIterator::for_each(Query::new(&data), Box::new);
|
||||
| ^^^^^^^^^^ -----
|
||||
| |
|
||||
| unexpected argument of type `&fn() {data}`
|
||||
| help: remove the extra argument
|
||||
| ^^^^^^^^^^ ----- unexpected argument of type `&fn() {data}`
|
||||
|
|
||||
note: associated function defined here
|
||||
--> $DIR/ice-ifer-var-leaked-out-of-rollback-122098.rs:17:12
|
||||
|
|
||||
LL | pub fn new() -> Self {}
|
||||
| ^^^
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL - LendingIterator::for_each(Query::new(&data), Box::new);
|
||||
LL + LendingIterator::for_each(Query::new(), Box::new);
|
||||
|
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
|
||||
|
@ -2,16 +2,18 @@ error[E0057]: this function takes 0 arguments but 1 argument was supplied
|
||||
--> $DIR/issue-16939.rs:5:9
|
||||
|
|
||||
LL | |t| f(t);
|
||||
| ^ -
|
||||
| |
|
||||
| unexpected argument
|
||||
| help: remove the extra argument
|
||||
| ^ - unexpected argument
|
||||
|
|
||||
note: callable defined here
|
||||
--> $DIR/issue-16939.rs:4:12
|
||||
|
|
||||
LL | fn _foo<F: Fn()> (f: F) {
|
||||
| ^^^^
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL - |t| f(t);
|
||||
LL + |t| f();
|
||||
|
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
|
@ -2,16 +2,18 @@ error[E0061]: this function takes 1 argument but 2 arguments were supplied
|
||||
--> $DIR/issue-4935.rs:5:13
|
||||
|
|
||||
LL | fn main() { foo(5, 6) }
|
||||
| ^^^ ---
|
||||
| | |
|
||||
| | unexpected argument of type `{integer}`
|
||||
| help: remove the extra argument
|
||||
| ^^^ - unexpected argument of type `{integer}`
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/issue-4935.rs:3:4
|
||||
|
|
||||
LL | fn foo(a: usize) {}
|
||||
| ^^^ --------
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL - fn main() { foo(5, 6) }
|
||||
LL + fn main() { foo(5) }
|
||||
|
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
|
@ -2,16 +2,18 @@ error[E0061]: this method takes 0 arguments but 1 argument was supplied
|
||||
--> $DIR/method-call-err-msg.rs:13:7
|
||||
|
|
||||
LL | x.zero(0)
|
||||
| ^^^^ -
|
||||
| |
|
||||
| unexpected argument of type `{integer}`
|
||||
| help: remove the extra argument
|
||||
| ^^^^ - unexpected argument of type `{integer}`
|
||||
|
|
||||
note: method defined here
|
||||
--> $DIR/method-call-err-msg.rs:5:8
|
||||
|
|
||||
LL | fn zero(self) -> Foo { self }
|
||||
| ^^^^
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL - x.zero(0)
|
||||
LL + x.zero()
|
||||
|
|
||||
|
||||
error[E0061]: this method takes 1 argument but 0 arguments were supplied
|
||||
--> $DIR/method-call-err-msg.rs:14:7
|
||||
|
@ -24,13 +24,15 @@ error[E0061]: this function takes 0 arguments but 1 argument was supplied
|
||||
--> $DIR/resolve-primitive-fallback.rs:3:5
|
||||
|
|
||||
LL | std::mem::size_of(u16);
|
||||
| ^^^^^^^^^^^^^^^^^ ---
|
||||
| |
|
||||
| unexpected argument
|
||||
| help: remove the extra argument
|
||||
| ^^^^^^^^^^^^^^^^^ --- unexpected argument
|
||||
|
|
||||
note: function defined here
|
||||
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL - std::mem::size_of(u16);
|
||||
LL + std::mem::size_of();
|
||||
|
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
|
@ -54,16 +54,18 @@ error[E0061]: this function takes 2 arguments but 3 arguments were supplied
|
||||
--> $DIR/issue-34264.rs:7:5
|
||||
|
|
||||
LL | foo(Some(42), 2, "");
|
||||
| ^^^ ----
|
||||
| | |
|
||||
| | unexpected argument of type `&'static str`
|
||||
| help: remove the extra argument
|
||||
| ^^^ -- unexpected argument of type `&'static str`
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/issue-34264.rs:1:4
|
||||
|
|
||||
LL | fn foo(Option<i32>, String) {}
|
||||
| ^^^ ----------- ------
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL - foo(Some(42), 2, "");
|
||||
LL + foo(Some(42), 2);
|
||||
|
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-34264.rs:8:13
|
||||
@ -83,16 +85,18 @@ error[E0061]: this function takes 2 arguments but 3 arguments were supplied
|
||||
--> $DIR/issue-34264.rs:10:5
|
||||
|
|
||||
LL | bar(1, 2, 3);
|
||||
| ^^^ ---
|
||||
| | |
|
||||
| | unexpected argument of type `{integer}`
|
||||
| help: remove the extra argument
|
||||
| ^^^ - unexpected argument of type `{integer}`
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/issue-34264.rs:3:4
|
||||
|
|
||||
LL | fn bar(x, y: usize) {}
|
||||
| ^^^ - --------
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL - bar(1, 2, 3);
|
||||
LL + bar(1, 2);
|
||||
|
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
|
||||
|
@ -6,16 +6,21 @@ LL | (|| {})(|| {
|
||||
LL | |
|
||||
LL | | let b = 1;
|
||||
LL | | });
|
||||
| | -
|
||||
| | |
|
||||
| |_____unexpected argument of type `{closure@$DIR/wrong_argument_ice-4.rs:2:13: 2:15}`
|
||||
| help: remove the extra argument
|
||||
| |_____- unexpected argument of type `{closure@$DIR/wrong_argument_ice-4.rs:2:13: 2:15}`
|
||||
|
|
||||
note: closure defined here
|
||||
--> $DIR/wrong_argument_ice-4.rs:2:6
|
||||
|
|
||||
LL | (|| {})(|| {
|
||||
| ^^
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL - (|| {})(|| {
|
||||
LL -
|
||||
LL - let b = 1;
|
||||
LL - });
|
||||
LL + (|| {})();
|
||||
|
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
|
@ -11,13 +11,15 @@ error[E0061]: this function takes 1 argument but 2 arguments were supplied
|
||||
--> $DIR/type-ascription-instead-of-initializer.rs:2:12
|
||||
|
|
||||
LL | let x: Vec::with_capacity(10, 20);
|
||||
| ^^^^^^^^^^^^^^^^^^ ----
|
||||
| | |
|
||||
| | unexpected argument of type `{integer}`
|
||||
| help: remove the extra argument
|
||||
| ^^^^^^^^^^^^^^^^^^ -- unexpected argument of type `{integer}`
|
||||
|
|
||||
note: associated function defined here
|
||||
--> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL - let x: Vec::with_capacity(10, 20);
|
||||
LL + let x: Vec::with_capacity(10);
|
||||
|
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
@ -2,16 +2,18 @@ error[E0061]: this function takes 1 argument but 2 arguments were supplied
|
||||
--> $DIR/remove-extra-argument.rs:6:5
|
||||
|
|
||||
LL | l(vec![], vec![])
|
||||
| ^ --------
|
||||
| | |
|
||||
| | unexpected argument of type `Vec<_>`
|
||||
| help: remove the extra argument
|
||||
| ^ ------ unexpected argument of type `Vec<_>`
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/remove-extra-argument.rs:3:4
|
||||
|
|
||||
LL | fn l(_a: Vec<u8>) {}
|
||||
| ^ -----------
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL - l(vec![], vec![])
|
||||
LL + l(vec![])
|
||||
|
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
|
@ -2,13 +2,15 @@ error[E0061]: this enum variant takes 1 argument but 2 arguments were supplied
|
||||
--> $DIR/struct-enum-wrong-args.rs:6:13
|
||||
|
|
||||
LL | let _ = Some(3, 2);
|
||||
| ^^^^ ---
|
||||
| | |
|
||||
| | unexpected argument of type `{integer}`
|
||||
| help: remove the extra argument
|
||||
| ^^^^ - unexpected argument of type `{integer}`
|
||||
|
|
||||
note: tuple variant defined here
|
||||
--> $SRC_DIR/core/src/option.rs:LL:COL
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL - let _ = Some(3, 2);
|
||||
LL + let _ = Some(3);
|
||||
|
|
||||
|
||||
error[E0061]: this enum variant takes 1 argument but 3 arguments were supplied
|
||||
--> $DIR/struct-enum-wrong-args.rs:7:13
|
||||
@ -59,16 +61,18 @@ error[E0061]: this struct takes 1 argument but 2 arguments were supplied
|
||||
--> $DIR/struct-enum-wrong-args.rs:10:13
|
||||
|
|
||||
LL | let _ = Wrapper(5, 2);
|
||||
| ^^^^^^^ ---
|
||||
| | |
|
||||
| | unexpected argument of type `{integer}`
|
||||
| help: remove the extra argument
|
||||
| ^^^^^^^ - unexpected argument of type `{integer}`
|
||||
|
|
||||
note: tuple struct defined here
|
||||
--> $DIR/struct-enum-wrong-args.rs:2:8
|
||||
|
|
||||
LL | struct Wrapper(i32);
|
||||
| ^^^^^^^
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL - let _ = Wrapper(5, 2);
|
||||
LL + let _ = Wrapper(5);
|
||||
|
|
||||
|
||||
error[E0061]: this struct takes 2 arguments but 0 arguments were supplied
|
||||
--> $DIR/struct-enum-wrong-args.rs:11:13
|
||||
@ -106,16 +110,18 @@ error[E0061]: this struct takes 2 arguments but 3 arguments were supplied
|
||||
--> $DIR/struct-enum-wrong-args.rs:13:13
|
||||
|
|
||||
LL | let _ = DoubleWrapper(5, 2, 7);
|
||||
| ^^^^^^^^^^^^^ ---
|
||||
| | |
|
||||
| | unexpected argument of type `{integer}`
|
||||
| help: remove the extra argument
|
||||
| ^^^^^^^^^^^^^ - unexpected argument of type `{integer}`
|
||||
|
|
||||
note: tuple struct defined here
|
||||
--> $DIR/struct-enum-wrong-args.rs:3:8
|
||||
|
|
||||
LL | struct DoubleWrapper(i32, i32);
|
||||
| ^^^^^^^^^^^^^
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL - let _ = DoubleWrapper(5, 2, 7);
|
||||
LL + let _ = DoubleWrapper(5, 2);
|
||||
|
|
||||
|
||||
error: aborting due to 8 previous errors
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user