diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:18:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:18:58 +0000 |
commit | a4b7ed7a42c716ab9f05e351f003d589124fd55d (patch) | |
tree | b620cd3f223850b28716e474e80c58059dca5dd4 /src/test/ui/argument-suggestions | |
parent | Adding upstream version 1.67.1+dfsg1. (diff) | |
download | rustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.tar.xz rustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.zip |
Adding upstream version 1.68.2+dfsg1.upstream/1.68.2+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/argument-suggestions')
42 files changed, 0 insertions, 2213 deletions
diff --git a/src/test/ui/argument-suggestions/basic.rs b/src/test/ui/argument-suggestions/basic.rs deleted file mode 100644 index 3e96322d6..000000000 --- a/src/test/ui/argument-suggestions/basic.rs +++ /dev/null @@ -1,28 +0,0 @@ -// Some basic "obvious" cases for the heuristic error messages added for #65853 -// One for each of the detected cases - -enum E { X, Y } -enum F { X2, Y2 } -struct G {} -struct H {} -struct X {} -struct Y {} -struct Z {} - - -fn invalid(_i: u32) {} -fn extra() {} -fn missing(_i: u32) {} -fn swapped(_i: u32, _s: &str) {} -fn permuted(_x: X, _y: Y, _z: Z) {} - -fn main() { - invalid(1.0); //~ ERROR mismatched types - extra(""); //~ ERROR this function takes - missing(); //~ ERROR this function takes - swapped("", 1); //~ ERROR arguments to this function are incorrect - permuted(Y {}, Z {}, X {}); //~ ERROR arguments to this function are incorrect - - let closure = |x| x; - closure(); //~ ERROR this function takes -} diff --git a/src/test/ui/argument-suggestions/basic.stderr b/src/test/ui/argument-suggestions/basic.stderr deleted file mode 100644 index b118ce1bd..000000000 --- a/src/test/ui/argument-suggestions/basic.stderr +++ /dev/null @@ -1,103 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/basic.rs:20:13 - | -LL | invalid(1.0); - | ------- ^^^ expected `u32`, found floating-point number - | | - | arguments to this function are incorrect - | -note: function defined here - --> $DIR/basic.rs:13:4 - | -LL | fn invalid(_i: u32) {} - | ^^^^^^^ ------- - -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 - | -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 - | -LL | missing(); - | ^^^^^^^-- an argument of type `u32` is missing - | -note: function defined here - --> $DIR/basic.rs:15:4 - | -LL | fn missing(_i: u32) {} - | ^^^^^^^ ------- -help: provide the argument - | -LL | missing(/* u32 */); - | ~~~~~~~~~~~ - -error[E0308]: arguments to this function are incorrect - --> $DIR/basic.rs:23:5 - | -LL | swapped("", 1); - | ^^^^^^^ -- - expected `&str`, found `{integer}` - | | - | expected `u32`, found `&'static str` - | -note: function defined here - --> $DIR/basic.rs:16:4 - | -LL | fn swapped(_i: u32, _s: &str) {} - | ^^^^^^^ ------- -------- -help: swap these arguments - | -LL | swapped(1, ""); - | ~~~~~~~ - -error[E0308]: arguments to this function are incorrect - --> $DIR/basic.rs:24:5 - | -LL | permuted(Y {}, Z {}, X {}); - | ^^^^^^^^ ---- ---- ---- expected `Z`, found `X` - | | | - | | expected `Y`, found `Z` - | expected `X`, found `Y` - | -note: function defined here - --> $DIR/basic.rs:17:4 - | -LL | fn permuted(_x: X, _y: Y, _z: Z) {} - | ^^^^^^^^ ----- ----- ----- -help: reorder these arguments - | -LL | permuted(X {}, Y {}, Z {}); - | ~~~~~~~~~~~~~~~~~~ - -error[E0057]: this function takes 1 argument but 0 arguments were supplied - --> $DIR/basic.rs:27:5 - | -LL | closure(); - | ^^^^^^^-- an argument is missing - | -note: closure defined here - --> $DIR/basic.rs:26:19 - | -LL | let closure = |x| x; - | ^^^ -help: provide the argument - | -LL | closure(/* value */); - | ~~~~~~~~~~~~~ - -error: aborting due to 6 previous errors - -Some errors have detailed explanations: E0057, E0061, E0308. -For more information about an error, try `rustc --explain E0057`. diff --git a/src/test/ui/argument-suggestions/complex.rs b/src/test/ui/argument-suggestions/complex.rs deleted file mode 100644 index 384cdca7e..000000000 --- a/src/test/ui/argument-suggestions/complex.rs +++ /dev/null @@ -1,16 +0,0 @@ -// A complex case with mixed suggestions from #65853 - -enum E { X, Y } -enum F { X2, Y2 } -struct G {} -struct H {} -struct X {} -struct Y {} -struct Z {} - -fn complex(_i: u32, _s: &str, _e: E, _f: F, _g: G, _x: X, _y: Y, _z: Z ) {} - -fn main() { - complex(1.0, H {}, &"", G{}, F::X2, Z {}, X {}, Y {}); - //~^ ERROR arguments to this function are incorrect -} diff --git a/src/test/ui/argument-suggestions/complex.stderr b/src/test/ui/argument-suggestions/complex.stderr deleted file mode 100644 index 205a85298..000000000 --- a/src/test/ui/argument-suggestions/complex.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error[E0308]: arguments to this function are incorrect - --> $DIR/complex.rs:14:3 - | -LL | complex(1.0, H {}, &"", G{}, F::X2, Z {}, X {}, Y {}); - | ^^^^^^^ --- expected `u32`, found floating-point number - | -note: function defined here - --> $DIR/complex.rs:11:4 - | -LL | fn complex(_i: u32, _s: &str, _e: E, _f: F, _g: G, _x: X, _y: Y, _z: Z ) {} - | ^^^^^^^ ------- -------- ----- ----- ----- ----- ----- ----- -help: did you mean - | -LL | complex(/* u32 */, &"", /* E */, F::X2, G{}, X {}, Y {}, Z {}); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/argument-suggestions/exotic-calls.rs b/src/test/ui/argument-suggestions/exotic-calls.rs deleted file mode 100644 index a18e96766..000000000 --- a/src/test/ui/argument-suggestions/exotic-calls.rs +++ /dev/null @@ -1,26 +0,0 @@ -fn foo<T: Fn()>(t: T) { - t(1i32); - //~^ ERROR this function takes 0 arguments but 1 argument was supplied -} - -fn bar(t: impl Fn()) { - t(1i32); - //~^ ERROR this function takes 0 arguments but 1 argument was supplied -} - -fn baz() -> impl Fn() { - || {} -} - -fn baz2() { - baz()(1i32) - //~^ ERROR this function takes 0 arguments but 1 argument was supplied -} - -fn qux() { - let x = || {}; - x(1i32); - //~^ ERROR this function takes 0 arguments but 1 argument was supplied -} - -fn main() {} diff --git a/src/test/ui/argument-suggestions/exotic-calls.stderr b/src/test/ui/argument-suggestions/exotic-calls.stderr deleted file mode 100644 index 0580e53c5..000000000 --- a/src/test/ui/argument-suggestions/exotic-calls.stderr +++ /dev/null @@ -1,67 +0,0 @@ -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 - | -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 - | -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 - | -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 - | -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 - -For more information about this error, try `rustc --explain E0057`. diff --git a/src/test/ui/argument-suggestions/extra_arguments.rs b/src/test/ui/argument-suggestions/extra_arguments.rs deleted file mode 100644 index 3706ac4e8..000000000 --- a/src/test/ui/argument-suggestions/extra_arguments.rs +++ /dev/null @@ -1,35 +0,0 @@ -fn empty() {} -fn one_arg(_a: i32) {} -fn two_arg_same(_a: i32, _b: i32) {} -fn two_arg_diff(_a: i32, _b: &str) {} - -fn main() { - empty(""); //~ ERROR this function takes - - one_arg(1, 1); //~ ERROR this function takes - one_arg(1, ""); //~ ERROR this function takes - one_arg(1, "", 1.0); //~ ERROR this function takes - - two_arg_same(1, 1, 1); //~ ERROR this function takes - two_arg_same(1, 1, 1.0); //~ ERROR this function takes - - two_arg_diff(1, 1, ""); //~ ERROR this function takes - two_arg_diff(1, "", ""); //~ ERROR this function takes - two_arg_diff(1, 1, "", ""); //~ ERROR this function takes - two_arg_diff(1, "", 1, ""); //~ ERROR this function takes - - // Check with weird spacing and newlines - two_arg_same(1, 1, ""); //~ ERROR this function takes - two_arg_diff(1, 1, ""); //~ ERROR this function takes - two_arg_same( //~ ERROR this function takes - 1, - 1, - "" - ); - - two_arg_diff( //~ ERROR this function takes - 1, - 1, - "" - ); -} diff --git a/src/test/ui/argument-suggestions/extra_arguments.stderr b/src/test/ui/argument-suggestions/extra_arguments.stderr deleted file mode 100644 index 48787b0c3..000000000 --- a/src/test/ui/argument-suggestions/extra_arguments.stderr +++ /dev/null @@ -1,239 +0,0 @@ -error[E0061]: this function takes 0 arguments but 1 argument was supplied - --> $DIR/extra_arguments.rs:7:3 - | -LL | empty(""); - | ^^^^^ -- argument of type `&'static str` unexpected - | -note: function defined here - --> $DIR/extra_arguments.rs:1:4 - | -LL | fn empty() {} - | ^^^^^ -help: remove the extra argument - | -LL | empty(); - | ~~ - -error[E0061]: this function takes 1 argument but 2 arguments were supplied - --> $DIR/extra_arguments.rs:9:3 - | -LL | one_arg(1, 1); - | ^^^^^^^ - argument of type `{integer}` unexpected - | -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 - | -LL | one_arg(1, ""); - | ^^^^^^^ -- argument of type `&'static str` unexpected - | -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 - | -LL | one_arg(1, "", 1.0); - | ^^^^^^^ -- --- argument of type `{float}` unexpected - | | - | argument of type `&'static str` unexpected - | -note: function defined here - --> $DIR/extra_arguments.rs:2:4 - | -LL | fn one_arg(_a: i32) {} - | ^^^^^^^ ------- -help: remove the extra arguments - | -LL | one_arg(1); - | ~~~ - -error[E0061]: this function takes 2 arguments but 3 arguments were supplied - --> $DIR/extra_arguments.rs:13:3 - | -LL | two_arg_same(1, 1, 1); - | ^^^^^^^^^^^^ - argument of type `{integer}` unexpected - | -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 - | -LL | two_arg_same(1, 1, 1.0); - | ^^^^^^^^^^^^ --- argument of type `{float}` unexpected - | -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 - | -LL | two_arg_diff(1, 1, ""); - | ^^^^^^^^^^^^ - argument of type `{integer}` unexpected - | -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 - | -LL | two_arg_diff(1, "", ""); - | ^^^^^^^^^^^^ -- argument of type `&'static str` unexpected - | -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 - | -LL | two_arg_diff(1, 1, "", ""); - | ^^^^^^^^^^^^ - -- argument of type `&'static str` unexpected - | | - | argument of type `{integer}` unexpected - | -note: function defined here - --> $DIR/extra_arguments.rs:4:4 - | -LL | fn two_arg_diff(_a: i32, _b: &str) {} - | ^^^^^^^^^^^^ ------- -------- -help: remove the extra arguments - | -LL | two_arg_diff(1, ""); - | ~~~~~~~ - -error[E0061]: this function takes 2 arguments but 4 arguments were supplied - --> $DIR/extra_arguments.rs:19:3 - | -LL | two_arg_diff(1, "", 1, ""); - | ^^^^^^^^^^^^ - -- argument of type `&'static str` unexpected - | | - | argument of type `{integer}` unexpected - | -note: function defined here - --> $DIR/extra_arguments.rs:4:4 - | -LL | fn two_arg_diff(_a: i32, _b: &str) {} - | ^^^^^^^^^^^^ ------- -------- -help: remove the extra arguments - | -LL | two_arg_diff(1, ""); - | ~~~~~~~ - -error[E0061]: this function takes 2 arguments but 3 arguments were supplied - --> $DIR/extra_arguments.rs:22:3 - | -LL | two_arg_same(1, 1, ""); - | ^^^^^^^^^^^^ -- argument of type `&'static str` unexpected - | -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 - | -LL | two_arg_diff(1, 1, ""); - | ^^^^^^^^^^^^ - argument of type `{integer}` unexpected - | -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 - | -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 - | -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: aborting due to 14 previous errors - -For more information about this error, try `rustc --explain E0061`. diff --git a/src/test/ui/argument-suggestions/formal-and-expected-differ.rs b/src/test/ui/argument-suggestions/formal-and-expected-differ.rs deleted file mode 100644 index 5e3b55ca5..000000000 --- a/src/test/ui/argument-suggestions/formal-and-expected-differ.rs +++ /dev/null @@ -1,25 +0,0 @@ -pub trait Foo { - type T; -} - -impl Foo for i32 { - type T = f32; -} - -pub struct U<T1, T2>(T1, S<T2>) -where - T1: Foo<T = T2>; - -pub struct S<T>(T); - -fn main() { - // The error message here isn't great -- it has to do with the fact that the - // `expected_inputs_for_expected_output` deduced inputs differs from the inputs - // that we infer from the constraints of the signature. - // - // I am not really sure what the best way of presenting this error message is, - // since right now it just suggests changing `3u32` <=> `3f32` back and forth. - let _: U<_, u32> = U(1, S(3u32)); - //~^ ERROR mismatched types - //~| ERROR mismatched types -} diff --git a/src/test/ui/argument-suggestions/formal-and-expected-differ.stderr b/src/test/ui/argument-suggestions/formal-and-expected-differ.stderr deleted file mode 100644 index 905875b52..000000000 --- a/src/test/ui/argument-suggestions/formal-and-expected-differ.stderr +++ /dev/null @@ -1,30 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/formal-and-expected-differ.rs:22:29 - | -LL | let _: U<_, u32> = U(1, S(3u32)); - | - ^^^^^^^ expected `f32`, found `u32` - | | - | arguments to this struct are incorrect - | - = note: expected struct `S<f32>` - found struct `S<u32>` -note: tuple struct defined here - --> $DIR/formal-and-expected-differ.rs:9:12 - | -LL | pub struct U<T1, T2>(T1, S<T2>) - | ^ - -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 due to this - | - = note: expected struct `U<_, u32>` - found struct `U<i32, f32>` - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/argument-suggestions/invalid_arguments.rs b/src/test/ui/argument-suggestions/invalid_arguments.rs deleted file mode 100644 index 53fbdd4b5..000000000 --- a/src/test/ui/argument-suggestions/invalid_arguments.rs +++ /dev/null @@ -1,43 +0,0 @@ -// More nuanced test cases for invalid arguments #65853 - -struct X {} - -fn one_arg(_a: i32) {} -fn two_arg_same(_a: i32, _b: i32) {} -fn two_arg_diff(_a: i32, _b: f32) {} -fn three_arg_diff(_a: i32, _b: f32, _c: &str) {} -fn three_arg_repeat(_a: i32, _b: i32, _c: &str) {} - -fn main() { - // Providing an incorrect argument for a single parameter function - one_arg(1.0); //~ ERROR mismatched types - - // Providing one or two invalid arguments to a two parameter function - two_arg_same(1, ""); //~ ERROR mismatched types - two_arg_same("", 1); //~ ERROR mismatched types - two_arg_same("", ""); //~ ERROR arguments to this function are incorrect - two_arg_diff(1, ""); //~ ERROR mismatched types - two_arg_diff("", 1.0); //~ ERROR mismatched types - two_arg_diff("", ""); //~ ERROR arguments to this function are incorrect - - // Providing invalid arguments to a three parameter function - three_arg_diff(X{}, 1.0, ""); //~ ERROR mismatched types - three_arg_diff(1, X {}, ""); //~ ERROR mismatched types - three_arg_diff(1, 1.0, X {}); //~ ERROR mismatched types - - three_arg_diff(X {}, X {}, ""); //~ ERROR arguments to this function are incorrect - three_arg_diff(X {}, 1.0, X {}); //~ ERROR arguments to this function are incorrect - three_arg_diff(1, X {}, X {}); //~ ERROR arguments to this function are incorrect - - three_arg_diff(X {}, X {}, X {}); //~ ERROR arguments to this function are incorrect - - three_arg_repeat(X {}, 1, ""); //~ ERROR mismatched types - three_arg_repeat(1, X {}, ""); //~ ERROR mismatched types - three_arg_repeat(1, 1, X {}); //~ ERROR mismatched types - - three_arg_repeat(X {}, X {}, ""); //~ ERROR arguments to this function are incorrect - three_arg_repeat(X {}, 1, X {}); //~ ERROR arguments to this function are incorrect - three_arg_repeat(1, X {}, X{}); //~ ERROR arguments to this function are incorrect - - three_arg_repeat(X {}, X {}, X {}); //~ ERROR arguments to this function are incorrect -} diff --git a/src/test/ui/argument-suggestions/invalid_arguments.stderr b/src/test/ui/argument-suggestions/invalid_arguments.stderr deleted file mode 100644 index 303f08695..000000000 --- a/src/test/ui/argument-suggestions/invalid_arguments.stderr +++ /dev/null @@ -1,299 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/invalid_arguments.rs:13:11 - | -LL | one_arg(1.0); - | ------- ^^^ expected `i32`, found floating-point number - | | - | arguments to this function are incorrect - | -note: function defined here - --> $DIR/invalid_arguments.rs:5:4 - | -LL | fn one_arg(_a: i32) {} - | ^^^^^^^ ------- - -error[E0308]: mismatched types - --> $DIR/invalid_arguments.rs:16:19 - | -LL | two_arg_same(1, ""); - | ------------ ^^ expected `i32`, found `&str` - | | - | arguments to this function are incorrect - | -note: function defined here - --> $DIR/invalid_arguments.rs:6:4 - | -LL | fn two_arg_same(_a: i32, _b: i32) {} - | ^^^^^^^^^^^^ ------- - -error[E0308]: mismatched types - --> $DIR/invalid_arguments.rs:17:16 - | -LL | two_arg_same("", 1); - | ------------ ^^ expected `i32`, found `&str` - | | - | arguments to this function are incorrect - | -note: function defined here - --> $DIR/invalid_arguments.rs:6:4 - | -LL | fn two_arg_same(_a: i32, _b: i32) {} - | ^^^^^^^^^^^^ ------- - -error[E0308]: arguments to this function are incorrect - --> $DIR/invalid_arguments.rs:18:3 - | -LL | two_arg_same("", ""); - | ^^^^^^^^^^^^ -- -- expected `i32`, found `&str` - | | - | expected `i32`, found `&str` - | -note: function defined here - --> $DIR/invalid_arguments.rs:6:4 - | -LL | fn two_arg_same(_a: i32, _b: i32) {} - | ^^^^^^^^^^^^ ------- ------- - -error[E0308]: mismatched types - --> $DIR/invalid_arguments.rs:19:19 - | -LL | two_arg_diff(1, ""); - | ------------ ^^ expected `f32`, found `&str` - | | - | arguments to this function are incorrect - | -note: function defined here - --> $DIR/invalid_arguments.rs:7:4 - | -LL | fn two_arg_diff(_a: i32, _b: f32) {} - | ^^^^^^^^^^^^ ------- - -error[E0308]: mismatched types - --> $DIR/invalid_arguments.rs:20:16 - | -LL | two_arg_diff("", 1.0); - | ------------ ^^ expected `i32`, found `&str` - | | - | arguments to this function are incorrect - | -note: function defined here - --> $DIR/invalid_arguments.rs:7:4 - | -LL | fn two_arg_diff(_a: i32, _b: f32) {} - | ^^^^^^^^^^^^ ------- - -error[E0308]: arguments to this function are incorrect - --> $DIR/invalid_arguments.rs:21:3 - | -LL | two_arg_diff("", ""); - | ^^^^^^^^^^^^ -- -- expected `f32`, found `&str` - | | - | expected `i32`, found `&str` - | -note: function defined here - --> $DIR/invalid_arguments.rs:7:4 - | -LL | fn two_arg_diff(_a: i32, _b: f32) {} - | ^^^^^^^^^^^^ ------- ------- - -error[E0308]: mismatched types - --> $DIR/invalid_arguments.rs:24:18 - | -LL | three_arg_diff(X{}, 1.0, ""); - | -------------- ^^^ expected `i32`, found struct `X` - | | - | arguments to this function are incorrect - | -note: function defined here - --> $DIR/invalid_arguments.rs:8:4 - | -LL | fn three_arg_diff(_a: i32, _b: f32, _c: &str) {} - | ^^^^^^^^^^^^^^ ------- - -error[E0308]: mismatched types - --> $DIR/invalid_arguments.rs:25:21 - | -LL | three_arg_diff(1, X {}, ""); - | -------------- ^^^^ expected `f32`, found struct `X` - | | - | arguments to this function are incorrect - | -note: function defined here - --> $DIR/invalid_arguments.rs:8:4 - | -LL | fn three_arg_diff(_a: i32, _b: f32, _c: &str) {} - | ^^^^^^^^^^^^^^ ------- - -error[E0308]: mismatched types - --> $DIR/invalid_arguments.rs:26:26 - | -LL | three_arg_diff(1, 1.0, X {}); - | -------------- ^^^^ expected `&str`, found struct `X` - | | - | arguments to this function are incorrect - | -note: function defined here - --> $DIR/invalid_arguments.rs:8:4 - | -LL | fn three_arg_diff(_a: i32, _b: f32, _c: &str) {} - | ^^^^^^^^^^^^^^ -------- - -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 `i32`, found struct `X` - | -note: function defined here - --> $DIR/invalid_arguments.rs:8:4 - | -LL | fn three_arg_diff(_a: i32, _b: f32, _c: &str) {} - | ^^^^^^^^^^^^^^ ------- ------- -------- - -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 `i32`, found struct `X` - | -note: function defined here - --> $DIR/invalid_arguments.rs:8:4 - | -LL | fn three_arg_diff(_a: i32, _b: f32, _c: &str) {} - | ^^^^^^^^^^^^^^ ------- ------- -------- - -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 `f32`, found struct `X` - | -note: function defined here - --> $DIR/invalid_arguments.rs:8:4 - | -LL | fn three_arg_diff(_a: i32, _b: f32, _c: &str) {} - | ^^^^^^^^^^^^^^ ------- ------- -------- - -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 `f32`, found struct `X` - | expected `i32`, found struct `X` - | -note: function defined here - --> $DIR/invalid_arguments.rs:8:4 - | -LL | fn three_arg_diff(_a: i32, _b: f32, _c: &str) {} - | ^^^^^^^^^^^^^^ ------- ------- -------- - -error[E0308]: mismatched types - --> $DIR/invalid_arguments.rs:34:20 - | -LL | three_arg_repeat(X {}, 1, ""); - | ---------------- ^^^^ expected `i32`, found struct `X` - | | - | arguments to this function are incorrect - | -note: function defined here - --> $DIR/invalid_arguments.rs:9:4 - | -LL | fn three_arg_repeat(_a: i32, _b: i32, _c: &str) {} - | ^^^^^^^^^^^^^^^^ ------- - -error[E0308]: mismatched types - --> $DIR/invalid_arguments.rs:35:23 - | -LL | three_arg_repeat(1, X {}, ""); - | ---------------- ^^^^ expected `i32`, found struct `X` - | | - | arguments to this function are incorrect - | -note: function defined here - --> $DIR/invalid_arguments.rs:9:4 - | -LL | fn three_arg_repeat(_a: i32, _b: i32, _c: &str) {} - | ^^^^^^^^^^^^^^^^ ------- - -error[E0308]: mismatched types - --> $DIR/invalid_arguments.rs:36:26 - | -LL | three_arg_repeat(1, 1, X {}); - | ---------------- ^^^^ expected `&str`, found struct `X` - | | - | arguments to this function are incorrect - | -note: function defined here - --> $DIR/invalid_arguments.rs:9:4 - | -LL | fn three_arg_repeat(_a: i32, _b: i32, _c: &str) {} - | ^^^^^^^^^^^^^^^^ -------- - -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 struct `X` - | -note: function defined here - --> $DIR/invalid_arguments.rs:9:4 - | -LL | fn three_arg_repeat(_a: i32, _b: i32, _c: &str) {} - | ^^^^^^^^^^^^^^^^ ------- ------- -------- - -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 `i32`, found struct `X` - | -note: function defined here - --> $DIR/invalid_arguments.rs:9:4 - | -LL | fn three_arg_repeat(_a: i32, _b: i32, _c: &str) {} - | ^^^^^^^^^^^^^^^^ ------- ------- -------- - -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 `i32`, found struct `X` - | -note: function defined here - --> $DIR/invalid_arguments.rs:9:4 - | -LL | fn three_arg_repeat(_a: i32, _b: i32, _c: &str) {} - | ^^^^^^^^^^^^^^^^ ------- ------- -------- - -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 `i32`, found struct `X` - | expected `i32`, found struct `X` - | -note: function defined here - --> $DIR/invalid_arguments.rs:9:4 - | -LL | fn three_arg_repeat(_a: i32, _b: i32, _c: &str) {} - | ^^^^^^^^^^^^^^^^ ------- ------- -------- - -error: aborting due to 21 previous errors - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/argument-suggestions/issue-100154.rs b/src/test/ui/argument-suggestions/issue-100154.rs deleted file mode 100644 index 4446b4bc2..000000000 --- a/src/test/ui/argument-suggestions/issue-100154.rs +++ /dev/null @@ -1,7 +0,0 @@ -fn foo(i: impl std::fmt::Display) {} - -fn main() { - foo::<()>(()); - //~^ ERROR this function takes 0 generic arguments but 1 generic argument was supplied - //~| ERROR `()` doesn't implement `std::fmt::Display` -} diff --git a/src/test/ui/argument-suggestions/issue-100154.stderr b/src/test/ui/argument-suggestions/issue-100154.stderr deleted file mode 100644 index 1499229c3..000000000 --- a/src/test/ui/argument-suggestions/issue-100154.stderr +++ /dev/null @@ -1,35 +0,0 @@ -error[E0107]: this function takes 0 generic arguments but 1 generic argument was supplied - --> $DIR/issue-100154.rs:4:5 - | -LL | foo::<()>(()); - | ^^^------ help: remove these generics - | | - | expected 0 generic arguments - | -note: function defined here, with 0 generic parameters - --> $DIR/issue-100154.rs:1:4 - | -LL | fn foo(i: impl std::fmt::Display) {} - | ^^^ - = note: `impl Trait` cannot be explicitly specified as a generic argument - -error[E0277]: `()` doesn't implement `std::fmt::Display` - --> $DIR/issue-100154.rs:4:15 - | -LL | foo::<()>(()); - | --------- ^^ `()` cannot be formatted with the default formatter - | | - | required by a bound introduced by this call - | - = help: the trait `std::fmt::Display` is not implemented for `()` - = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead -note: required by a bound in `foo` - --> $DIR/issue-100154.rs:1:16 - | -LL | fn foo(i: impl std::fmt::Display) {} - | ^^^^^^^^^^^^^^^^^ required by this bound in `foo` - -error: aborting due to 2 previous errors - -Some errors have detailed explanations: E0107, E0277. -For more information about an error, try `rustc --explain E0107`. diff --git a/src/test/ui/argument-suggestions/issue-100478.rs b/src/test/ui/argument-suggestions/issue-100478.rs deleted file mode 100644 index 6bef6ad10..000000000 --- a/src/test/ui/argument-suggestions/issue-100478.rs +++ /dev/null @@ -1,52 +0,0 @@ -use std::sync::Arc; -macro_rules! GenT { - ($name:tt) => { - #[derive(Default, Debug)] - struct $name { - #[allow(unused)] - val: i32, - } - - impl $name { - #[allow(unused)] - fn new(val: i32) -> Self { - $name { val } - } - } - }; -} - -GenT!(T1); -GenT!(T2); -GenT!(T3); -GenT!(T4); -GenT!(T5); -GenT!(T6); -GenT!(T7); -GenT!(T8); - -#[allow(unused)] -fn foo(p1: T1, p2: Arc<T2>, p3: T3, p4: Arc<T4>, p5: T5, p6: T6, p7: T7, p8: Arc<T8>) {} -fn three_diff(_a: T1, _b: T2, _c: T3) {} -fn four_shuffle(_a: T1, _b: T2, _c: T3, _d: T4) {} - -fn main() { - three_diff(T2::new(0)); //~ ERROR this function takes - four_shuffle(T3::default(), T4::default(), T1::default(), T2::default()); //~ ERROR 35:5: 35:17: arguments to this function are incorrect [E0308] - four_shuffle(T3::default(), T2::default(), T1::default(), T3::default()); //~ ERROR 36:5: 36:17: arguments to this function are incorrect [E0308] - - let p1 = T1::new(0); - let p2 = Arc::new(T2::new(0)); - let p3 = T3::new(0); - let p4 = Arc::new(T4::new(1)); - let p5 = T5::new(0); - let p6 = T6::new(0); - let p7 = T7::new(0); - let p8 = Arc::default(); - - foo( - //~^ 47:5: 47:8: this function takes 8 arguments but 7 arguments were supplied [E0061] - p1, //p2, - p3, p4, p5, p6, p7, p8, - ); -} diff --git a/src/test/ui/argument-suggestions/issue-100478.stderr b/src/test/ui/argument-suggestions/issue-100478.stderr deleted file mode 100644 index df02a312c..000000000 --- a/src/test/ui/argument-suggestions/issue-100478.stderr +++ /dev/null @@ -1,81 +0,0 @@ -error[E0061]: this function takes 3 arguments but 1 argument was supplied - --> $DIR/issue-100478.rs:34:5 - | -LL | three_diff(T2::new(0)); - | ^^^^^^^^^^------------ - | || - | |an argument of type `T1` is missing - | an argument of type `T3` is missing - | -note: function defined here - --> $DIR/issue-100478.rs:30:4 - | -LL | fn three_diff(_a: T1, _b: T2, _c: T3) {} - | ^^^^^^^^^^ ------ ------ ------ -help: provide the arguments - | -LL | three_diff(/* T1 */, T2::new(0), /* T3 */); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -error[E0308]: arguments to this function are incorrect - --> $DIR/issue-100478.rs:35:5 - | -LL | four_shuffle(T3::default(), T4::default(), T1::default(), T2::default()); - | ^^^^^^^^^^^^ ------------- ------------- ------------- ------------- expected `T4`, found `T2` - | | | | - | | | expected `T3`, found `T1` - | | expected `T2`, found `T4` - | expected `T1`, found `T3` - | -note: function defined here - --> $DIR/issue-100478.rs:31:4 - | -LL | fn four_shuffle(_a: T1, _b: T2, _c: T3, _d: T4) {} - | ^^^^^^^^^^^^ ------ ------ ------ ------ -help: did you mean - | -LL | four_shuffle(T1::default(), T2::default(), T3::default(), T4::default()); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -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 `T3`, found `T1` - | expected `T1`, found `T3` - | -note: function defined here - --> $DIR/issue-100478.rs:31:4 - | -LL | fn four_shuffle(_a: T1, _b: T2, _c: T3, _d: T4) {} - | ^^^^^^^^^^^^ ------ ------ ------ ------ -help: swap these arguments - | -LL | four_shuffle(T1::default(), T2::default(), T3::default(), /* T4 */); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -error[E0061]: this function takes 8 arguments but 7 arguments were supplied - --> $DIR/issue-100478.rs:47:5 - | -LL | foo( - | ^^^ -... -LL | p3, p4, p5, p6, p7, p8, - | -- an argument of type `Arc<T2>` is missing - | -note: function defined here - --> $DIR/issue-100478.rs:29:4 - | -LL | fn foo(p1: T1, p2: Arc<T2>, p3: T3, p4: Arc<T4>, p5: T5, p6: T6, p7: T7, p8: Arc<T8>) {} - | ^^^ ------ ----------- ------ ----------- ------ ------ ------ ----------- -help: provide the argument - | -LL | foo(p1, /* Arc<T2> */, p3, p4, p5, p6, p7, p8); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -error: aborting due to 4 previous errors - -Some errors have detailed explanations: E0061, E0308. -For more information about an error, try `rustc --explain E0061`. diff --git a/src/test/ui/argument-suggestions/issue-101097.rs b/src/test/ui/argument-suggestions/issue-101097.rs deleted file mode 100644 index 7994d3cd9..000000000 --- a/src/test/ui/argument-suggestions/issue-101097.rs +++ /dev/null @@ -1,21 +0,0 @@ -struct A; -struct B; -struct C; -struct D; - -fn f( - a1: A, - a2: A, - b1: B, - b2: B, - c1: C, - c2: C, -) {} - -fn main() { - f(C, A, A, A, B, B, C); //~ ERROR this function takes 6 arguments but 7 arguments were supplied [E0061] - f(C, C, A, A, B, B); //~ ERROR arguments to this function are incorrect [E0308] - f(A, A, D, D, B, B); //~ arguments to this function are incorrect [E0308] - f(C, C, B, B, A, A); //~ arguments to this function are incorrect [E0308] - f(C, C, A, B, A, A); //~ arguments to this function are incorrect [E0308] -} diff --git a/src/test/ui/argument-suggestions/issue-101097.stderr b/src/test/ui/argument-suggestions/issue-101097.stderr deleted file mode 100644 index 096f8c226..000000000 --- a/src/test/ui/argument-suggestions/issue-101097.stderr +++ /dev/null @@ -1,160 +0,0 @@ -error[E0061]: this function takes 6 arguments but 7 arguments were supplied - --> $DIR/issue-101097.rs:16:5 - | -LL | f(C, A, A, A, B, B, C); - | ^ - - - - expected `C`, found `B` - | | | | - | | | argument of type `A` unexpected - | | expected `B`, found `A` - | expected `A`, found `C` - | -note: function defined here - --> $DIR/issue-101097.rs:6:4 - | -LL | fn f( - | ^ -LL | a1: A, - | ----- -LL | a2: A, - | ----- -LL | b1: B, - | ----- -LL | b2: B, - | ----- -LL | c1: C, - | ----- -LL | c2: C, - | ----- -help: did you mean - | -LL | f(A, A, B, B, C, C); - | ~~~~~~~~~~~~~~~~~~ - -error[E0308]: arguments to this function are incorrect - --> $DIR/issue-101097.rs:17:5 - | -LL | f(C, C, A, A, B, B); - | ^ - | -note: function defined here - --> $DIR/issue-101097.rs:6:4 - | -LL | fn f( - | ^ -LL | a1: A, - | ----- -LL | a2: A, - | ----- -LL | b1: B, - | ----- -LL | b2: B, - | ----- -LL | c1: C, - | ----- -LL | c2: C, - | ----- -help: did you mean - | -LL | f(A, A, B, B, C, C); - | ~~~~~~~~~~~~~~~~~~ - -error[E0308]: arguments to this function are incorrect - --> $DIR/issue-101097.rs:18:5 - | -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 - | -note: function defined here - --> $DIR/issue-101097.rs:6:4 - | -LL | fn f( - | ^ -LL | a1: A, - | ----- -LL | a2: A, - | ----- -LL | b1: B, - | ----- -LL | b2: B, - | ----- -LL | c1: C, - | ----- -LL | c2: C, - | ----- -help: did you mean - | -LL | f(A, A, B, B, /* C */, /* C */); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -error[E0308]: arguments to this function are incorrect - --> $DIR/issue-101097.rs:19:5 - | -LL | f(C, C, B, B, A, A); - | ^ - - - - expected `C`, found `A` - | | | | - | | | expected `C`, found `A` - | | expected `A`, found `C` - | expected `A`, found `C` - | -note: function defined here - --> $DIR/issue-101097.rs:6:4 - | -LL | fn f( - | ^ -LL | a1: A, - | ----- -LL | a2: A, - | ----- -LL | b1: B, - | ----- -LL | b2: B, - | ----- -LL | c1: C, - | ----- -LL | c2: C, - | ----- -help: did you mean - | -LL | f(A, A, B, B, C, C); - | ~~~~~~~~~~~~~~~~~~ - -error[E0308]: arguments to this function are incorrect - --> $DIR/issue-101097.rs:20:5 - | -LL | f(C, C, A, B, A, A); - | ^ - - - - - expected `C`, found `A` - | | | | | - | | | | expected `C`, found `A` - | | | expected struct `B`, found struct `A` - | | expected `A`, found `C` - | expected `A`, found `C` - | -note: function defined here - --> $DIR/issue-101097.rs:6:4 - | -LL | fn f( - | ^ -LL | a1: A, - | ----- -LL | a2: A, - | ----- -LL | b1: B, - | ----- -LL | b2: B, - | ----- -LL | c1: C, - | ----- -LL | c2: C, - | ----- -help: did you mean - | -LL | f(A, A, /* B */, B, C, C); - | ~~~~~~~~~~~~~~~~~~~~~~~~ - -error: aborting due to 5 previous errors - -Some errors have detailed explanations: E0061, E0308. -For more information about an error, try `rustc --explain E0061`. diff --git a/src/test/ui/argument-suggestions/issue-96638.rs b/src/test/ui/argument-suggestions/issue-96638.rs deleted file mode 100644 index 9c6e81ab8..000000000 --- a/src/test/ui/argument-suggestions/issue-96638.rs +++ /dev/null @@ -1,9 +0,0 @@ -fn f(_: usize, _: &usize, _: usize) {} - -fn arg<T>() -> T { todo!() } - -fn main() { - let x = arg(); // `x` must be inferred - // The reference on `&x` is important to reproduce the ICE - f(&x, ""); //~ ERROR this function takes 3 arguments but 2 arguments were supplied -} diff --git a/src/test/ui/argument-suggestions/issue-96638.stderr b/src/test/ui/argument-suggestions/issue-96638.stderr deleted file mode 100644 index 4d18b97c9..000000000 --- a/src/test/ui/argument-suggestions/issue-96638.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0061]: this function takes 3 arguments but 2 arguments were supplied - --> $DIR/issue-96638.rs:8:5 - | -LL | f(&x, ""); - | ^ -- -- expected `usize`, found `&str` - | | - | an argument of type `usize` is missing - | -note: function defined here - --> $DIR/issue-96638.rs:1:4 - | -LL | fn f(_: usize, _: &usize, _: usize) {} - | ^ -------- --------- -------- -help: provide the argument - | -LL | f(/* usize */, &x, /* usize */); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0061`. diff --git a/src/test/ui/argument-suggestions/issue-97197.rs b/src/test/ui/argument-suggestions/issue-97197.rs deleted file mode 100644 index 6f9f4293e..000000000 --- a/src/test/ui/argument-suggestions/issue-97197.rs +++ /dev/null @@ -1,6 +0,0 @@ -fn main() { - g((), ()); - //~^ ERROR this function takes 6 arguments but 2 arguments were supplied -} - -pub fn g(a1: (), a2: bool, a3: bool, a4: bool, a5: bool, a6: ()) -> () {} diff --git a/src/test/ui/argument-suggestions/issue-97197.stderr b/src/test/ui/argument-suggestions/issue-97197.stderr deleted file mode 100644 index de221ba1f..000000000 --- a/src/test/ui/argument-suggestions/issue-97197.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error[E0061]: this function takes 6 arguments but 2 arguments were supplied - --> $DIR/issue-97197.rs:2:5 - | -LL | g((), ()); - | ^-------- multiple arguments are missing - | -note: function defined here - --> $DIR/issue-97197.rs:6:8 - | -LL | pub fn g(a1: (), a2: bool, a3: bool, a4: bool, a5: bool, a6: ()) -> () {} - | ^ ------ -------- -------- -------- -------- ------ -help: provide the arguments - | -LL | g((), /* bool */, /* bool */, /* bool */, /* bool */, ()); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0061`. diff --git a/src/test/ui/argument-suggestions/issue-97484.rs b/src/test/ui/argument-suggestions/issue-97484.rs deleted file mode 100644 index bb383ab1f..000000000 --- a/src/test/ui/argument-suggestions/issue-97484.rs +++ /dev/null @@ -1,14 +0,0 @@ -struct A; -struct B; -struct C; -struct D; -struct E; -struct F; -struct G; - -fn foo(a: &A, d: D, e: &E, g: G) {} - -fn main() { - foo(&&A, B, C, D, E, F, G); - //~^ ERROR this function takes 4 arguments but 7 arguments were supplied -} diff --git a/src/test/ui/argument-suggestions/issue-97484.stderr b/src/test/ui/argument-suggestions/issue-97484.stderr deleted file mode 100644 index caa50f14b..000000000 --- a/src/test/ui/argument-suggestions/issue-97484.stderr +++ /dev/null @@ -1,27 +0,0 @@ -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 - | | | | - | | | expected `&E`, found struct `E` - | | argument of type `C` unexpected - | argument of type `B` unexpected - | -note: function defined here - --> $DIR/issue-97484.rs:9:4 - | -LL | fn foo(a: &A, d: D, e: &E, g: G) {} - | ^^^ ----- ---- ----- ---- -help: consider borrowing here - | -LL | foo(&&A, B, C, D, &E, F, G); - | ~~ -help: remove the extra arguments - | -LL | foo(&&A, D, /* &E */, G); - | ~~~~~~~~~~~~~~~~~~~~~ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0061`. diff --git a/src/test/ui/argument-suggestions/issue-98894.rs b/src/test/ui/argument-suggestions/issue-98894.rs deleted file mode 100644 index c2618a967..000000000 --- a/src/test/ui/argument-suggestions/issue-98894.rs +++ /dev/null @@ -1,4 +0,0 @@ -fn main() { - (|_, ()| ())(if true {} else {return;}); - //~^ ERROR this function takes 2 arguments but 1 argument was supplied -} diff --git a/src/test/ui/argument-suggestions/issue-98894.stderr b/src/test/ui/argument-suggestions/issue-98894.stderr deleted file mode 100644 index f64a83ab7..000000000 --- a/src/test/ui/argument-suggestions/issue-98894.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error[E0057]: this function takes 2 arguments but 1 argument was supplied - --> $DIR/issue-98894.rs:2:5 - | -LL | (|_, ()| ())(if true {} else {return;}); - | ^^^^^^^^^^^^--------------------------- an argument of type `()` is missing - | -note: closure defined here - --> $DIR/issue-98894.rs:2:6 - | -LL | (|_, ()| ())(if true {} else {return;}); - | ^^^^^^^ -help: provide the argument - | -LL | (|_, ()| ())(if true {} else {return;}, ()); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0057`. diff --git a/src/test/ui/argument-suggestions/issue-98897.rs b/src/test/ui/argument-suggestions/issue-98897.rs deleted file mode 100644 index c55f495d6..000000000 --- a/src/test/ui/argument-suggestions/issue-98897.rs +++ /dev/null @@ -1,4 +0,0 @@ -fn main() { - (|_, ()| ())([return, ()]); - //~^ ERROR this function takes 2 arguments but 1 argument was supplied -} diff --git a/src/test/ui/argument-suggestions/issue-98897.stderr b/src/test/ui/argument-suggestions/issue-98897.stderr deleted file mode 100644 index f2c47d353..000000000 --- a/src/test/ui/argument-suggestions/issue-98897.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error[E0057]: this function takes 2 arguments but 1 argument was supplied - --> $DIR/issue-98897.rs:2:5 - | -LL | (|_, ()| ())([return, ()]); - | ^^^^^^^^^^^^-------------- an argument of type `()` is missing - | -note: closure defined here - --> $DIR/issue-98897.rs:2:6 - | -LL | (|_, ()| ())([return, ()]); - | ^^^^^^^ -help: provide the argument - | -LL | (|_, ()| ())([return, ()], ()); - | ~~~~~~~~~~~~~~~~~~ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0057`. diff --git a/src/test/ui/argument-suggestions/issue-99482.rs b/src/test/ui/argument-suggestions/issue-99482.rs deleted file mode 100644 index 731b86306..000000000 --- a/src/test/ui/argument-suggestions/issue-99482.rs +++ /dev/null @@ -1,5 +0,0 @@ -fn main() { - let f = |_: (), f: fn()| f; - let _f = f(main); - //~^ ERROR this function takes 2 arguments but 1 argument was supplied -} diff --git a/src/test/ui/argument-suggestions/issue-99482.stderr b/src/test/ui/argument-suggestions/issue-99482.stderr deleted file mode 100644 index bcf36e37c..000000000 --- a/src/test/ui/argument-suggestions/issue-99482.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error[E0057]: this function takes 2 arguments but 1 argument was supplied - --> $DIR/issue-99482.rs:3:14 - | -LL | let _f = f(main); - | ^ ---- an argument of type `()` is missing - | -note: closure defined here - --> $DIR/issue-99482.rs:2:13 - | -LL | let f = |_: (), f: fn()| f; - | ^^^^^^^^^^^^^^^^ -help: provide the argument - | -LL | let _f = f((), main); - | ~~~~~~~~~~ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0057`. diff --git a/src/test/ui/argument-suggestions/missing_arguments.rs b/src/test/ui/argument-suggestions/missing_arguments.rs deleted file mode 100644 index ae0dabf27..000000000 --- a/src/test/ui/argument-suggestions/missing_arguments.rs +++ /dev/null @@ -1,40 +0,0 @@ -fn one_arg(_a: i32) {} -fn two_same(_a: i32, _b: i32) {} -fn two_diff(_a: i32, _b: f32) {} -fn three_same(_a: i32, _b: i32, _c: i32) {} -fn three_diff(_a: i32, _b: f32, _c: &str) {} -fn four_repeated(_a: i32, _b: f32, _c: f32, _d: &str) {} -fn complex(_a: i32, _b: f32, _c: i32, _d: f32, _e: &str) {} - -fn main() { - one_arg(); //~ ERROR this function takes - // The headers here show the types expected, - // with formatting to emphasize which arguments are missing - /* i32 f32 */ - two_same( ); //~ ERROR this function takes - two_same( 1 ); //~ ERROR this function takes - two_diff( ); //~ ERROR this function takes - two_diff( 1 ); //~ ERROR this function takes - two_diff( 1.0 ); //~ ERROR this function takes - - /* i32 i32 i32 */ - three_same( ); //~ ERROR this function takes - three_same( 1 ); //~ ERROR this function takes - three_same( 1, 1 ); //~ ERROR this function takes - - /* i32 f32 &str */ - three_diff( 1.0, "" ); //~ ERROR this function takes - three_diff( 1, "" ); //~ ERROR this function takes - three_diff( 1, 1.0 ); //~ ERROR this function takes - three_diff( "" ); //~ ERROR this function takes - three_diff( 1.0 ); //~ ERROR this function takes - three_diff( 1 ); //~ ERROR this function takes - - /* i32 f32 f32 &str */ - four_repeated( ); //~ ERROR this function takes - four_repeated( 1, "" ); //~ ERROR this function takes - - /* i32 f32 i32 f32 &str */ - complex( ); //~ ERROR this function takes - complex( 1, "" ); //~ ERROR this function takes -} diff --git a/src/test/ui/argument-suggestions/missing_arguments.stderr b/src/test/ui/argument-suggestions/missing_arguments.stderr deleted file mode 100644 index ba9ece040..000000000 --- a/src/test/ui/argument-suggestions/missing_arguments.stderr +++ /dev/null @@ -1,310 +0,0 @@ -error[E0061]: this function takes 1 argument but 0 arguments were supplied - --> $DIR/missing_arguments.rs:10:3 - | -LL | one_arg(); - | ^^^^^^^-- an argument of type `i32` is missing - | -note: function defined here - --> $DIR/missing_arguments.rs:1:4 - | -LL | fn one_arg(_a: i32) {} - | ^^^^^^^ ------- -help: provide the argument - | -LL | one_arg(/* i32 */); - | ~~~~~~~~~~~ - -error[E0061]: this function takes 2 arguments but 0 arguments were supplied - --> $DIR/missing_arguments.rs:14:3 - | -LL | two_same( ); - | ^^^^^^^^----------------- two arguments of type `i32` and `i32` are missing - | -note: function defined here - --> $DIR/missing_arguments.rs:2:4 - | -LL | fn two_same(_a: i32, _b: i32) {} - | ^^^^^^^^ ------- ------- -help: provide the arguments - | -LL | two_same(/* i32 */, /* i32 */); - | ~~~~~~~~~~~~~~~~~~~~~~ - -error[E0061]: this function takes 2 arguments but 1 argument was supplied - --> $DIR/missing_arguments.rs:15:3 - | -LL | two_same( 1 ); - | ^^^^^^^^----------------- an argument of type `i32` is missing - | -note: function defined here - --> $DIR/missing_arguments.rs:2:4 - | -LL | fn two_same(_a: i32, _b: i32) {} - | ^^^^^^^^ ------- ------- -help: provide the argument - | -LL | two_same(1, /* i32 */); - | ~~~~~~~~~~~~~~ - -error[E0061]: this function takes 2 arguments but 0 arguments were supplied - --> $DIR/missing_arguments.rs:16:3 - | -LL | two_diff( ); - | ^^^^^^^^----------------- two arguments of type `i32` and `f32` are missing - | -note: function defined here - --> $DIR/missing_arguments.rs:3:4 - | -LL | fn two_diff(_a: i32, _b: f32) {} - | ^^^^^^^^ ------- ------- -help: provide the arguments - | -LL | two_diff(/* i32 */, /* f32 */); - | ~~~~~~~~~~~~~~~~~~~~~~ - -error[E0061]: this function takes 2 arguments but 1 argument was supplied - --> $DIR/missing_arguments.rs:17:3 - | -LL | two_diff( 1 ); - | ^^^^^^^^----------------- an argument of type `f32` is missing - | -note: function defined here - --> $DIR/missing_arguments.rs:3:4 - | -LL | fn two_diff(_a: i32, _b: f32) {} - | ^^^^^^^^ ------- ------- -help: provide the argument - | -LL | two_diff(1, /* f32 */); - | ~~~~~~~~~~~~~~ - -error[E0061]: this function takes 2 arguments but 1 argument was supplied - --> $DIR/missing_arguments.rs:18:3 - | -LL | two_diff( 1.0 ); - | ^^^^^^^^ --- an argument of type `i32` is missing - | -note: function defined here - --> $DIR/missing_arguments.rs:3:4 - | -LL | fn two_diff(_a: i32, _b: f32) {} - | ^^^^^^^^ ------- ------- -help: provide the argument - | -LL | two_diff(/* i32 */, 1.0); - | ~~~~~~~~~~~~~~~~ - -error[E0061]: this function takes 3 arguments but 0 arguments were supplied - --> $DIR/missing_arguments.rs:21:3 - | -LL | three_same( ); - | ^^^^^^^^^^------------------------- three arguments of type `i32`, `i32`, and `i32` are missing - | -note: function defined here - --> $DIR/missing_arguments.rs:4:4 - | -LL | fn three_same(_a: i32, _b: i32, _c: i32) {} - | ^^^^^^^^^^ ------- ------- ------- -help: provide the arguments - | -LL | three_same(/* i32 */, /* i32 */, /* i32 */); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -error[E0061]: this function takes 3 arguments but 1 argument was supplied - --> $DIR/missing_arguments.rs:22:3 - | -LL | three_same( 1 ); - | ^^^^^^^^^^------------------------- two arguments of type `i32` and `i32` are missing - | -note: function defined here - --> $DIR/missing_arguments.rs:4:4 - | -LL | fn three_same(_a: i32, _b: i32, _c: i32) {} - | ^^^^^^^^^^ ------- ------- ------- -help: provide the arguments - | -LL | three_same(1, /* i32 */, /* i32 */); - | ~~~~~~~~~~~~~~~~~~~~~~~~~ - -error[E0061]: this function takes 3 arguments but 2 arguments were supplied - --> $DIR/missing_arguments.rs:23:3 - | -LL | three_same( 1, 1 ); - | ^^^^^^^^^^------------------------- an argument of type `i32` is missing - | -note: function defined here - --> $DIR/missing_arguments.rs:4:4 - | -LL | fn three_same(_a: i32, _b: i32, _c: i32) {} - | ^^^^^^^^^^ ------- ------- ------- -help: provide the argument - | -LL | three_same(1, 1, /* i32 */); - | ~~~~~~~~~~~~~~~~~ - -error[E0061]: this function takes 3 arguments but 2 arguments were supplied - --> $DIR/missing_arguments.rs:26:3 - | -LL | three_diff( 1.0, "" ); - | ^^^^^^^^^^ --- an argument of type `i32` is missing - | -note: function defined here - --> $DIR/missing_arguments.rs:5:4 - | -LL | fn three_diff(_a: i32, _b: f32, _c: &str) {} - | ^^^^^^^^^^ ------- ------- -------- -help: provide the argument - | -LL | three_diff(/* i32 */, 1.0, ""); - | ~~~~~~~~~~~~~~~~~~~~ - -error[E0061]: this function takes 3 arguments but 2 arguments were supplied - --> $DIR/missing_arguments.rs:27:3 - | -LL | three_diff( 1, "" ); - | ^^^^^^^^^^ -- an argument of type `f32` is missing - | -note: function defined here - --> $DIR/missing_arguments.rs:5:4 - | -LL | fn three_diff(_a: i32, _b: f32, _c: &str) {} - | ^^^^^^^^^^ ------- ------- -------- -help: provide the argument - | -LL | three_diff(1, /* f32 */, ""); - | ~~~~~~~~~~~~~~~~~~ - -error[E0061]: this function takes 3 arguments but 2 arguments were supplied - --> $DIR/missing_arguments.rs:28:3 - | -LL | three_diff( 1, 1.0 ); - | ^^^^^^^^^^------------------------- an argument of type `&str` is missing - | -note: function defined here - --> $DIR/missing_arguments.rs:5:4 - | -LL | fn three_diff(_a: i32, _b: f32, _c: &str) {} - | ^^^^^^^^^^ ------- ------- -------- -help: provide the argument - | -LL | three_diff(1, 1.0, /* &str */); - | ~~~~~~~~~~~~~~~~~~~~ - -error[E0061]: this function takes 3 arguments but 1 argument was supplied - --> $DIR/missing_arguments.rs:29:3 - | -LL | three_diff( "" ); - | ^^^^^^^^^^------------------------- two arguments of type `i32` and `f32` are missing - | -note: function defined here - --> $DIR/missing_arguments.rs:5:4 - | -LL | fn three_diff(_a: i32, _b: f32, _c: &str) {} - | ^^^^^^^^^^ ------- ------- -------- -help: provide the arguments - | -LL | three_diff(/* i32 */, /* f32 */, ""); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~ - -error[E0061]: this function takes 3 arguments but 1 argument was supplied - --> $DIR/missing_arguments.rs:30:3 - | -LL | three_diff( 1.0 ); - | ^^^^^^^^^^------------------------- - | | | - | | an argument of type `i32` is missing - | an argument of type `&str` is missing - | -note: function defined here - --> $DIR/missing_arguments.rs:5:4 - | -LL | fn three_diff(_a: i32, _b: f32, _c: &str) {} - | ^^^^^^^^^^ ------- ------- -------- -help: provide the arguments - | -LL | three_diff(/* i32 */, 1.0, /* &str */); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -error[E0061]: this function takes 3 arguments but 1 argument was supplied - --> $DIR/missing_arguments.rs:31:3 - | -LL | three_diff( 1 ); - | ^^^^^^^^^^------------------------- two arguments of type `f32` and `&str` are missing - | -note: function defined here - --> $DIR/missing_arguments.rs:5:4 - | -LL | fn three_diff(_a: i32, _b: f32, _c: &str) {} - | ^^^^^^^^^^ ------- ------- -------- -help: provide the arguments - | -LL | three_diff(1, /* f32 */, /* &str */); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~ - -error[E0061]: this function takes 4 arguments but 0 arguments were supplied - --> $DIR/missing_arguments.rs:34:3 - | -LL | four_repeated( ); - | ^^^^^^^^^^^^^--------------------------------- multiple arguments are missing - | -note: function defined here - --> $DIR/missing_arguments.rs:6:4 - | -LL | fn four_repeated(_a: i32, _b: f32, _c: f32, _d: &str) {} - | ^^^^^^^^^^^^^ ------- ------- ------- -------- -help: provide the arguments - | -LL | four_repeated(/* i32 */, /* f32 */, /* f32 */, /* &str */); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -error[E0061]: this function takes 4 arguments but 2 arguments were supplied - --> $DIR/missing_arguments.rs:35:3 - | -LL | four_repeated( 1, "" ); - | ^^^^^^^^^^^^^--------------------------------- two arguments of type `f32` and `f32` are missing - | -note: function defined here - --> $DIR/missing_arguments.rs:6:4 - | -LL | fn four_repeated(_a: i32, _b: f32, _c: f32, _d: &str) {} - | ^^^^^^^^^^^^^ ------- ------- ------- -------- -help: provide the arguments - | -LL | four_repeated(1, /* f32 */, /* f32 */, ""); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -error[E0061]: this function takes 5 arguments but 0 arguments were supplied - --> $DIR/missing_arguments.rs:38:3 - | -LL | complex( ); - | ^^^^^^^--------------------------------- multiple arguments are missing - | -note: function defined here - --> $DIR/missing_arguments.rs:7:4 - | -LL | fn complex(_a: i32, _b: f32, _c: i32, _d: f32, _e: &str) {} - | ^^^^^^^ ------- ------- ------- ------- -------- -help: provide the arguments - | -LL | complex(/* i32 */, /* f32 */, /* i32 */, /* f32 */, /* &str */); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -error[E0061]: this function takes 5 arguments but 2 arguments were supplied - --> $DIR/missing_arguments.rs:39:3 - | -LL | complex( 1, "" ); - | ^^^^^^^--------------------------------- three arguments of type `f32`, `i32`, and `f32` are missing - | -note: function defined here - --> $DIR/missing_arguments.rs:7:4 - | -LL | fn complex(_a: i32, _b: f32, _c: i32, _d: f32, _e: &str) {} - | ^^^^^^^ ------- ------- ------- ------- -------- -help: provide the arguments - | -LL | complex(1, /* f32 */, /* i32 */, /* f32 */, ""); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -error: aborting due to 19 previous errors - -For more information about this error, try `rustc --explain E0061`. diff --git a/src/test/ui/argument-suggestions/mixed_cases.rs b/src/test/ui/argument-suggestions/mixed_cases.rs deleted file mode 100644 index 73678482b..000000000 --- a/src/test/ui/argument-suggestions/mixed_cases.rs +++ /dev/null @@ -1,24 +0,0 @@ -// Cases where multiple argument suggestions are mixed - -struct X {} - -fn two_args(_a: i32, _b: f32) {} -fn three_args(_a: i32, _b: f32, _c: &str) {} - -fn main() { - // Extra + Invalid - two_args(1, "", X {}); //~ ERROR this function takes - three_args(1, "", X {}, ""); //~ ERROR this function takes - - // Missing and Invalid - three_args(1, X {}); //~ ERROR this function takes - - // Missing and Extra - three_args(1, "", X {}); //~ ERROR arguments to this function are incorrect - - // Swapped and Invalid - three_args("", X {}, 1); //~ ERROR arguments to this function are incorrect - - // Swapped and missing - three_args("", 1); //~ ERROR this function takes -} diff --git a/src/test/ui/argument-suggestions/mixed_cases.stderr b/src/test/ui/argument-suggestions/mixed_cases.stderr deleted file mode 100644 index 8c525db1a..000000000 --- a/src/test/ui/argument-suggestions/mixed_cases.stderr +++ /dev/null @@ -1,117 +0,0 @@ -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 - | | - | expected `f32`, found `&str` - | -note: function defined here - --> $DIR/mixed_cases.rs:5:4 - | -LL | fn two_args(_a: i32, _b: f32) {} - | ^^^^^^^^ ------- ------- -help: remove the extra argument - | -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 - | | | - | | argument of type `X` unexpected - | an argument of type `f32` is missing - | -note: function defined here - --> $DIR/mixed_cases.rs:6:4 - | -LL | fn three_args(_a: i32, _b: f32, _c: &str) {} - | ^^^^^^^^^^ ------- ------- -------- -help: did you mean - | -LL | three_args(1, /* f32 */, ""); - | ~~~~~~~~~~~~~~~~~~ - -error[E0061]: this function takes 3 arguments but 2 arguments were supplied - --> $DIR/mixed_cases.rs:14:3 - | -LL | three_args(1, X {}); - | ^^^^^^^^^^--------- - | | | - | | expected `f32`, found struct `X` - | an argument of type `&str` is missing - | -note: function defined here - --> $DIR/mixed_cases.rs:6:4 - | -LL | fn three_args(_a: i32, _b: f32, _c: &str) {} - | ^^^^^^^^^^ ------- ------- -------- -help: provide the argument - | -LL | three_args(1, /* f32 */, /* &str */); - | ~~~~~~~~~~~~~~~~~~~~~~~~~~ - -error[E0308]: arguments to this function are incorrect - --> $DIR/mixed_cases.rs:17:3 - | -LL | three_args(1, "", X {}); - | ^^^^^^^^^^ -- ---- argument of type `X` unexpected - | | - | an argument of type `f32` is missing - | -note: function defined here - --> $DIR/mixed_cases.rs:6:4 - | -LL | fn three_args(_a: i32, _b: f32, _c: &str) {} - | ^^^^^^^^^^ ------- ------- -------- -help: did you mean - | -LL | three_args(1, /* f32 */, ""); - | ~~~~~~~~~~~~~~~~~~ - -error[E0308]: arguments to this function are incorrect - --> $DIR/mixed_cases.rs:20:3 - | -LL | three_args("", X {}, 1); - | ^^^^^^^^^^ -- ---- - expected `&str`, found `{integer}` - | | | - | | expected `f32`, found struct `X` - | expected `i32`, found `&'static str` - | -note: function defined here - --> $DIR/mixed_cases.rs:6:4 - | -LL | fn three_args(_a: i32, _b: f32, _c: &str) {} - | ^^^^^^^^^^ ------- ------- -------- -help: swap these arguments - | -LL | three_args(1, /* f32 */, ""); - | ~~~~~~~~~~~~~~~~~~ - -error[E0061]: this function takes 3 arguments but 2 arguments were supplied - --> $DIR/mixed_cases.rs:23:3 - | -LL | three_args("", 1); - | ^^^^^^^^^^ -- - - | | | - | | an argument of type `f32` is missing - | | expected `&str`, found `{integer}` - | expected `i32`, found `&'static str` - | -note: function defined here - --> $DIR/mixed_cases.rs:6:4 - | -LL | fn three_args(_a: i32, _b: f32, _c: &str) {} - | ^^^^^^^^^^ ------- ------- -------- -help: did you mean - | -LL | three_args(1, /* f32 */, ""); - | ~~~~~~~~~~~~~~~~~~ - -error: aborting due to 6 previous errors - -Some errors have detailed explanations: E0061, E0308. -For more information about an error, try `rustc --explain E0061`. diff --git a/src/test/ui/argument-suggestions/permuted_arguments.rs b/src/test/ui/argument-suggestions/permuted_arguments.rs deleted file mode 100644 index f512fde65..000000000 --- a/src/test/ui/argument-suggestions/permuted_arguments.rs +++ /dev/null @@ -1,13 +0,0 @@ -// More complicated permutations -struct X {} -struct Y {} - -fn three_args(_a: i32, _b: f32, _c: &str) {} -fn many_args(_a: i32, _b: f32, _c: &str, _d: X, _e: Y) {} - -fn main() { - // b, c, a - three_args(1.0, "", 1); //~ ERROR arguments to this function are incorrect - // d, e, b, a, c - many_args(X {}, Y {}, 1, 1.0, ""); //~ ERROR arguments to this function are incorrect -} diff --git a/src/test/ui/argument-suggestions/permuted_arguments.stderr b/src/test/ui/argument-suggestions/permuted_arguments.stderr deleted file mode 100644 index 655807a7f..000000000 --- a/src/test/ui/argument-suggestions/permuted_arguments.stderr +++ /dev/null @@ -1,43 +0,0 @@ -error[E0308]: arguments to this function are incorrect - --> $DIR/permuted_arguments.rs:10:3 - | -LL | three_args(1.0, "", 1); - | ^^^^^^^^^^ --- -- - expected `&str`, found `{integer}` - | | | - | | expected `f32`, found `&'static str` - | expected `i32`, found `{float}` - | -note: function defined here - --> $DIR/permuted_arguments.rs:5:4 - | -LL | fn three_args(_a: i32, _b: f32, _c: &str) {} - | ^^^^^^^^^^ ------- ------- -------- -help: reorder these arguments - | -LL | three_args(1, 1.0, ""); - | ~~~~~~~~~~~~ - -error[E0308]: arguments to this function are incorrect - --> $DIR/permuted_arguments.rs:12:3 - | -LL | many_args(X {}, Y {}, 1, 1.0, ""); - | ^^^^^^^^^ ---- ---- - --- -- expected `Y`, found `&'static str` - | | | | | - | | | | expected `X`, found `{float}` - | | | expected `&str`, found `{integer}` - | | expected `f32`, found `Y` - | expected `i32`, found `X` - | -note: function defined here - --> $DIR/permuted_arguments.rs:6:4 - | -LL | fn many_args(_a: i32, _b: f32, _c: &str, _d: X, _e: Y) {} - | ^^^^^^^^^ ------- ------- -------- ----- ----- -help: reorder these arguments - | -LL | many_args(1, 1.0, "", X {}, Y {}); - | ~~~~~~~~~~~~~~~~~~~~~~~~ - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/argument-suggestions/swapped_arguments.rs b/src/test/ui/argument-suggestions/swapped_arguments.rs deleted file mode 100644 index a21de610c..000000000 --- a/src/test/ui/argument-suggestions/swapped_arguments.rs +++ /dev/null @@ -1,14 +0,0 @@ -struct X {} - -fn two_args(_a: i32, _b: f32) {} -fn three_args(_a: i32, _b: f32, _c: &str) {} -fn four_args(_a: i32, _b: f32, _c: &str, _d: X) {} - -fn main() { - two_args(1.0, 1); //~ ERROR arguments to this function are incorrect - three_args(1.0, 1, ""); //~ ERROR arguments to this function are incorrect - three_args( 1, "", 1.0); //~ ERROR arguments to this function are incorrect - three_args( "", 1.0, 1); //~ ERROR arguments to this function are incorrect - - four_args(1.0, 1, X {}, ""); //~ ERROR arguments to this function are incorrect -} diff --git a/src/test/ui/argument-suggestions/swapped_arguments.stderr b/src/test/ui/argument-suggestions/swapped_arguments.stderr deleted file mode 100644 index dabf5e952..000000000 --- a/src/test/ui/argument-suggestions/swapped_arguments.stderr +++ /dev/null @@ -1,95 +0,0 @@ -error[E0308]: arguments to this function are incorrect - --> $DIR/swapped_arguments.rs:8:3 - | -LL | two_args(1.0, 1); - | ^^^^^^^^ --- - expected `f32`, found `{integer}` - | | - | expected `i32`, found `{float}` - | -note: function defined here - --> $DIR/swapped_arguments.rs:3:4 - | -LL | fn two_args(_a: i32, _b: f32) {} - | ^^^^^^^^ ------- ------- -help: swap these arguments - | -LL | two_args(1, 1.0); - | ~~~~~~~~ - -error[E0308]: arguments to this function are incorrect - --> $DIR/swapped_arguments.rs:9:3 - | -LL | three_args(1.0, 1, ""); - | ^^^^^^^^^^ --- - expected `f32`, found `{integer}` - | | - | expected `i32`, found `{float}` - | -note: function defined here - --> $DIR/swapped_arguments.rs:4:4 - | -LL | fn three_args(_a: i32, _b: f32, _c: &str) {} - | ^^^^^^^^^^ ------- ------- -------- -help: swap these arguments - | -LL | three_args(1, 1.0, ""); - | ~~~~~~~~~~~~ - -error[E0308]: arguments to this function are incorrect - --> $DIR/swapped_arguments.rs:10:3 - | -LL | three_args( 1, "", 1.0); - | ^^^^^^^^^^ -- --- expected `&str`, found `{float}` - | | - | expected `f32`, found `&'static str` - | -note: function defined here - --> $DIR/swapped_arguments.rs:4:4 - | -LL | fn three_args(_a: i32, _b: f32, _c: &str) {} - | ^^^^^^^^^^ ------- ------- -------- -help: swap these arguments - | -LL | three_args(1, 1.0, ""); - | ~~~~~~~~~~~~ - -error[E0308]: arguments to this function are incorrect - --> $DIR/swapped_arguments.rs:11:3 - | -LL | three_args( "", 1.0, 1); - | ^^^^^^^^^^ -- - expected `&str`, found `{integer}` - | | - | expected `i32`, found `&'static str` - | -note: function defined here - --> $DIR/swapped_arguments.rs:4:4 - | -LL | fn three_args(_a: i32, _b: f32, _c: &str) {} - | ^^^^^^^^^^ ------- ------- -------- -help: swap these arguments - | -LL | three_args(1, 1.0, ""); - | ~~~~~~~~~~~~ - -error[E0308]: arguments to this function are incorrect - --> $DIR/swapped_arguments.rs:13:3 - | -LL | four_args(1.0, 1, X {}, ""); - | ^^^^^^^^^ --- - ---- -- expected `X`, found `&'static str` - | | | | - | | | expected `&str`, found `X` - | | expected `f32`, found `{integer}` - | expected `i32`, found `{float}` - | -note: function defined here - --> $DIR/swapped_arguments.rs:5:4 - | -LL | fn four_args(_a: i32, _b: f32, _c: &str, _d: X) {} - | ^^^^^^^^^ ------- ------- -------- ----- -help: did you mean - | -LL | four_args(1, 1.0, "", X {}); - | ~~~~~~~~~~~~~~~~~~ - -error: aborting due to 5 previous errors - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/argument-suggestions/too-long.rs b/src/test/ui/argument-suggestions/too-long.rs deleted file mode 100644 index 7ec56afae..000000000 --- a/src/test/ui/argument-suggestions/too-long.rs +++ /dev/null @@ -1,41 +0,0 @@ -struct Qux; - -impl Qux { - fn foo( - &self, - a: i32, - b: i32, - c: i32, - d: i32, - e: i32, - f: i32, - g: i32, - h: i32, - i: i32, - j: i32, - k: i32, - l: i32, - ) { - } -} - -fn what( - qux: &Qux, - a: i32, - b: i32, - c: i32, - d: i32, - e: i32, - f: &i32, - g: i32, - h: i32, - i: i32, - j: i32, - k: i32, - l: i32, -) { - qux.foo(a, b, c, d, e, f, g, h, i, j, k, l); - //~^ ERROR mismatched types -} - -fn main() {} diff --git a/src/test/ui/argument-suggestions/too-long.stderr b/src/test/ui/argument-suggestions/too-long.stderr deleted file mode 100644 index bd430194c..000000000 --- a/src/test/ui/argument-suggestions/too-long.stderr +++ /dev/null @@ -1,24 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/too-long.rs:37:28 - | -LL | qux.foo(a, b, c, d, e, f, g, h, i, j, k, l); - | --- ^ expected `i32`, found `&i32` - | | - | arguments to this function are incorrect - | -note: associated function defined here - --> $DIR/too-long.rs:4:8 - | -LL | fn foo( - | ^^^ -... -LL | f: i32, - | ------ -help: consider dereferencing the borrow - | -LL | qux.foo(a, b, c, d, e, *f, g, h, i, j, k, l); - | + - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/argument-suggestions/two-mismatch-notes.rs b/src/test/ui/argument-suggestions/two-mismatch-notes.rs deleted file mode 100644 index 1309041ab..000000000 --- a/src/test/ui/argument-suggestions/two-mismatch-notes.rs +++ /dev/null @@ -1,11 +0,0 @@ -#[derive(Copy, Clone)] -struct Wrapper<T>(T); - -fn foo(_: fn(i32), _: Wrapper<i32>) {} - -fn f(_: u32) {} - -fn main() { - let w = Wrapper::<isize>(1isize); - foo(f, w); //~ ERROR arguments to this function are incorrect -} diff --git a/src/test/ui/argument-suggestions/two-mismatch-notes.stderr b/src/test/ui/argument-suggestions/two-mismatch-notes.stderr deleted file mode 100644 index 7873cf964..000000000 --- a/src/test/ui/argument-suggestions/two-mismatch-notes.stderr +++ /dev/null @@ -1,29 +0,0 @@ -error[E0308]: arguments to this function are incorrect - --> $DIR/two-mismatch-notes.rs:10:5 - | -LL | foo(f, w); - | ^^^ - | -note: expected `i32`, found `u32` - --> $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` - --> $DIR/two-mismatch-notes.rs:10:12 - | -LL | foo(f, w); - | ^ - = note: expected struct `Wrapper<i32>` - found struct `Wrapper<isize>` -note: function defined here - --> $DIR/two-mismatch-notes.rs:4:4 - | -LL | fn foo(_: fn(i32), _: Wrapper<i32>) {} - | ^^^ ---------- --------------- - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. |