summaryrefslogtreecommitdiffstats
path: root/tests/ui/argument-suggestions
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:43 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:43 +0000
commit3e3e70d529d8c7d7c4d7bc4fefc9f109393b9245 (patch)
treedaf049b282ab10e8c3d03e409b3cd84ff3f7690c /tests/ui/argument-suggestions
parentAdding debian version 1.68.2+dfsg1-1. (diff)
downloadrustc-3e3e70d529d8c7d7c4d7bc4fefc9f109393b9245.tar.xz
rustc-3e3e70d529d8c7d7c4d7bc4fefc9f109393b9245.zip
Merging upstream version 1.69.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/argument-suggestions')
-rw-r--r--tests/ui/argument-suggestions/basic.stderr9
-rw-r--r--tests/ui/argument-suggestions/exotic-calls.stderr36
-rw-r--r--tests/ui/argument-suggestions/extra_arguments.rs8
-rw-r--r--tests/ui/argument-suggestions/extra_arguments.stderr214
-rw-r--r--tests/ui/argument-suggestions/formal-and-expected-differ.stderr4
-rw-r--r--tests/ui/argument-suggestions/invalid_arguments.stderr48
-rw-r--r--tests/ui/argument-suggestions/issue-100154.stderr2
-rw-r--r--tests/ui/argument-suggestions/issue-100478.stderr2
-rw-r--r--tests/ui/argument-suggestions/issue-101097.stderr8
-rw-r--r--tests/ui/argument-suggestions/issue-97484.stderr13
-rw-r--r--tests/ui/argument-suggestions/mixed_cases.stderr17
-rw-r--r--tests/ui/argument-suggestions/too-long.stderr2
-rw-r--r--tests/ui/argument-suggestions/two-mismatch-notes.stderr5
13 files changed, 204 insertions, 164 deletions
diff --git a/tests/ui/argument-suggestions/basic.stderr b/tests/ui/argument-suggestions/basic.stderr
index 062b37688..c74186285 100644
--- a/tests/ui/argument-suggestions/basic.stderr
+++ b/tests/ui/argument-suggestions/basic.stderr
@@ -16,17 +16,16 @@ error[E0061]: this function takes 0 arguments but 1 argument was supplied
--> $DIR/basic.rs:21:5
|
LL | extra("");
- | ^^^^^ -- argument of type `&'static str` unexpected
+ | ^^^^^ --
+ | |
+ | unexpected argument of type `&'static str`
+ | help: remove the extra argument
|
note: function defined here
--> $DIR/basic.rs:14:4
|
LL | fn extra() {}
| ^^^^^
-help: remove the extra argument
- |
-LL | extra();
- | ~~
error[E0061]: this function takes 1 argument but 0 arguments were supplied
--> $DIR/basic.rs:22:5
diff --git a/tests/ui/argument-suggestions/exotic-calls.stderr b/tests/ui/argument-suggestions/exotic-calls.stderr
index 0580e53c5..ff795b507 100644
--- a/tests/ui/argument-suggestions/exotic-calls.stderr
+++ b/tests/ui/argument-suggestions/exotic-calls.stderr
@@ -2,65 +2,61 @@ error[E0057]: this function takes 0 arguments but 1 argument was supplied
--> $DIR/exotic-calls.rs:2:5
|
LL | t(1i32);
- | ^ ---- argument of type `i32` unexpected
+ | ^ ----
+ | |
+ | unexpected argument of type `i32`
+ | help: remove the extra argument
|
note: callable defined here
--> $DIR/exotic-calls.rs:1:11
|
LL | fn foo<T: Fn()>(t: T) {
| ^^^^
-help: remove the extra argument
- |
-LL | t();
- | ~~
error[E0057]: this function takes 0 arguments but 1 argument was supplied
--> $DIR/exotic-calls.rs:7:5
|
LL | t(1i32);
- | ^ ---- argument of type `i32` unexpected
+ | ^ ----
+ | |
+ | unexpected argument of type `i32`
+ | help: remove the extra argument
|
note: type parameter defined here
--> $DIR/exotic-calls.rs:6:11
|
LL | fn bar(t: impl Fn()) {
| ^^^^^^^^^
-help: remove the extra argument
- |
-LL | t();
- | ~~
error[E0057]: this function takes 0 arguments but 1 argument was supplied
--> $DIR/exotic-calls.rs:16:5
|
LL | baz()(1i32)
- | ^^^^^ ---- argument of type `i32` unexpected
+ | ^^^^^ ----
+ | |
+ | unexpected argument of type `i32`
+ | help: remove the extra argument
|
note: opaque type defined here
--> $DIR/exotic-calls.rs:11:13
|
LL | fn baz() -> impl Fn() {
| ^^^^^^^^^
-help: remove the extra argument
- |
-LL | baz()()
- | ~~
error[E0057]: this function takes 0 arguments but 1 argument was supplied
--> $DIR/exotic-calls.rs:22:5
|
LL | x(1i32);
- | ^ ---- argument of type `i32` unexpected
+ | ^ ----
+ | |
+ | unexpected argument of type `i32`
+ | help: remove the extra argument
|
note: closure defined here
--> $DIR/exotic-calls.rs:21:13
|
LL | let x = || {};
| ^^
-help: remove the extra argument
- |
-LL | x();
- | ~~
error: aborting due to 4 previous errors
diff --git a/tests/ui/argument-suggestions/extra_arguments.rs b/tests/ui/argument-suggestions/extra_arguments.rs
index 3f83de95e..144206232 100644
--- a/tests/ui/argument-suggestions/extra_arguments.rs
+++ b/tests/ui/argument-suggestions/extra_arguments.rs
@@ -3,8 +3,15 @@ fn one_arg(_a: i32) {}
fn two_arg_same(_a: i32, _b: i32) {}
fn two_arg_diff(_a: i32, _b: &str) {}
+macro_rules! foo {
+ ($x:expr) => {
+ empty($x, 1); //~ ERROR function takes
+ }
+}
+
fn main() {
empty(""); //~ ERROR function takes
+ empty(1, 1); //~ ERROR function takes
one_arg(1, 1); //~ ERROR function takes
one_arg(1, ""); //~ ERROR function takes
@@ -32,4 +39,5 @@ fn main() {
1,
""
);
+ foo!(1);
}
diff --git a/tests/ui/argument-suggestions/extra_arguments.stderr b/tests/ui/argument-suggestions/extra_arguments.stderr
index 48787b0c3..11c710997 100644
--- a/tests/ui/argument-suggestions/extra_arguments.stderr
+++ b/tests/ui/argument-suggestions/extra_arguments.stderr
@@ -1,58 +1,74 @@
error[E0061]: this function takes 0 arguments but 1 argument was supplied
- --> $DIR/extra_arguments.rs:7:3
+ --> $DIR/extra_arguments.rs:13:3
|
LL | empty("");
- | ^^^^^ -- argument of type `&'static str` unexpected
+ | ^^^^^ --
+ | |
+ | unexpected argument of type `&'static str`
+ | help: remove the extra argument
|
note: function defined here
--> $DIR/extra_arguments.rs:1:4
|
LL | fn empty() {}
| ^^^^^
-help: remove the extra argument
+
+error[E0061]: this function takes 0 arguments but 2 arguments were supplied
+ --> $DIR/extra_arguments.rs:14:3
+ |
+LL | empty(1, 1);
+ | ^^^^^ - - unexpected argument of type `{integer}`
+ | |
+ | unexpected argument of type `{integer}`
+ |
+note: function defined here
+ --> $DIR/extra_arguments.rs:1:4
+ |
+LL | fn empty() {}
+ | ^^^^^
+help: remove the extra arguments
+ |
+LL - empty(1, 1);
+LL + empty();
|
-LL | empty();
- | ~~
error[E0061]: this function takes 1 argument but 2 arguments were supplied
- --> $DIR/extra_arguments.rs:9:3
+ --> $DIR/extra_arguments.rs:16:3
|
LL | one_arg(1, 1);
- | ^^^^^^^ - argument of type `{integer}` unexpected
+ | ^^^^^^^ ---
+ | | |
+ | | unexpected argument of type `{integer}`
+ | help: remove the extra argument
|
note: function defined here
--> $DIR/extra_arguments.rs:2:4
|
LL | fn one_arg(_a: i32) {}
| ^^^^^^^ -------
-help: remove the extra argument
- |
-LL | one_arg(1);
- | ~~~
error[E0061]: this function takes 1 argument but 2 arguments were supplied
- --> $DIR/extra_arguments.rs:10:3
+ --> $DIR/extra_arguments.rs:17:3
|
LL | one_arg(1, "");
- | ^^^^^^^ -- argument of type `&'static str` unexpected
+ | ^^^^^^^ ----
+ | | |
+ | | unexpected argument of type `&'static str`
+ | help: remove the extra argument
|
note: function defined here
--> $DIR/extra_arguments.rs:2:4
|
LL | fn one_arg(_a: i32) {}
| ^^^^^^^ -------
-help: remove the extra argument
- |
-LL | one_arg(1);
- | ~~~
error[E0061]: this function takes 1 argument but 3 arguments were supplied
- --> $DIR/extra_arguments.rs:11:3
+ --> $DIR/extra_arguments.rs:18:3
|
LL | one_arg(1, "", 1.0);
- | ^^^^^^^ -- --- argument of type `{float}` unexpected
+ | ^^^^^^^ -- --- unexpected argument of type `{float}`
| |
- | argument of type `&'static str` unexpected
+ | unexpected argument of type `&'static str`
|
note: function defined here
--> $DIR/extra_arguments.rs:2:4
@@ -61,80 +77,77 @@ LL | fn one_arg(_a: i32) {}
| ^^^^^^^ -------
help: remove the extra arguments
|
-LL | one_arg(1);
- | ~~~
+LL - one_arg(1, "", 1.0);
+LL + one_arg(1);
+ |
error[E0061]: this function takes 2 arguments but 3 arguments were supplied
- --> $DIR/extra_arguments.rs:13:3
+ --> $DIR/extra_arguments.rs:20:3
|
LL | two_arg_same(1, 1, 1);
- | ^^^^^^^^^^^^ - argument of type `{integer}` unexpected
+ | ^^^^^^^^^^^^ ---
+ | | |
+ | | unexpected argument of type `{integer}`
+ | help: remove the extra argument
|
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);
- | ~~~~~~
error[E0061]: this function takes 2 arguments but 3 arguments were supplied
- --> $DIR/extra_arguments.rs:14:3
+ --> $DIR/extra_arguments.rs:21:3
|
LL | two_arg_same(1, 1, 1.0);
- | ^^^^^^^^^^^^ --- argument of type `{float}` unexpected
+ | ^^^^^^^^^^^^ -----
+ | | |
+ | | unexpected argument of type `{float}`
+ | help: remove the extra argument
|
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);
- | ~~~~~~
error[E0061]: this function takes 2 arguments but 3 arguments were supplied
- --> $DIR/extra_arguments.rs:16:3
+ --> $DIR/extra_arguments.rs:23:3
|
LL | two_arg_diff(1, 1, "");
- | ^^^^^^^^^^^^ - argument of type `{integer}` unexpected
+ | ^^^^^^^^^^^^ ---
+ | | |
+ | | unexpected argument of type `{integer}`
+ | help: remove the extra argument
|
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, "");
- | ~~~~~~~
error[E0061]: this function takes 2 arguments but 3 arguments were supplied
- --> $DIR/extra_arguments.rs:17:3
+ --> $DIR/extra_arguments.rs:24:3
|
LL | two_arg_diff(1, "", "");
- | ^^^^^^^^^^^^ -- argument of type `&'static str` unexpected
+ | ^^^^^^^^^^^^ ----
+ | | |
+ | | unexpected argument of type `&'static str`
+ | help: remove the extra argument
|
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, "");
- | ~~~~~~~
error[E0061]: this function takes 2 arguments but 4 arguments were supplied
- --> $DIR/extra_arguments.rs:18:3
+ --> $DIR/extra_arguments.rs:25:3
|
LL | two_arg_diff(1, 1, "", "");
- | ^^^^^^^^^^^^ - -- argument of type `&'static str` unexpected
+ | ^^^^^^^^^^^^ - -- unexpected argument of type `&'static str`
| |
- | argument of type `{integer}` unexpected
+ | unexpected argument of type `{integer}`
|
note: function defined here
--> $DIR/extra_arguments.rs:4:4
@@ -143,16 +156,17 @@ LL | fn two_arg_diff(_a: i32, _b: &str) {}
| ^^^^^^^^^^^^ ------- --------
help: remove the extra arguments
|
-LL | two_arg_diff(1, "");
- | ~~~~~~~
+LL - two_arg_diff(1, 1, "", "");
+LL + two_arg_diff(1, "");
+ |
error[E0061]: this function takes 2 arguments but 4 arguments were supplied
- --> $DIR/extra_arguments.rs:19:3
+ --> $DIR/extra_arguments.rs:26:3
|
LL | two_arg_diff(1, "", 1, "");
- | ^^^^^^^^^^^^ - -- argument of type `&'static str` unexpected
+ | ^^^^^^^^^^^^ - -- unexpected argument of type `&'static str`
| |
- | argument of type `{integer}` unexpected
+ | unexpected argument of type `{integer}`
|
note: function defined here
--> $DIR/extra_arguments.rs:4:4
@@ -161,79 +175,99 @@ LL | fn two_arg_diff(_a: i32, _b: &str) {}
| ^^^^^^^^^^^^ ------- --------
help: remove the extra arguments
|
-LL | two_arg_diff(1, "");
- | ~~~~~~~
+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:22:3
+ --> $DIR/extra_arguments.rs:29:3
|
LL | two_arg_same(1, 1, "");
- | ^^^^^^^^^^^^ -- argument of type `&'static str` unexpected
+ | ^^^^^^^^^^^^ --------
+ | | |
+ | | unexpected argument of type `&'static str`
+ | help: remove the extra argument
|
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);
- | ~~~~~~
error[E0061]: this function takes 2 arguments but 3 arguments were supplied
- --> $DIR/extra_arguments.rs:23:3
+ --> $DIR/extra_arguments.rs:30:3
|
LL | two_arg_diff(1, 1, "");
- | ^^^^^^^^^^^^ - argument of type `{integer}` unexpected
+ | ^^^^^^^^^^^^ ---
+ | | |
+ | | unexpected argument of type `{integer}`
+ | help: remove the extra argument
|
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, "");
- | ~~~~~~~
error[E0061]: this function takes 2 arguments but 3 arguments were supplied
- --> $DIR/extra_arguments.rs:24:3
- |
-LL | two_arg_same(
- | ^^^^^^^^^^^^
-...
-LL | ""
- | -- argument of type `&'static str` unexpected
+ --> $DIR/extra_arguments.rs:31:3
+ |
+LL | two_arg_same(
+ | ^^^^^^^^^^^^
+LL | 1,
+LL | 1,
+ | ______-
+LL | | ""
+ | | --
+ | |_____||
+ | |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);
- | ~~~~~~
error[E0061]: this function takes 2 arguments but 3 arguments were supplied
- --> $DIR/extra_arguments.rs:30:3
- |
-LL | two_arg_diff(
- | ^^^^^^^^^^^^
-LL | 1,
-LL | 1,
- | - argument of type `{integer}` unexpected
+ --> $DIR/extra_arguments.rs:37:3
+ |
+LL | two_arg_diff(
+ | ^^^^^^^^^^^^
+LL | 1,
+ | ______-
+LL | | 1,
+ | | -
+ | | |
+ | |_____unexpected argument of type `{integer}`
+ | help: remove the extra argument
|
note: function defined here
--> $DIR/extra_arguments.rs:4:4
|
LL | fn two_arg_diff(_a: i32, _b: &str) {}
| ^^^^^^^^^^^^ ------- --------
-help: remove the extra argument
+
+error[E0061]: this function takes 0 arguments but 2 arguments were supplied
+ --> $DIR/extra_arguments.rs:8:9
+ |
+LL | empty($x, 1);
+ | ^^^^^ - unexpected argument of type `{integer}`
+...
+LL | foo!(1);
+ | -------
+ | | |
+ | | unexpected argument of type `{integer}`
+ | | help: remove the extra argument
+ | in this macro invocation
+ |
+note: function defined here
+ --> $DIR/extra_arguments.rs:1:4
|
-LL | two_arg_diff(1, "");
- | ~~~~~~~
+LL | fn empty() {}
+ | ^^^^^
+ = note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
-error: aborting due to 14 previous errors
+error: aborting due to 16 previous errors
For more information about this error, try `rustc --explain E0061`.
diff --git a/tests/ui/argument-suggestions/formal-and-expected-differ.stderr b/tests/ui/argument-suggestions/formal-and-expected-differ.stderr
index 905875b52..6076b7ccb 100644
--- a/tests/ui/argument-suggestions/formal-and-expected-differ.stderr
+++ b/tests/ui/argument-suggestions/formal-and-expected-differ.stderr
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
--> $DIR/formal-and-expected-differ.rs:22:29
|
LL | let _: U<_, u32> = U(1, S(3u32));
- | - ^^^^^^^ expected `f32`, found `u32`
+ | - ^^^^^^^ expected `S<f32>`, found `S<u32>`
| |
| arguments to this struct are incorrect
|
@@ -18,7 +18,7 @@ error[E0308]: mismatched types
--> $DIR/formal-and-expected-differ.rs:22:24
|
LL | let _: U<_, u32> = U(1, S(3u32));
- | --------- ^^^^^^^^^^^^^ expected `u32`, found `f32`
+ | --------- ^^^^^^^^^^^^^ expected `U<_, u32>`, found `U<i32, f32>`
| |
| expected due to this
|
diff --git a/tests/ui/argument-suggestions/invalid_arguments.stderr b/tests/ui/argument-suggestions/invalid_arguments.stderr
index 303f08695..d26f33d09 100644
--- a/tests/ui/argument-suggestions/invalid_arguments.stderr
+++ b/tests/ui/argument-suggestions/invalid_arguments.stderr
@@ -100,7 +100,7 @@ error[E0308]: mismatched types
--> $DIR/invalid_arguments.rs:24:18
|
LL | three_arg_diff(X{}, 1.0, "");
- | -------------- ^^^ expected `i32`, found struct `X`
+ | -------------- ^^^ expected `i32`, found `X`
| |
| arguments to this function are incorrect
|
@@ -114,7 +114,7 @@ error[E0308]: mismatched types
--> $DIR/invalid_arguments.rs:25:21
|
LL | three_arg_diff(1, X {}, "");
- | -------------- ^^^^ expected `f32`, found struct `X`
+ | -------------- ^^^^ expected `f32`, found `X`
| |
| arguments to this function are incorrect
|
@@ -128,7 +128,7 @@ error[E0308]: mismatched types
--> $DIR/invalid_arguments.rs:26:26
|
LL | three_arg_diff(1, 1.0, X {});
- | -------------- ^^^^ expected `&str`, found struct `X`
+ | -------------- ^^^^ expected `&str`, found `X`
| |
| arguments to this function are incorrect
|
@@ -142,9 +142,9 @@ error[E0308]: arguments to this function are incorrect
--> $DIR/invalid_arguments.rs:28:3
|
LL | three_arg_diff(X {}, X {}, "");
- | ^^^^^^^^^^^^^^ ---- ---- expected `f32`, found struct `X`
+ | ^^^^^^^^^^^^^^ ---- ---- expected `f32`, found `X`
| |
- | expected `i32`, found struct `X`
+ | expected `i32`, found `X`
|
note: function defined here
--> $DIR/invalid_arguments.rs:8:4
@@ -156,9 +156,9 @@ error[E0308]: arguments to this function are incorrect
--> $DIR/invalid_arguments.rs:29:3
|
LL | three_arg_diff(X {}, 1.0, X {});
- | ^^^^^^^^^^^^^^ ---- ---- expected `&str`, found struct `X`
+ | ^^^^^^^^^^^^^^ ---- ---- expected `&str`, found `X`
| |
- | expected `i32`, found struct `X`
+ | expected `i32`, found `X`
|
note: function defined here
--> $DIR/invalid_arguments.rs:8:4
@@ -170,9 +170,9 @@ error[E0308]: arguments to this function are incorrect
--> $DIR/invalid_arguments.rs:30:3
|
LL | three_arg_diff(1, X {}, X {});
- | ^^^^^^^^^^^^^^ ---- ---- expected `&str`, found struct `X`
+ | ^^^^^^^^^^^^^^ ---- ---- expected `&str`, found `X`
| |
- | expected `f32`, found struct `X`
+ | expected `f32`, found `X`
|
note: function defined here
--> $DIR/invalid_arguments.rs:8:4
@@ -184,10 +184,10 @@ error[E0308]: arguments to this function are incorrect
--> $DIR/invalid_arguments.rs:32:3
|
LL | three_arg_diff(X {}, X {}, X {});
- | ^^^^^^^^^^^^^^ ---- ---- ---- expected `&str`, found struct `X`
+ | ^^^^^^^^^^^^^^ ---- ---- ---- expected `&str`, found `X`
| | |
- | | expected `f32`, found struct `X`
- | expected `i32`, found struct `X`
+ | | expected `f32`, found `X`
+ | expected `i32`, found `X`
|
note: function defined here
--> $DIR/invalid_arguments.rs:8:4
@@ -199,7 +199,7 @@ error[E0308]: mismatched types
--> $DIR/invalid_arguments.rs:34:20
|
LL | three_arg_repeat(X {}, 1, "");
- | ---------------- ^^^^ expected `i32`, found struct `X`
+ | ---------------- ^^^^ expected `i32`, found `X`
| |
| arguments to this function are incorrect
|
@@ -213,7 +213,7 @@ error[E0308]: mismatched types
--> $DIR/invalid_arguments.rs:35:23
|
LL | three_arg_repeat(1, X {}, "");
- | ---------------- ^^^^ expected `i32`, found struct `X`
+ | ---------------- ^^^^ expected `i32`, found `X`
| |
| arguments to this function are incorrect
|
@@ -227,7 +227,7 @@ error[E0308]: mismatched types
--> $DIR/invalid_arguments.rs:36:26
|
LL | three_arg_repeat(1, 1, X {});
- | ---------------- ^^^^ expected `&str`, found struct `X`
+ | ---------------- ^^^^ expected `&str`, found `X`
| |
| arguments to this function are incorrect
|
@@ -241,9 +241,9 @@ error[E0308]: arguments to this function are incorrect
--> $DIR/invalid_arguments.rs:38:3
|
LL | three_arg_repeat(X {}, X {}, "");
- | ^^^^^^^^^^^^^^^^ ---- ---- expected `i32`, found struct `X`
+ | ^^^^^^^^^^^^^^^^ ---- ---- expected `i32`, found `X`
| |
- | expected `i32`, found struct `X`
+ | expected `i32`, found `X`
|
note: function defined here
--> $DIR/invalid_arguments.rs:9:4
@@ -255,9 +255,9 @@ error[E0308]: arguments to this function are incorrect
--> $DIR/invalid_arguments.rs:39:3
|
LL | three_arg_repeat(X {}, 1, X {});
- | ^^^^^^^^^^^^^^^^ ---- ---- expected `&str`, found struct `X`
+ | ^^^^^^^^^^^^^^^^ ---- ---- expected `&str`, found `X`
| |
- | expected `i32`, found struct `X`
+ | expected `i32`, found `X`
|
note: function defined here
--> $DIR/invalid_arguments.rs:9:4
@@ -269,9 +269,9 @@ error[E0308]: arguments to this function are incorrect
--> $DIR/invalid_arguments.rs:40:3
|
LL | three_arg_repeat(1, X {}, X{});
- | ^^^^^^^^^^^^^^^^ ---- --- expected `&str`, found struct `X`
+ | ^^^^^^^^^^^^^^^^ ---- --- expected `&str`, found `X`
| |
- | expected `i32`, found struct `X`
+ | expected `i32`, found `X`
|
note: function defined here
--> $DIR/invalid_arguments.rs:9:4
@@ -283,10 +283,10 @@ error[E0308]: arguments to this function are incorrect
--> $DIR/invalid_arguments.rs:42:3
|
LL | three_arg_repeat(X {}, X {}, X {});
- | ^^^^^^^^^^^^^^^^ ---- ---- ---- expected `&str`, found struct `X`
+ | ^^^^^^^^^^^^^^^^ ---- ---- ---- expected `&str`, found `X`
| | |
- | | expected `i32`, found struct `X`
- | expected `i32`, found struct `X`
+ | | expected `i32`, found `X`
+ | expected `i32`, found `X`
|
note: function defined here
--> $DIR/invalid_arguments.rs:9:4
diff --git a/tests/ui/argument-suggestions/issue-100154.stderr b/tests/ui/argument-suggestions/issue-100154.stderr
index 1499229c3..2504f616f 100644
--- a/tests/ui/argument-suggestions/issue-100154.stderr
+++ b/tests/ui/argument-suggestions/issue-100154.stderr
@@ -1,4 +1,4 @@
-error[E0107]: this function takes 0 generic arguments but 1 generic argument was supplied
+error[E0107]: function takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/issue-100154.rs:4:5
|
LL | foo::<()>(());
diff --git a/tests/ui/argument-suggestions/issue-100478.stderr b/tests/ui/argument-suggestions/issue-100478.stderr
index df02a312c..e4304988f 100644
--- a/tests/ui/argument-suggestions/issue-100478.stderr
+++ b/tests/ui/argument-suggestions/issue-100478.stderr
@@ -41,7 +41,7 @@ error[E0308]: arguments to this function are incorrect
--> $DIR/issue-100478.rs:36:5
|
LL | four_shuffle(T3::default(), T2::default(), T1::default(), T3::default());
- | ^^^^^^^^^^^^ ------------- ------------- ------------- expected struct `T4`, found struct `T3`
+ | ^^^^^^^^^^^^ ------------- ------------- ------------- expected `T4`, found `T3`
| | |
| | expected `T3`, found `T1`
| expected `T1`, found `T3`
diff --git a/tests/ui/argument-suggestions/issue-101097.stderr b/tests/ui/argument-suggestions/issue-101097.stderr
index 096f8c226..061f51014 100644
--- a/tests/ui/argument-suggestions/issue-101097.stderr
+++ b/tests/ui/argument-suggestions/issue-101097.stderr
@@ -4,7 +4,7 @@ error[E0061]: this function takes 6 arguments but 7 arguments were supplied
LL | f(C, A, A, A, B, B, C);
| ^ - - - - expected `C`, found `B`
| | | |
- | | | argument of type `A` unexpected
+ | | | unexpected argument of type `A`
| | expected `B`, found `A`
| expected `A`, found `C`
|
@@ -64,8 +64,8 @@ error[E0308]: arguments to this function are incorrect
LL | f(A, A, D, D, B, B);
| ^ - - ---- two arguments of type `C` and `C` are missing
| | |
- | | argument of type `D` unexpected
- | argument of type `D` unexpected
+ | | unexpected argument of type `D`
+ | unexpected argument of type `D`
|
note: function defined here
--> $DIR/issue-101097.rs:6:4
@@ -128,7 +128,7 @@ LL | f(C, C, A, B, A, A);
| ^ - - - - - expected `C`, found `A`
| | | | |
| | | | expected `C`, found `A`
- | | | expected struct `B`, found struct `A`
+ | | | expected `B`, found `A`
| | expected `A`, found `C`
| expected `A`, found `C`
|
diff --git a/tests/ui/argument-suggestions/issue-97484.stderr b/tests/ui/argument-suggestions/issue-97484.stderr
index caa50f14b..a86cbbf18 100644
--- a/tests/ui/argument-suggestions/issue-97484.stderr
+++ b/tests/ui/argument-suggestions/issue-97484.stderr
@@ -2,11 +2,11 @@ error[E0061]: this function takes 4 arguments but 7 arguments were supplied
--> $DIR/issue-97484.rs:12:5
|
LL | foo(&&A, B, C, D, E, F, G);
- | ^^^ - - - - argument of type `F` unexpected
+ | ^^^ - - - - unexpected argument of type `F`
| | | |
- | | | expected `&E`, found struct `E`
- | | argument of type `C` unexpected
- | argument of type `B` unexpected
+ | | | expected `&E`, found `E`
+ | | unexpected argument of type `C`
+ | unexpected argument of type `B`
|
note: function defined here
--> $DIR/issue-97484.rs:9:4
@@ -19,8 +19,9 @@ LL | foo(&&A, B, C, D, &E, F, G);
| ~~
help: remove the extra arguments
|
-LL | foo(&&A, D, /* &E */, G);
- | ~~~~~~~~~~~~~~~~~~~~~
+LL - foo(&&A, B, C, D, E, F, G);
+LL + foo(&&A, D, /* &E */, G);
+ |
error: aborting due to previous error
diff --git a/tests/ui/argument-suggestions/mixed_cases.stderr b/tests/ui/argument-suggestions/mixed_cases.stderr
index 8c525db1a..c645dd381 100644
--- a/tests/ui/argument-suggestions/mixed_cases.stderr
+++ b/tests/ui/argument-suggestions/mixed_cases.stderr
@@ -2,7 +2,7 @@ error[E0061]: this function takes 2 arguments but 3 arguments were supplied
--> $DIR/mixed_cases.rs:10:3
|
LL | two_args(1, "", X {});
- | ^^^^^^^^ -- ---- argument of type `X` unexpected
+ | ^^^^^^^^ -- ---- unexpected argument of type `X`
| |
| expected `f32`, found `&str`
|
@@ -13,16 +13,17 @@ LL | fn two_args(_a: i32, _b: f32) {}
| ^^^^^^^^ ------- -------
help: remove the extra argument
|
-LL | two_args(1, /* f32 */);
- | ~~~~~~~~~~~~~~
+LL - two_args(1, "", X {});
+LL + two_args(1, /* f32 */);
+ |
error[E0061]: this function takes 3 arguments but 4 arguments were supplied
--> $DIR/mixed_cases.rs:11:3
|
LL | three_args(1, "", X {}, "");
- | ^^^^^^^^^^ -- ---- -- argument of type `&'static str` unexpected
+ | ^^^^^^^^^^ -- ---- -- unexpected argument of type `&'static str`
| | |
- | | argument of type `X` unexpected
+ | | unexpected argument of type `X`
| an argument of type `f32` is missing
|
note: function defined here
@@ -41,7 +42,7 @@ error[E0061]: this function takes 3 arguments but 2 arguments were supplied
LL | three_args(1, X {});
| ^^^^^^^^^^---------
| | |
- | | expected `f32`, found struct `X`
+ | | expected `f32`, found `X`
| an argument of type `&str` is missing
|
note: function defined here
@@ -58,7 +59,7 @@ error[E0308]: arguments to this function are incorrect
--> $DIR/mixed_cases.rs:17:3
|
LL | three_args(1, "", X {});
- | ^^^^^^^^^^ -- ---- argument of type `X` unexpected
+ | ^^^^^^^^^^ -- ---- unexpected argument of type `X`
| |
| an argument of type `f32` is missing
|
@@ -78,7 +79,7 @@ error[E0308]: arguments to this function are incorrect
LL | three_args("", X {}, 1);
| ^^^^^^^^^^ -- ---- - expected `&str`, found `{integer}`
| | |
- | | expected `f32`, found struct `X`
+ | | expected `f32`, found `X`
| expected `i32`, found `&'static str`
|
note: function defined here
diff --git a/tests/ui/argument-suggestions/too-long.stderr b/tests/ui/argument-suggestions/too-long.stderr
index 492894329..bb6f06a35 100644
--- a/tests/ui/argument-suggestions/too-long.stderr
+++ b/tests/ui/argument-suggestions/too-long.stderr
@@ -6,7 +6,7 @@ LL | qux.foo(a, b, c, d, e, f, g, h, i, j, k, l);
| |
| arguments to this method are incorrect
|
-note: associated function defined here
+note: method defined here
--> $DIR/too-long.rs:4:8
|
LL | fn foo(
diff --git a/tests/ui/argument-suggestions/two-mismatch-notes.stderr b/tests/ui/argument-suggestions/two-mismatch-notes.stderr
index 7873cf964..38cf23ddc 100644
--- a/tests/ui/argument-suggestions/two-mismatch-notes.stderr
+++ b/tests/ui/argument-suggestions/two-mismatch-notes.stderr
@@ -4,14 +4,15 @@ error[E0308]: arguments to this function are incorrect
LL | foo(f, w);
| ^^^
|
-note: expected `i32`, found `u32`
+note: expected fn pointer, found fn item
--> $DIR/two-mismatch-notes.rs:10:9
|
LL | foo(f, w);
| ^
= note: expected fn pointer `fn(i32)`
found fn item `fn(u32) {f}`
-note: expected `i32`, found `isize`
+ = note: when the arguments and return types match, functions can be coerced to function pointers
+note: expected `Wrapper<i32>`, found `Wrapper<isize>`
--> $DIR/two-mismatch-notes.rs:10:12
|
LL | foo(f, w);