Auto merge of #92364 - jackh726:Quantumplation/65853/param-heuristics, r=estebank
Better method call error messages Rebase/continuation of #71827 ~Based on #92360~ ~Based on #93118~ There's a decent description in #71827 that I won't copy here (for now at least) In addition to rebasing, I've tried to restore most of the original suggestions for invalid arguments. Unfortunately, this does make some of the errors a bit verbose. To fix this will require a bit of refactoring to some of the generalized error suggestion functions, and I just don't have the time to go into it right now. I think this is in a state that the error messages are overall better than before without a reduction in the suggestions given. ~I've tried to split out some of the easier and self-contained changes into separate commits (mostly in #92360, but also one here). There might be more than can be done here, but again just lacking time.~ r? `@estebank` as the original reviewer of #71827
This commit is contained in:
commit
07bb916d44
180 changed files with 10446 additions and 3067 deletions
|
|
@ -1,5 +0,0 @@
|
|||
// error-pattern: arguments were supplied
|
||||
|
||||
fn f(x: isize) { }
|
||||
|
||||
fn main() { let i: (); i = f(); }
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
error[E0061]: this function takes 1 argument but 0 arguments were supplied
|
||||
--> $DIR/arg-count-mismatch.rs:5:28
|
||||
|
|
||||
LL | fn main() { let i: (); i = f(); }
|
||||
| ^-- supplied 0 arguments
|
||||
| |
|
||||
| expected 1 argument
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/arg-count-mismatch.rs:3:4
|
||||
|
|
||||
LL | fn f(x: isize) { }
|
||||
| ^ --------
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0061`.
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
// error-pattern: mismatched types
|
||||
|
||||
fn f(x: isize) { }
|
||||
|
||||
fn main() { let i: (); i = f(()); }
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/arg-type-mismatch.rs:5:30
|
||||
|
|
||||
LL | fn main() { let i: (); i = f(()); }
|
||||
| ^^ expected `isize`, found `()`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0308`.
|
||||
25
src/test/ui/argument-suggestions/basic.rs
Normal file
25
src/test/ui/argument-suggestions/basic.rs
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
// 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
|
||||
}
|
||||
87
src/test/ui/argument-suggestions/basic.stderr
Normal file
87
src/test/ui/argument-suggestions/basic.stderr
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
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 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: aborting due to 5 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0061, E0308.
|
||||
For more information about an error, try `rustc --explain E0061`.
|
||||
16
src/test/ui/argument-suggestions/complex.rs
Normal file
16
src/test/ui/argument-suggestions/complex.rs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
// 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
|
||||
}
|
||||
19
src/test/ui/argument-suggestions/complex.stderr
Normal file
19
src/test/ui/argument-suggestions/complex.stderr
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
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`.
|
||||
35
src/test/ui/argument-suggestions/extra_arguments.rs
Normal file
35
src/test/ui/argument-suggestions/extra_arguments.rs
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
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,
|
||||
""
|
||||
);
|
||||
}
|
||||
239
src/test/ui/argument-suggestions/extra_arguments.stderr
Normal file
239
src/test/ui/argument-suggestions/extra_arguments.stderr
Normal file
|
|
@ -0,0 +1,239 @@
|
|||
error[E0061]: this function takes 0 arguments but 1 argument was supplied
|
||||
--> $DIR/extra_arguments.rs:7:3
|
||||
|
|
||||
LL | empty("");
|
||||
| ^^^^^ -- argument 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 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 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 unexpected
|
||||
| |
|
||||
| argument 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 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 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 `&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 3 arguments were supplied
|
||||
--> $DIR/extra_arguments.rs:17:3
|
||||
|
|
||||
LL | two_arg_diff(1, "", "");
|
||||
| ^^^^^^^^^^^^ -- argument 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 unexpected
|
||||
| |
|
||||
| argument of type `&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 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 unexpected
|
||||
| |
|
||||
| argument 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 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 `&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 3 arguments were supplied
|
||||
--> $DIR/extra_arguments.rs:24:3
|
||||
|
|
||||
LL | two_arg_same(
|
||||
| ^^^^^^^^^^^^
|
||||
...
|
||||
LL | ""
|
||||
| -- argument 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 `&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: aborting due to 14 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0061`.
|
||||
43
src/test/ui/argument-suggestions/invalid_arguments.rs
Normal file
43
src/test/ui/argument-suggestions/invalid_arguments.rs
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
// 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
|
||||
}
|
||||
299
src/test/ui/argument-suggestions/invalid_arguments.stderr
Normal file
299
src/test/ui/argument-suggestions/invalid_arguments.stderr
Normal file
|
|
@ -0,0 +1,299 @@
|
|||
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`.
|
||||
40
src/test/ui/argument-suggestions/missing_arguments.rs
Normal file
40
src/test/ui/argument-suggestions/missing_arguments.rs
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
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
|
||||
}
|
||||
310
src/test/ui/argument-suggestions/missing_arguments.stderr
Normal file
310
src/test/ui/argument-suggestions/missing_arguments.stderr
Normal file
|
|
@ -0,0 +1,310 @@
|
|||
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 `i32` 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`.
|
||||
24
src/test/ui/argument-suggestions/mixed_cases.rs
Normal file
24
src/test/ui/argument-suggestions/mixed_cases.rs
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
// 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
|
||||
}
|
||||
117
src/test/ui/argument-suggestions/mixed_cases.stderr
Normal file
117
src/test/ui/argument-suggestions/mixed_cases.stderr
Normal file
|
|
@ -0,0 +1,117 @@
|
|||
error[E0061]: this function takes 2 arguments but 3 arguments were supplied
|
||||
--> $DIR/mixed_cases.rs:10:3
|
||||
|
|
||||
LL | two_args(1, "", X {});
|
||||
| ^^^^^^^^ -- ---- argument 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 unexpected
|
||||
| | |
|
||||
| | argument of type `&str` 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 `&str` 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`.
|
||||
13
src/test/ui/argument-suggestions/permuted_arguments.rs
Normal file
13
src/test/ui/argument-suggestions/permuted_arguments.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
// 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
|
||||
}
|
||||
43
src/test/ui/argument-suggestions/permuted_arguments.stderr
Normal file
43
src/test/ui/argument-suggestions/permuted_arguments.stderr
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
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`.
|
||||
14
src/test/ui/argument-suggestions/swapped_arguments.rs
Normal file
14
src/test/ui/argument-suggestions/swapped_arguments.rs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
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
|
||||
}
|
||||
95
src/test/ui/argument-suggestions/swapped_arguments.stderr
Normal file
95
src/test/ui/argument-suggestions/swapped_arguments.stderr
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
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`.
|
||||
|
|
@ -2,25 +2,57 @@ error[E0308]: mismatched types
|
|||
--> $DIR/associated-type-projection-from-supertrait.rs:27:23
|
||||
|
|
||||
LL | fn b() { dent(ModelT, Blue); }
|
||||
| ^^^^ expected struct `Black`, found struct `Blue`
|
||||
| ---- ^^^^ expected struct `Black`, found struct `Blue`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/associated-type-projection-from-supertrait.rs:25:4
|
||||
|
|
||||
LL | fn dent<C:Car>(c: C, color: C::Color) { c.chip_paint(color) }
|
||||
| ^^^^ ---- ---------------
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/associated-type-projection-from-supertrait.rs:28:23
|
||||
|
|
||||
LL | fn c() { dent(ModelU, Black); }
|
||||
| ^^^^^ expected struct `Blue`, found struct `Black`
|
||||
| ---- ^^^^^ expected struct `Blue`, found struct `Black`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/associated-type-projection-from-supertrait.rs:25:4
|
||||
|
|
||||
LL | fn dent<C:Car>(c: C, color: C::Color) { c.chip_paint(color) }
|
||||
| ^^^^ ---- ---------------
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/associated-type-projection-from-supertrait.rs:32:28
|
||||
|
|
||||
LL | fn f() { ModelT.chip_paint(Blue); }
|
||||
| ^^^^ expected struct `Black`, found struct `Blue`
|
||||
| ---------- ^^^^ expected struct `Black`, found struct `Blue`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: associated function defined here
|
||||
--> $DIR/associated-type-projection-from-supertrait.rs:12:8
|
||||
|
|
||||
LL | fn chip_paint(&self, c: Self::Color) { }
|
||||
| ^^^^^^^^^^ ----- --------------
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/associated-type-projection-from-supertrait.rs:33:28
|
||||
|
|
||||
LL | fn g() { ModelU.chip_paint(Black); }
|
||||
| ^^^^^ expected struct `Blue`, found struct `Black`
|
||||
| ---------- ^^^^^ expected struct `Blue`, found struct `Black`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: associated function defined here
|
||||
--> $DIR/associated-type-projection-from-supertrait.rs:12:8
|
||||
|
|
||||
LL | fn chip_paint(&self, c: Self::Color) { }
|
||||
| ^^^^^^^^^^ ----- --------------
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -2,8 +2,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/associated-types-path-2.rs:19:14
|
||||
|
|
||||
LL | f1(2i32, 4i32);
|
||||
| ^^^^ expected `u32`, found `i32`
|
||||
| -- ^^^^ expected `u32`, found `i32`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/associated-types-path-2.rs:13:8
|
||||
|
|
||||
LL | pub fn f1<T: Foo>(a: T, x: T::A) {}
|
||||
| ^^ ---- -------
|
||||
help: change the type of the numeric literal from `i32` to `u32`
|
||||
|
|
||||
LL | f1(2i32, 4u32);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,9 @@ error[E0308]: mismatched types
|
|||
--> $DIR/dont-suggest-missing-await.rs:14:18
|
||||
|
|
||||
LL | take_u32(x)
|
||||
| ^ expected `u32`, found opaque type
|
||||
| -------- ^ expected `u32`, found opaque type
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: while checking the return type of the `async fn`
|
||||
--> $DIR/dont-suggest-missing-await.rs:7:24
|
||||
|
|
@ -11,6 +13,11 @@ LL | async fn make_u32() -> u32 {
|
|||
| ^^^ checked the `Output` of this `async fn`, found opaque type
|
||||
= note: expected type `u32`
|
||||
found opaque type `impl Future<Output = u32>`
|
||||
note: function defined here
|
||||
--> $DIR/dont-suggest-missing-await.rs:5:4
|
||||
|
|
||||
LL | fn take_u32(x: u32) {}
|
||||
| ^^^^^^^^ ------
|
||||
help: consider `await`ing on the `Future`
|
||||
|
|
||||
LL | take_u32(x.await)
|
||||
|
|
|
|||
|
|
@ -2,52 +2,67 @@ error[E0308]: mismatched types
|
|||
--> $DIR/generator-desc.rs:10:25
|
||||
|
|
||||
LL | fun(async {}, async {});
|
||||
| -- ^^ expected `async` block, found a different `async` block
|
||||
| |
|
||||
| -- ^^
|
||||
| | |
|
||||
| | expected `async` block, found a different `async` block
|
||||
| | arguments to this function are incorrect
|
||||
| the expected `async` block
|
||||
|
|
||||
= note: expected `async` block `[static generator@$DIR/generator-desc.rs:10:15: 10:17]`
|
||||
found `async` block `[static generator@$DIR/generator-desc.rs:10:25: 10:27]`
|
||||
note: function defined here
|
||||
--> $SRC_DIR/core/src/future/mod.rs:LL:COL
|
||||
|
|
||||
LL | pub const fn from_generator<T>(gen: T) -> impl Future<Output = T::Return>
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/generator-desc.rs:12:16
|
||||
|
|
||||
LL | fun(one(), two());
|
||||
| ^^^^^ expected opaque type, found a different opaque type
|
||||
| --- ^^^^^ expected opaque type, found a different opaque type
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: while checking the return type of the `async fn`
|
||||
--> $DIR/generator-desc.rs:5:16
|
||||
|
|
||||
LL | async fn one() {}
|
||||
| ^ checked the `Output` of this `async fn`, expected opaque type
|
||||
note: while checking the return type of the `async fn`
|
||||
--> $DIR/generator-desc.rs:6:16
|
||||
|
|
||||
LL | async fn two() {}
|
||||
| ^ checked the `Output` of this `async fn`, found opaque type
|
||||
= note: expected opaque type `impl Future<Output = ()>` (opaque type at <$DIR/generator-desc.rs:5:16>)
|
||||
found opaque type `impl Future<Output = ()>` (opaque type at <$DIR/generator-desc.rs:6:16>)
|
||||
= note: expected type `impl Future<Output = ()>` (opaque type at <$DIR/generator-desc.rs:5:16>)
|
||||
found opaque type `impl Future<Output = ()>` (opaque type at <$DIR/generator-desc.rs:6:16>)
|
||||
= help: consider `await`ing on both `Future`s
|
||||
= note: distinct uses of `impl Trait` result in different opaque types
|
||||
note: function defined here
|
||||
--> $DIR/generator-desc.rs:8:4
|
||||
|
|
||||
LL | fn fun<F: Future<Output = ()>>(f1: F, f2: F) {}
|
||||
| ^^^ ----- -----
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/generator-desc.rs:14:26
|
||||
|
|
||||
LL | fun((async || {})(), (async || {})());
|
||||
| -- ^^^^^^^^^^^^^^^ expected `async` closure body, found a different `async` closure body
|
||||
| |
|
||||
| the expected `async` closure body
|
||||
| --- ^^^^^^^^^^^^^^^ expected `async` closure body, found a different `async` closure body
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
::: $SRC_DIR/core/src/future/mod.rs:LL:COL
|
||||
|
|
||||
LL | pub const fn from_generator<T>(gen: T) -> impl Future<Output = T::Return>
|
||||
| -------------------------------
|
||||
| |
|
||||
| the expected opaque type
|
||||
| the found opaque type
|
||||
| ------------------------------- the found opaque type
|
||||
|
|
||||
= note: expected opaque type `impl Future<Output = ()>` (`async` closure body)
|
||||
found opaque type `impl Future<Output = ()>` (`async` closure body)
|
||||
= note: expected type `impl Future<Output = ()>` (`async` closure body)
|
||||
found opaque type `impl Future<Output = ()>` (`async` closure body)
|
||||
note: function defined here
|
||||
--> $DIR/generator-desc.rs:8:4
|
||||
|
|
||||
LL | fn fun<F: Future<Output = ()>>(f1: F, f2: F) {}
|
||||
| ^^^ ----- -----
|
||||
help: consider `await`ing on the `Future`
|
||||
|
|
||||
LL | fun((async || {})(), (async || {})().await);
|
||||
| ++++++
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,9 @@ error[E0308]: mismatched types
|
|||
--> $DIR/suggest-missing-await-closure.rs:16:18
|
||||
|
|
||||
LL | take_u32(x)
|
||||
| ^ expected `u32`, found opaque type
|
||||
| -------- ^ expected `u32`, found opaque type
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: while checking the return type of the `async fn`
|
||||
--> $DIR/suggest-missing-await-closure.rs:8:24
|
||||
|
|
@ -11,6 +13,11 @@ LL | async fn make_u32() -> u32 {
|
|||
| ^^^ checked the `Output` of this `async fn`, found opaque type
|
||||
= note: expected type `u32`
|
||||
found opaque type `impl Future<Output = u32>`
|
||||
note: function defined here
|
||||
--> $DIR/suggest-missing-await-closure.rs:6:4
|
||||
|
|
||||
LL | fn take_u32(_x: u32) {}
|
||||
| ^^^^^^^^ -------
|
||||
help: consider `await`ing on the `Future`
|
||||
|
|
||||
LL | take_u32(x.await)
|
||||
|
|
|
|||
|
|
@ -2,7 +2,9 @@ error[E0308]: mismatched types
|
|||
--> $DIR/suggest-missing-await.rs:12:14
|
||||
|
|
||||
LL | take_u32(x)
|
||||
| ^ expected `u32`, found opaque type
|
||||
| -------- ^ expected `u32`, found opaque type
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: while checking the return type of the `async fn`
|
||||
--> $DIR/suggest-missing-await.rs:5:24
|
||||
|
|
@ -11,6 +13,11 @@ LL | async fn make_u32() -> u32 {
|
|||
| ^^^ checked the `Output` of this `async fn`, found opaque type
|
||||
= note: expected type `u32`
|
||||
found opaque type `impl Future<Output = u32>`
|
||||
note: function defined here
|
||||
--> $DIR/suggest-missing-await.rs:3:4
|
||||
|
|
||||
LL | fn take_u32(_x: u32) {}
|
||||
| ^^^^^^^^ -------
|
||||
help: consider `await`ing on the `Future`
|
||||
|
|
||||
LL | take_u32(x.await)
|
||||
|
|
|
|||
|
|
@ -8,29 +8,33 @@ error[E0060]: this function takes at least 2 arguments but 0 arguments were supp
|
|||
--> $DIR/variadic-ffi-1.rs:20:9
|
||||
|
|
||||
LL | foo();
|
||||
| ^^^-- supplied 0 arguments
|
||||
| |
|
||||
| expected at least 2 arguments
|
||||
| ^^^-- two arguments of type `isize` and `u8` are missing
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/variadic-ffi-1.rs:13:8
|
||||
|
|
||||
LL | fn foo(f: isize, x: u8, ...);
|
||||
| ^^^
|
||||
help: provide the arguments
|
||||
|
|
||||
LL | foo({isize}, {u8});
|
||||
| ~~~~~~~~~~~~~~~~~~
|
||||
|
||||
error[E0060]: this function takes at least 2 arguments but 1 argument was supplied
|
||||
--> $DIR/variadic-ffi-1.rs:21:9
|
||||
|
|
||||
LL | foo(1);
|
||||
| ^^^ - supplied 1 argument
|
||||
| |
|
||||
| expected at least 2 arguments
|
||||
| ^^^--- an argument of type `u8` is missing
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/variadic-ffi-1.rs:13:8
|
||||
|
|
||||
LL | fn foo(f: isize, x: u8, ...);
|
||||
| ^^^
|
||||
help: provide the argument
|
||||
|
|
||||
LL | foo(1, {u8});
|
||||
| ~~~~~~~~~~~~
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/variadic-ffi-1.rs:23:56
|
||||
|
|
|
|||
|
|
@ -2,8 +2,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/cast-int-to-char.rs:4:16
|
||||
|
|
||||
LL | foo::<u32>('0');
|
||||
| ^^^ expected `u32`, found `char`
|
||||
| ---------- ^^^ expected `u32`, found `char`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/cast-int-to-char.rs:1:4
|
||||
|
|
||||
LL | fn foo<T>(_t: T) {}
|
||||
| ^^^ -----
|
||||
help: you can cast a `char` to a `u32`, since a `char` always occupies 4 bytes
|
||||
|
|
||||
LL | foo::<u32>('0' as u32);
|
||||
|
|
@ -13,8 +20,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/cast-int-to-char.rs:5:16
|
||||
|
|
||||
LL | foo::<i32>('0');
|
||||
| ^^^ expected `i32`, found `char`
|
||||
| ---------- ^^^ expected `i32`, found `char`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/cast-int-to-char.rs:1:4
|
||||
|
|
||||
LL | fn foo<T>(_t: T) {}
|
||||
| ^^^ -----
|
||||
help: you can cast a `char` to an `i32`, since a `char` always occupies 4 bytes
|
||||
|
|
||||
LL | foo::<i32>('0' as i32);
|
||||
|
|
@ -24,8 +38,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/cast-int-to-char.rs:6:16
|
||||
|
|
||||
LL | foo::<u64>('0');
|
||||
| ^^^ expected `u64`, found `char`
|
||||
| ---------- ^^^ expected `u64`, found `char`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/cast-int-to-char.rs:1:4
|
||||
|
|
||||
LL | fn foo<T>(_t: T) {}
|
||||
| ^^^ -----
|
||||
help: you can cast a `char` to a `u64`, since a `char` always occupies 4 bytes
|
||||
|
|
||||
LL | foo::<u64>('0' as u64);
|
||||
|
|
@ -35,8 +56,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/cast-int-to-char.rs:7:16
|
||||
|
|
||||
LL | foo::<i64>('0');
|
||||
| ^^^ expected `i64`, found `char`
|
||||
| ---------- ^^^ expected `i64`, found `char`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/cast-int-to-char.rs:1:4
|
||||
|
|
||||
LL | fn foo<T>(_t: T) {}
|
||||
| ^^^ -----
|
||||
help: you can cast a `char` to an `i64`, since a `char` always occupies 4 bytes
|
||||
|
|
||||
LL | foo::<i64>('0' as i64);
|
||||
|
|
@ -46,7 +74,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/cast-int-to-char.rs:8:17
|
||||
|
|
||||
LL | foo::<char>(0u32);
|
||||
| ^^^^ expected `char`, found `u32`
|
||||
| ----------- ^^^^ expected `char`, found `u32`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/cast-int-to-char.rs:1:4
|
||||
|
|
||||
LL | fn foo<T>(_t: T) {}
|
||||
| ^^^ -----
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,9 @@ error[E0308]: mismatched types
|
|||
LL | let f = |s: &str| println!("{}{}", s, string);
|
||||
| ------------------------------------- the found closure
|
||||
LL | call_bare(f)
|
||||
| ^ expected fn pointer, found closure
|
||||
| --------- ^ expected fn pointer, found closure
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
= note: expected fn pointer `for<'r> fn(&'r str)`
|
||||
found closure `[closure@$DIR/closure-reform-bad.rs:10:13: 10:50]`
|
||||
|
|
@ -13,6 +15,11 @@ note: closures can only be coerced to `fn` types if they do not capture any vari
|
|||
|
|
||||
LL | let f = |s: &str| println!("{}{}", s, string);
|
||||
| ^^^^^^ `string` captured here
|
||||
note: function defined here
|
||||
--> $DIR/closure-reform-bad.rs:4:4
|
||||
|
|
||||
LL | fn call_bare(f: fn(&str)) {
|
||||
| ^^^^^^^^^ -----------
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -2,13 +2,20 @@ error[E0308]: mismatched types
|
|||
--> $DIR/issue-84128.rs:13:13
|
||||
|
|
||||
LL | Foo(())
|
||||
| ^^ expected integer, found `()`
|
||||
| --- ^^ expected integer, found `()`
|
||||
| |
|
||||
| arguments to this struct are incorrect
|
||||
|
|
||||
note: return type inferred to be `{integer}` here
|
||||
--> $DIR/issue-84128.rs:10:20
|
||||
|
|
||||
LL | return Foo(0);
|
||||
| ^^^^^^
|
||||
note: tuple struct defined here
|
||||
--> $DIR/issue-84128.rs:5:8
|
||||
|
|
||||
LL | struct Foo<T>(T);
|
||||
| ^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -2,19 +2,25 @@ error[E0308]: mismatched types
|
|||
--> $DIR/issue-87461.rs:10:8
|
||||
|
|
||||
LL | Ok(())
|
||||
| ^^ expected `u16`, found `()`
|
||||
| -- ^^ expected `u16`, found `()`
|
||||
| |
|
||||
| arguments to this enum variant are incorrect
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-87461.rs:17:8
|
||||
|
|
||||
LL | Ok(())
|
||||
| ^^ expected `u16`, found `()`
|
||||
| -- ^^ expected `u16`, found `()`
|
||||
| |
|
||||
| arguments to this enum variant are incorrect
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-87461.rs:26:12
|
||||
|
|
||||
LL | Ok(())
|
||||
| ^^ expected `u16`, found `()`
|
||||
| -- ^^ expected `u16`, found `()`
|
||||
| |
|
||||
| arguments to this enum variant are incorrect
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -2,10 +2,17 @@ error[E0308]: mismatched types
|
|||
--> $DIR/coerce-mut.rs:5:7
|
||||
|
|
||||
LL | f(&x);
|
||||
| ^^ types differ in mutability
|
||||
| - ^^ types differ in mutability
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
= note: expected mutable reference `&mut i32`
|
||||
found reference `&{integer}`
|
||||
note: function defined here
|
||||
--> $DIR/coerce-mut.rs:1:4
|
||||
|
|
||||
LL | fn f(x: &mut i32) {}
|
||||
| ^ -----------
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -2,10 +2,17 @@ error[E0308]: mismatched types
|
|||
--> $DIR/coerce-reborrow-multi-arg-fail.rs:4:18
|
||||
|
|
||||
LL | test(&mut 7, &7);
|
||||
| ^^ types differ in mutability
|
||||
| ---- ^^ types differ in mutability
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
= note: expected mutable reference `&mut {integer}`
|
||||
found reference `&{integer}`
|
||||
= note: expected type `&mut {integer}`
|
||||
found reference `&{integer}`
|
||||
note: function defined here
|
||||
--> $DIR/coerce-reborrow-multi-arg-fail.rs:1:4
|
||||
|
|
||||
LL | fn test<T>(_a: T, _b: T) {}
|
||||
| ^^^^ ----- -----
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -2,46 +2,81 @@ error[E0308]: mismatched types
|
|||
--> $DIR/coerce-to-bang.rs:6:17
|
||||
|
|
||||
LL | foo(return, 22, 44);
|
||||
| ^^ expected `!`, found integer
|
||||
| --- ^^ expected `!`, found integer
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
= note: expected type `!`
|
||||
found type `{integer}`
|
||||
note: function defined here
|
||||
--> $DIR/coerce-to-bang.rs:3:4
|
||||
|
|
||||
LL | fn foo(x: usize, y: !, z: usize) { }
|
||||
| ^^^ -------- ---- --------
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/coerce-to-bang.rs:18:13
|
||||
|
|
||||
LL | foo(22, 44, return);
|
||||
| ^^ expected `!`, found integer
|
||||
| --- ^^ expected `!`, found integer
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
= note: expected type `!`
|
||||
found type `{integer}`
|
||||
note: function defined here
|
||||
--> $DIR/coerce-to-bang.rs:3:4
|
||||
|
|
||||
LL | fn foo(x: usize, y: !, z: usize) { }
|
||||
| ^^^ -------- ---- --------
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/coerce-to-bang.rs:26:12
|
||||
|
|
||||
LL | foo(a, b, c); // ... and hence a reference to `a` is expected to diverge.
|
||||
| ^ expected `!`, found integer
|
||||
| --- ^ expected `!`, found integer
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
= note: expected type `!`
|
||||
found type `{integer}`
|
||||
note: function defined here
|
||||
--> $DIR/coerce-to-bang.rs:3:4
|
||||
|
|
||||
LL | fn foo(x: usize, y: !, z: usize) { }
|
||||
| ^^^ -------- ---- --------
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/coerce-to-bang.rs:36:12
|
||||
|
|
||||
LL | foo(a, b, c);
|
||||
| ^ expected `!`, found integer
|
||||
| --- ^ expected `!`, found integer
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
= note: expected type `!`
|
||||
found type `{integer}`
|
||||
note: function defined here
|
||||
--> $DIR/coerce-to-bang.rs:3:4
|
||||
|
|
||||
LL | fn foo(x: usize, y: !, z: usize) { }
|
||||
| ^^^ -------- ---- --------
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/coerce-to-bang.rs:45:12
|
||||
|
|
||||
LL | foo(a, b, c);
|
||||
| ^ expected `!`, found integer
|
||||
| --- ^ expected `!`, found integer
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
= note: expected type `!`
|
||||
found type `{integer}`
|
||||
note: function defined here
|
||||
--> $DIR/coerce-to-bang.rs:3:4
|
||||
|
|
||||
LL | fn foo(x: usize, y: !, z: usize) { }
|
||||
| ^^^ -------- ---- --------
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/coerce-to-bang.rs:50:21
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
error[E0308]: arguments to this function are incorrect
|
||||
--> $DIR/const-argument-cross-crate-mismatch.rs:7:41
|
||||
|
|
||||
LL | let _ = const_generic_lib::function(const_generic_lib::Struct([0u8, 1u8]));
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^----------^
|
||||
| |
|
||||
| expected `[u8; 3]`, found `[u8; 2]`
|
||||
|
|
||||
help: provide an argument of the correct type
|
||||
|
|
||||
LL | let _ = const_generic_lib::function(({[u8; 3]}));
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error[E0308]: arguments to this function are incorrect
|
||||
--> $DIR/const-argument-cross-crate-mismatch.rs:9:39
|
||||
|
|
||||
LL | let _: const_generic_lib::Alias = const_generic_lib::Struct([0u8, 1u8, 2u8]);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^---------------^
|
||||
| |
|
||||
| expected `[u8; 2]`, found `[u8; 3]`
|
||||
|
|
||||
help: provide an argument of the correct type
|
||||
|
|
||||
LL | let _: const_generic_lib::Alias = ({[u8; 2]});
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0308`.
|
||||
|
|
@ -2,13 +2,17 @@ error[E0308]: mismatched types
|
|||
--> $DIR/const-argument-cross-crate-mismatch.rs:6:67
|
||||
|
|
||||
LL | let _ = const_generic_lib::function(const_generic_lib::Struct([0u8, 1u8]));
|
||||
| ^^^^^^^^^^ expected an array with a fixed size of 3 elements, found one with 2 elements
|
||||
| ------------------------- ^^^^^^^^^^ expected an array with a fixed size of 3 elements, found one with 2 elements
|
||||
| |
|
||||
| arguments to this struct are incorrect
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/const-argument-cross-crate-mismatch.rs:8:65
|
||||
|
|
||||
LL | let _: const_generic_lib::Alias = const_generic_lib::Struct([0u8, 1u8, 2u8]);
|
||||
| ^^^^^^^^^^^^^^^ expected an array with a fixed size of 2 elements, found one with 3 elements
|
||||
| ------------------------- ^^^^^^^^^^^^^^^ expected an array with a fixed size of 2 elements, found one with 3 elements
|
||||
| |
|
||||
| arguments to this struct are incorrect
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,3 @@
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-62504.rs:18:21
|
||||
|
|
||||
LL | ArrayHolder([0; Self::SIZE])
|
||||
| ^^^^^^^^^^^^^^^ expected `X`, found `Self::SIZE`
|
||||
|
|
||||
= note: expected array `[u32; X]`
|
||||
found array `[u32; _]`
|
||||
|
||||
error: constant expression depends on a generic parameter
|
||||
--> $DIR/issue-62504.rs:18:25
|
||||
|
|
||||
|
|
@ -15,6 +6,22 @@ LL | ArrayHolder([0; Self::SIZE])
|
|||
|
|
||||
= note: this may fail depending on what value the parameter takes
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-62504.rs:18:21
|
||||
|
|
||||
LL | ArrayHolder([0; Self::SIZE])
|
||||
| ----------- ^^^^^^^^^^^^^^^ expected `X`, found `Self::SIZE`
|
||||
| |
|
||||
| arguments to this struct are incorrect
|
||||
|
|
||||
= note: expected array `[u32; X]`
|
||||
found array `[u32; _]`
|
||||
note: tuple struct defined here
|
||||
--> $DIR/issue-62504.rs:14:8
|
||||
|
|
||||
LL | struct ArrayHolder<const X: usize>([u32; X]);
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0308`.
|
||||
|
|
|
|||
|
|
@ -2,10 +2,17 @@ error[E0308]: mismatched types
|
|||
--> $DIR/issue-42764.rs:11:43
|
||||
|
|
||||
LL | this_function_expects_a_double_option(n);
|
||||
| ^ expected enum `DoubleOption`, found `usize`
|
||||
| ------------------------------------- ^ expected enum `DoubleOption`, found `usize`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
= note: expected enum `DoubleOption<_>`
|
||||
found type `usize`
|
||||
note: function defined here
|
||||
--> $DIR/issue-42764.rs:7:4
|
||||
|
|
||||
LL | fn this_function_expects_a_double_option<T>(d: DoubleOption<T>) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ------------------
|
||||
help: try wrapping the expression in a variant of `DoubleOption`
|
||||
|
|
||||
LL | this_function_expects_a_double_option(DoubleOption::FirstSome(n));
|
||||
|
|
|
|||
|
|
@ -2,10 +2,17 @@ error[E0308]: mismatched types
|
|||
--> $DIR/disambiguate-identical-names.rs:13:10
|
||||
|
|
||||
LL | test(&v);
|
||||
| ^^ expected struct `std::vec::Vec`, found struct `HashMap`
|
||||
| ---- ^^ expected struct `std::vec::Vec`, found struct `HashMap`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
= note: expected reference `&std::vec::Vec<std::vec::Vec<u32>>`
|
||||
found reference `&HashMap<u8, u8>`
|
||||
note: function defined here
|
||||
--> $DIR/disambiguate-identical-names.rs:6:4
|
||||
|
|
||||
LL | fn test(_v: &Vec<Vec<u32>>) {
|
||||
| ^^^^ ------------------
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -2,17 +2,23 @@ error[E0057]: this function takes 1 argument but 0 arguments were supplied
|
|||
--> $DIR/E0057.rs:3:13
|
||||
|
|
||||
LL | let a = f();
|
||||
| ^-- supplied 0 arguments
|
||||
| |
|
||||
| expected 1 argument
|
||||
| ^-- an argument is missing
|
||||
|
|
||||
help: provide the argument
|
||||
|
|
||||
LL | let a = f({_});
|
||||
| ~~~~~~
|
||||
|
||||
error[E0057]: this function takes 1 argument but 2 arguments were supplied
|
||||
--> $DIR/E0057.rs:5:13
|
||||
|
|
||||
LL | let c = f(2, 3);
|
||||
| ^ - - supplied 2 arguments
|
||||
| |
|
||||
| expected 1 argument
|
||||
| ^ - argument unexpected
|
||||
|
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL | let c = f(2);
|
||||
| ~~~~
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -5,5 +5,4 @@ extern "C" {
|
|||
fn main() {
|
||||
unsafe { printf(); }
|
||||
//~^ ERROR E0060
|
||||
//~| expected at least 1 argument
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,15 +2,17 @@ error[E0060]: this function takes at least 1 argument but 0 arguments were suppl
|
|||
--> $DIR/E0060.rs:6:14
|
||||
|
|
||||
LL | unsafe { printf(); }
|
||||
| ^^^^^^-- supplied 0 arguments
|
||||
| |
|
||||
| expected at least 1 argument
|
||||
| ^^^^^^-- an argument of type `*const u8` is missing
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/E0060.rs:2:8
|
||||
|
|
||||
LL | fn printf(_: *const u8, ...) -> u32;
|
||||
| ^^^^^^
|
||||
help: provide the argument
|
||||
|
|
||||
LL | unsafe { printf({*const u8}); }
|
||||
| ~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -5,9 +5,7 @@ fn f2(a: u16) {}
|
|||
fn main() {
|
||||
f(0);
|
||||
//~^ ERROR E0061
|
||||
//~| expected 2 arguments
|
||||
|
||||
f2();
|
||||
//~^ ERROR E0061
|
||||
//~| expected 1 argument
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,29 +2,33 @@ error[E0061]: this function takes 2 arguments but 1 argument was supplied
|
|||
--> $DIR/E0061.rs:6:5
|
||||
|
|
||||
LL | f(0);
|
||||
| ^ - supplied 1 argument
|
||||
| |
|
||||
| expected 2 arguments
|
||||
| ^--- an argument of type `&str` is missing
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/E0061.rs:1:4
|
||||
|
|
||||
LL | fn f(a: u16, b: &str) {}
|
||||
| ^ ------ -------
|
||||
help: provide the argument
|
||||
|
|
||||
LL | f(0, {&str});
|
||||
| ~~~~~~~~~~~~
|
||||
|
||||
error[E0061]: this function takes 1 argument but 0 arguments were supplied
|
||||
--> $DIR/E0061.rs:10:5
|
||||
--> $DIR/E0061.rs:9:5
|
||||
|
|
||||
LL | f2();
|
||||
| ^^-- supplied 0 arguments
|
||||
| |
|
||||
| expected 1 argument
|
||||
| ^^-- an argument of type `u16` is missing
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/E0061.rs:3:4
|
||||
|
|
||||
LL | fn f2(a: u16) {}
|
||||
| ^^ ------
|
||||
help: provide the argument
|
||||
|
|
||||
LL | f2({u16});
|
||||
| ~~~~~~~~~
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
|
|
|||
15
src/test/ui/estr-subtyping.rs
Normal file
15
src/test/ui/estr-subtyping.rs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
fn wants_uniq(x: String) { }
|
||||
fn wants_slice(x: &str) { }
|
||||
|
||||
fn has_uniq(x: String) {
|
||||
wants_uniq(x);
|
||||
wants_slice(&*x);
|
||||
}
|
||||
|
||||
fn has_slice(x: &str) {
|
||||
wants_uniq(x); //~ ERROR mismatched types
|
||||
wants_slice(x);
|
||||
}
|
||||
|
||||
fn main() {
|
||||
}
|
||||
18
src/test/ui/estr-subtyping.stderr
Normal file
18
src/test/ui/estr-subtyping.stderr
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/estr-subtyping.rs:10:15
|
||||
|
|
||||
LL | wants_uniq(x);
|
||||
| ---------- ^- help: try using a conversion method: `.to_string()`
|
||||
| | |
|
||||
| | expected struct `String`, found `&str`
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/estr-subtyping.rs:1:4
|
||||
|
|
||||
LL | fn wants_uniq(x: String) { }
|
||||
| ^^^^^^^^^^ ---------
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0308`.
|
||||
|
|
@ -296,20 +296,36 @@ error[E0308]: mismatched types
|
|||
--> $DIR/ifmt-bad-arg.rs:78:32
|
||||
|
|
||||
LL | println!("{} {:.*} {}", 1, 3.2, 4);
|
||||
| ^^^ expected `usize`, found floating-point number
|
||||
| ---------------------------^^^----
|
||||
| | |
|
||||
| | expected `usize`, found floating-point number
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
= note: expected reference `&usize`
|
||||
found reference `&{float}`
|
||||
note: associated function defined here
|
||||
--> $SRC_DIR/core/src/fmt/mod.rs:LL:COL
|
||||
|
|
||||
LL | pub fn from_usize(x: &usize) -> ArgumentV1<'_> {
|
||||
| ^^^^^^^^^^
|
||||
= note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/ifmt-bad-arg.rs:81:35
|
||||
|
|
||||
LL | println!("{} {:07$.*} {}", 1, 3.2, 4);
|
||||
| ^^^ expected `usize`, found floating-point number
|
||||
| ------------------------------^^^----
|
||||
| | |
|
||||
| | expected `usize`, found floating-point number
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
= note: expected reference `&usize`
|
||||
found reference `&{float}`
|
||||
note: associated function defined here
|
||||
--> $SRC_DIR/core/src/fmt/mod.rs:LL:COL
|
||||
|
|
||||
LL | pub fn from_usize(x: &usize) -> ArgumentV1<'_> {
|
||||
| ^^^^^^^^^^
|
||||
= note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: aborting due to 36 previous errors
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ impl<T> Foo for T { /* `foo` is still default here */ }
|
|||
fn main() {
|
||||
eq(foo::<u8>, bar::<u8>);
|
||||
//~^ ERROR mismatched types
|
||||
//~| expected fn item `fn(_) -> _ {foo::<u8>}`
|
||||
//~| expected type `fn(_) -> _ {foo::<u8>}`
|
||||
//~| found fn item `fn(_) -> _ {bar::<u8>}`
|
||||
//~| expected fn item, found a different fn item
|
||||
//~| different `fn` items always have unique types, even if their signatures are the same
|
||||
|
|
@ -28,7 +28,7 @@ fn main() {
|
|||
|
||||
eq(bar::<String>, bar::<Vec<u8>>);
|
||||
//~^ ERROR mismatched types
|
||||
//~| expected fn item `fn(_) -> _ {bar::<String>}`
|
||||
//~| expected type `fn(_) -> _ {bar::<String>}`
|
||||
//~| found fn item `fn(_) -> _ {bar::<Vec<u8>>}`
|
||||
//~| expected struct `String`, found struct `Vec`
|
||||
//~| different `fn` items always have unique types, even if their signatures are the same
|
||||
|
|
@ -45,7 +45,7 @@ fn main() {
|
|||
|
||||
eq(foo::<u8>, bar::<u8> as fn(isize) -> isize);
|
||||
//~^ ERROR mismatched types
|
||||
//~| expected fn item `fn(_) -> _ {foo::<u8>}`
|
||||
//~| expected type `fn(_) -> _ {foo::<u8>}`
|
||||
//~| found fn pointer `fn(_) -> _`
|
||||
//~| expected fn item, found fn pointer
|
||||
//~| change the expected type to be function pointer
|
||||
|
|
|
|||
|
|
@ -2,60 +2,95 @@ error[E0308]: mismatched types
|
|||
--> $DIR/fn-item-type.rs:13:19
|
||||
|
|
||||
LL | eq(foo::<u8>, bar::<u8>);
|
||||
| ^^^^^^^^^ expected fn item, found a different fn item
|
||||
| -- ^^^^^^^^^ expected fn item, found a different fn item
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
= note: expected fn item `fn(_) -> _ {foo::<u8>}`
|
||||
found fn item `fn(_) -> _ {bar::<u8>}`
|
||||
= note: expected type `fn(_) -> _ {foo::<u8>}`
|
||||
found fn item `fn(_) -> _ {bar::<u8>}`
|
||||
= note: different `fn` items always have unique types, even if their signatures are the same
|
||||
= help: change the expected type to be function pointer `fn(isize) -> isize`
|
||||
= help: if the expected type is due to type inference, cast the expected `fn` to a function pointer: `foo::<u8> as fn(isize) -> isize`
|
||||
note: function defined here
|
||||
--> $DIR/fn-item-type.rs:7:4
|
||||
|
|
||||
LL | fn eq<T>(x: T, y: T) { }
|
||||
| ^^ ---- ----
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/fn-item-type.rs:22:19
|
||||
|
|
||||
LL | eq(foo::<u8>, foo::<i8>);
|
||||
| ^^^^^^^^^ expected `u8`, found `i8`
|
||||
| -- ^^^^^^^^^ expected `u8`, found `i8`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
= note: expected fn item `fn(_) -> _ {foo::<u8>}`
|
||||
found fn item `fn(_) -> _ {foo::<i8>}`
|
||||
= note: expected type `fn(_) -> _ {foo::<u8>}`
|
||||
found fn item `fn(_) -> _ {foo::<i8>}`
|
||||
= note: different `fn` items always have unique types, even if their signatures are the same
|
||||
= help: change the expected type to be function pointer `fn(isize) -> isize`
|
||||
= help: if the expected type is due to type inference, cast the expected `fn` to a function pointer: `foo::<u8> as fn(isize) -> isize`
|
||||
note: function defined here
|
||||
--> $DIR/fn-item-type.rs:7:4
|
||||
|
|
||||
LL | fn eq<T>(x: T, y: T) { }
|
||||
| ^^ ---- ----
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/fn-item-type.rs:29:23
|
||||
|
|
||||
LL | eq(bar::<String>, bar::<Vec<u8>>);
|
||||
| ^^^^^^^^^^^^^^ expected struct `String`, found struct `Vec`
|
||||
| -- ^^^^^^^^^^^^^^ expected struct `String`, found struct `Vec`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
= note: expected fn item `fn(_) -> _ {bar::<String>}`
|
||||
found fn item `fn(_) -> _ {bar::<Vec<u8>>}`
|
||||
= note: expected type `fn(_) -> _ {bar::<String>}`
|
||||
found fn item `fn(_) -> _ {bar::<Vec<u8>>}`
|
||||
= note: different `fn` items always have unique types, even if their signatures are the same
|
||||
= help: change the expected type to be function pointer `fn(isize) -> isize`
|
||||
= help: if the expected type is due to type inference, cast the expected `fn` to a function pointer: `bar::<String> as fn(isize) -> isize`
|
||||
note: function defined here
|
||||
--> $DIR/fn-item-type.rs:7:4
|
||||
|
|
||||
LL | fn eq<T>(x: T, y: T) { }
|
||||
| ^^ ---- ----
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/fn-item-type.rs:39:26
|
||||
|
|
||||
LL | eq(<u8 as Foo>::foo, <u16 as Foo>::foo);
|
||||
| ^^^^^^^^^^^^^^^^^ expected `u8`, found `u16`
|
||||
| -- ^^^^^^^^^^^^^^^^^ expected `u8`, found `u16`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
= note: expected fn item `fn() {<u8 as Foo>::foo}`
|
||||
found fn item `fn() {<u16 as Foo>::foo}`
|
||||
= note: expected type `fn() {<u8 as Foo>::foo}`
|
||||
found fn item `fn() {<u16 as Foo>::foo}`
|
||||
= note: different `fn` items always have unique types, even if their signatures are the same
|
||||
= help: change the expected type to be function pointer `fn()`
|
||||
= help: if the expected type is due to type inference, cast the expected `fn` to a function pointer: `<u8 as Foo>::foo as fn()`
|
||||
note: function defined here
|
||||
--> $DIR/fn-item-type.rs:7:4
|
||||
|
|
||||
LL | fn eq<T>(x: T, y: T) { }
|
||||
| ^^ ---- ----
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/fn-item-type.rs:46:19
|
||||
|
|
||||
LL | eq(foo::<u8>, bar::<u8> as fn(isize) -> isize);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected fn item, found fn pointer
|
||||
| -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected fn item, found fn pointer
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
= note: expected fn item `fn(_) -> _ {foo::<u8>}`
|
||||
= note: expected type `fn(_) -> _ {foo::<u8>}`
|
||||
found fn pointer `fn(_) -> _`
|
||||
= help: change the expected type to be function pointer `fn(isize) -> isize`
|
||||
= help: if the expected type is due to type inference, cast the expected `fn` to a function pointer: `foo::<u8> as fn(isize) -> isize`
|
||||
note: function defined here
|
||||
--> $DIR/fn-item-type.rs:7:4
|
||||
|
|
||||
LL | fn eq<T>(x: T, y: T) { }
|
||||
| ^^ ---- ----
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,17 @@ error[E0308]: mismatched types
|
|||
LL | fn bug<'a, T: Fun<F<'a> = T>>(t: T) -> T::F<'a> {
|
||||
| - this type parameter
|
||||
LL | T::identity(())
|
||||
| ^^ expected type parameter `T`, found `()`
|
||||
| ----------- ^^ expected type parameter `T`, found `()`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
= note: expected type parameter `T`
|
||||
found unit type `()`
|
||||
note: associated function defined here
|
||||
--> $DIR/issue-68648-2.rs:6:8
|
||||
|
|
||||
LL | fn identity<'a>(t: Self::F<'a>) -> Self::F<'a> { t }
|
||||
| ^^^^^^^^ --------------
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -17,10 +17,17 @@ LL | impl<B> Add for A<B> where B: Add {
|
|||
| - this type parameter
|
||||
...
|
||||
LL | A(self.0 + rhs.0)
|
||||
| ^^^^^^^^^^^^^^ expected type parameter `B`, found associated type
|
||||
| - ^^^^^^^^^^^^^^ expected type parameter `B`, found associated type
|
||||
| |
|
||||
| arguments to this struct are incorrect
|
||||
|
|
||||
= note: expected type parameter `B`
|
||||
found associated type `<B as Add>::Output`
|
||||
note: tuple struct defined here
|
||||
--> $DIR/missing-bounds.rs:5:8
|
||||
|
|
||||
LL | struct A<B>(B);
|
||||
| ^
|
||||
help: consider further restricting this bound
|
||||
|
|
||||
LL | impl<B> Add for A<B> where B: Add + Add<Output = B> {
|
||||
|
|
@ -33,10 +40,17 @@ LL | impl<B: Add> Add for C<B> {
|
|||
| - this type parameter
|
||||
...
|
||||
LL | Self(self.0 + rhs.0)
|
||||
| ^^^^^^^^^^^^^^ expected type parameter `B`, found associated type
|
||||
| ---- ^^^^^^^^^^^^^^ expected type parameter `B`, found associated type
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
= note: expected type parameter `B`
|
||||
found associated type `<B as Add>::Output`
|
||||
note: tuple struct defined here
|
||||
--> $DIR/missing-bounds.rs:15:8
|
||||
|
|
||||
LL | struct C<B>(B);
|
||||
| ^
|
||||
help: consider further restricting this bound
|
||||
|
|
||||
LL | impl<B: Add + Add<Output = B>> Add for C<B> {
|
||||
|
|
@ -62,10 +76,17 @@ LL | impl<B: Add> Add for E<B> where <B as Add>::Output = B {
|
|||
| - this type parameter
|
||||
...
|
||||
LL | Self(self.0 + rhs.0)
|
||||
| ^^^^^^^^^^^^^^ expected type parameter `B`, found associated type
|
||||
| ---- ^^^^^^^^^^^^^^ expected type parameter `B`, found associated type
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
= note: expected type parameter `B`
|
||||
found associated type `<B as Add>::Output`
|
||||
note: tuple struct defined here
|
||||
--> $DIR/missing-bounds.rs:35:8
|
||||
|
|
||||
LL | struct E<B>(B);
|
||||
| ^
|
||||
help: consider further restricting type parameter `B`
|
||||
|
|
||||
LL | impl<B: Add> Add for E<B> where <B as Add>::Output = B, B: Add<Output = B> {
|
||||
|
|
|
|||
|
|
@ -2,15 +2,17 @@ error[E0061]: this function takes 1 argument but 0 arguments were supplied
|
|||
--> $DIR/issue-58451.rs:12:9
|
||||
|
|
||||
LL | f(&[f()]);
|
||||
| ^-- supplied 0 arguments
|
||||
| |
|
||||
| expected 1 argument
|
||||
| ^-- an argument is missing
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/issue-58451.rs:5:4
|
||||
|
|
||||
LL | fn f<I>(i: I)
|
||||
| ^ ----
|
||||
help: provide the argument
|
||||
|
|
||||
LL | f(&[f({_})]);
|
||||
| ~~~~~~
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,9 @@ LL | type Closure = impl Fn() -> u64;
|
|||
| ---------------- the expected opaque type
|
||||
...
|
||||
LL | Anonymous(|| {
|
||||
| _______________^
|
||||
| _____---------_^
|
||||
| | |
|
||||
| | arguments to this struct are incorrect
|
||||
LL | | 3
|
||||
LL | | })
|
||||
| |_____^ expected closure, found a different closure
|
||||
|
|
@ -14,6 +16,11 @@ LL | | })
|
|||
found closure `[closure@$DIR/issue-74282.rs:8:15: 10:6]`
|
||||
= note: no two closures, even if identical, have the same type
|
||||
= help: consider boxing your closure and/or using it as a trait object
|
||||
note: tuple struct defined here
|
||||
--> $DIR/issue-74282.rs:4:8
|
||||
|
|
||||
LL | struct Anonymous(Closure);
|
||||
| ^^^^^^^^^
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-74282.rs:8:5
|
||||
|
|
|
|||
|
|
@ -12,12 +12,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/indexing-requires-a-uint.rs:12:18
|
||||
|
|
||||
LL | bar::<isize>(i); // i should not be re-coerced back to an isize
|
||||
| ^ expected `isize`, found `usize`
|
||||
| ------------ ^ expected `isize`, found `usize`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
help: you can convert a `usize` to an `isize` and panic if the converted value doesn't fit
|
||||
note: function defined here
|
||||
--> $DIR/indexing-requires-a-uint.rs:5:8
|
||||
|
|
||||
LL | bar::<isize>(i.try_into().unwrap()); // i should not be re-coerced back to an isize
|
||||
| ++++++++++++++++++++
|
||||
LL | fn bar<T>(_: T) {}
|
||||
| ^^^ ----
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -2,16 +2,30 @@ error[E0308]: mismatched types
|
|||
--> $DIR/deref-suggestion.rs:8:9
|
||||
|
|
||||
LL | foo(s);
|
||||
| ^- help: try using a conversion method: `.to_string()`
|
||||
| |
|
||||
| expected struct `String`, found `&String`
|
||||
| --- ^- help: try using a conversion method: `.to_string()`
|
||||
| | |
|
||||
| | expected struct `String`, found `&String`
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/deref-suggestion.rs:5:4
|
||||
|
|
||||
LL | fn foo(_: String) {}
|
||||
| ^^^ ---------
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/deref-suggestion.rs:14:10
|
||||
|
|
||||
LL | foo3(u);
|
||||
| ^ expected `u32`, found `&u32`
|
||||
| ---- ^ expected `u32`, found `&u32`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/deref-suggestion.rs:12:4
|
||||
|
|
||||
LL | fn foo3(_: u32) {}
|
||||
| ^^^^ ------
|
||||
help: consider dereferencing the borrow
|
||||
|
|
||||
LL | foo3(*u);
|
||||
|
|
@ -21,8 +35,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/deref-suggestion.rs:30:9
|
||||
|
|
||||
LL | foo(&"aaa".to_owned());
|
||||
| ^^^^^^^^^^^^^^^^^ expected struct `String`, found `&String`
|
||||
| --- ^^^^^^^^^^^^^^^^^ expected struct `String`, found `&String`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/deref-suggestion.rs:5:4
|
||||
|
|
||||
LL | fn foo(_: String) {}
|
||||
| ^^^ ---------
|
||||
help: consider removing the borrow
|
||||
|
|
||||
LL - foo(&"aaa".to_owned());
|
||||
|
|
@ -33,8 +54,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/deref-suggestion.rs:32:9
|
||||
|
|
||||
LL | foo(&mut "aaa".to_owned());
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ expected struct `String`, found `&mut String`
|
||||
| --- ^^^^^^^^^^^^^^^^^^^^^ expected struct `String`, found `&mut String`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/deref-suggestion.rs:5:4
|
||||
|
|
||||
LL | fn foo(_: String) {}
|
||||
| ^^^ ---------
|
||||
help: consider removing the borrow
|
||||
|
|
||||
LL - foo(&mut "aaa".to_owned());
|
||||
|
|
@ -48,8 +76,15 @@ LL | ($x:expr) => { &$x }
|
|||
| ^^^ expected `u32`, found `&{integer}`
|
||||
...
|
||||
LL | foo3(borrow!(0));
|
||||
| ---------- in this macro invocation
|
||||
| ---- ---------- in this macro invocation
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/deref-suggestion.rs:12:4
|
||||
|
|
||||
LL | fn foo3(_: u32) {}
|
||||
| ^^^^ ------
|
||||
= note: this error originates in the macro `borrow` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0308]: mismatched types
|
||||
|
|
|
|||
|
|
@ -2,8 +2,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/tutorial-suffix-inference-test.rs:9:18
|
||||
|
|
||||
LL | identity_u16(x);
|
||||
| ^ expected `u16`, found `u8`
|
||||
| ------------ ^ expected `u16`, found `u8`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/tutorial-suffix-inference-test.rs:6:8
|
||||
|
|
||||
LL | fn identity_u16(n: u16) -> u16 { n }
|
||||
| ^^^^^^^^^^^^ ------
|
||||
help: you can convert a `u8` to a `u16`
|
||||
|
|
||||
LL | identity_u16(x.into());
|
||||
|
|
@ -13,8 +20,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/tutorial-suffix-inference-test.rs:12:18
|
||||
|
|
||||
LL | identity_u16(y);
|
||||
| ^ expected `u16`, found `i32`
|
||||
| ------------ ^ expected `u16`, found `i32`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/tutorial-suffix-inference-test.rs:6:8
|
||||
|
|
||||
LL | fn identity_u16(n: u16) -> u16 { n }
|
||||
| ^^^^^^^^^^^^ ------
|
||||
help: you can convert an `i32` to a `u16` and panic if the converted value doesn't fit
|
||||
|
|
||||
LL | identity_u16(y.try_into().unwrap());
|
||||
|
|
@ -24,8 +38,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/tutorial-suffix-inference-test.rs:21:18
|
||||
|
|
||||
LL | identity_u16(a);
|
||||
| ^ expected `u16`, found `isize`
|
||||
| ------------ ^ expected `u16`, found `isize`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/tutorial-suffix-inference-test.rs:6:8
|
||||
|
|
||||
LL | fn identity_u16(n: u16) -> u16 { n }
|
||||
| ^^^^^^^^^^^^ ------
|
||||
help: you can convert an `isize` to a `u16` and panic if the converted value doesn't fit
|
||||
|
|
||||
LL | identity_u16(a.try_into().unwrap());
|
||||
|
|
|
|||
|
|
@ -2,10 +2,17 @@ error[E0308]: mismatched types
|
|||
--> $DIR/issue-10764.rs:4:15
|
||||
|
|
||||
LL | fn main() { f(bar) }
|
||||
| ^^^ expected "Rust" fn, found "C" fn
|
||||
| - ^^^ expected "Rust" fn, found "C" fn
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
= note: expected fn pointer `fn()`
|
||||
found fn item `extern "C" fn() {bar}`
|
||||
note: function defined here
|
||||
--> $DIR/issue-10764.rs:1:4
|
||||
|
|
||||
LL | fn f(_: extern "Rust" fn()) {}
|
||||
| ^ ---------------------
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -2,13 +2,19 @@ error[E0308]: mismatched types
|
|||
--> $DIR/issue-11374.rs:26:15
|
||||
|
|
||||
LL | c.read_to(v);
|
||||
| ^
|
||||
| |
|
||||
| expected `&mut [u8]`, found struct `Vec`
|
||||
| help: consider mutably borrowing here: `&mut v`
|
||||
| ------- ^
|
||||
| | |
|
||||
| | expected `&mut [u8]`, found struct `Vec`
|
||||
| | help: consider mutably borrowing here: `&mut v`
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
= note: expected mutable reference `&mut [u8]`
|
||||
found struct `Vec<_>`
|
||||
note: associated function defined here
|
||||
--> $DIR/issue-11374.rs:13:12
|
||||
|
|
||||
LL | pub fn read_to(&mut self, vec: &mut [u8]) {
|
||||
| ^^^^^^^ --------- --------------
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,8 +4,16 @@ error[E0308]: mismatched types
|
|||
LL | #[bench]
|
||||
| -------- in this procedural macro expansion
|
||||
LL | fn bar(x: isize) { }
|
||||
| ^^^^^^^^^^^^^^^^^^^^ expected `isize`, found `&mut Bencher`
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
| |
|
||||
| expected `isize`, found `&mut Bencher`
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/issue-12997-2.rs:8:4
|
||||
|
|
||||
LL | fn bar(x: isize) { }
|
||||
| ^^^ --------
|
||||
= note: this error originates in the attribute macro `bench` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: aborting due to previous error
|
||||
|
|
|
|||
|
|
@ -2,23 +2,29 @@ error[E0308]: mismatched types
|
|||
--> $DIR/issue-13359.rs:6:9
|
||||
|
|
||||
LL | foo(1*(1 as isize));
|
||||
| ^^^^^^^^^^^^^^ expected `i16`, found `isize`
|
||||
| --- ^^^^^^^^^^^^^^ expected `i16`, found `isize`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
help: you can convert an `isize` to an `i16` and panic if the converted value doesn't fit
|
||||
note: function defined here
|
||||
--> $DIR/issue-13359.rs:1:4
|
||||
|
|
||||
LL | foo((1*(1 as isize)).try_into().unwrap());
|
||||
| + +++++++++++++++++++++
|
||||
LL | fn foo(_s: i16) { }
|
||||
| ^^^ -------
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-13359.rs:10:9
|
||||
|
|
||||
LL | bar(1*(1 as usize));
|
||||
| ^^^^^^^^^^^^^^ expected `u32`, found `usize`
|
||||
| --- ^^^^^^^^^^^^^^ expected `u32`, found `usize`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
help: you can convert a `usize` to a `u32` and panic if the converted value doesn't fit
|
||||
note: function defined here
|
||||
--> $DIR/issue-13359.rs:3:4
|
||||
|
|
||||
LL | bar((1*(1 as usize)).try_into().unwrap());
|
||||
| + +++++++++++++++++++++
|
||||
LL | fn bar(_s: u32) { }
|
||||
| ^^^ -------
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -20,13 +20,19 @@ error[E0308]: mismatched types
|
|||
--> $DIR/issue-13853.rs:37:13
|
||||
|
|
||||
LL | iterate(graph);
|
||||
| ^^^^^
|
||||
| |
|
||||
| expected reference, found struct `Vec`
|
||||
| help: consider borrowing here: `&graph`
|
||||
| ------- ^^^^^
|
||||
| | |
|
||||
| | expected reference, found struct `Vec`
|
||||
| | help: consider borrowing here: `&graph`
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
= note: expected reference `&_`
|
||||
found struct `Vec<Stuff>`
|
||||
note: function defined here
|
||||
--> $DIR/issue-13853.rs:26:4
|
||||
|
|
||||
LL | fn iterate<N: Node, G: Graph<N>>(graph: &G) {
|
||||
| ^^^^^^^ ---------
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -2,8 +2,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/issue-1448-2.rs:6:24
|
||||
|
|
||||
LL | println!("{}", foo(10i32));
|
||||
| ^^^^^ expected `u32`, found `i32`
|
||||
| --- ^^^^^ expected `u32`, found `i32`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/issue-1448-2.rs:3:4
|
||||
|
|
||||
LL | fn foo(a: u32) -> u32 { a }
|
||||
| ^^^ ------
|
||||
help: change the type of the numeric literal from `i32` to `u32`
|
||||
|
|
||||
LL | println!("{}", foo(10u32));
|
||||
|
|
|
|||
|
|
@ -2,10 +2,17 @@ error[E0308]: mismatched types
|
|||
--> $DIR/issue-15783.rs:8:19
|
||||
|
|
||||
LL | let msg = foo(x);
|
||||
| ^ expected slice `[&str]`, found array `[&str; 1]`
|
||||
| --- ^ expected slice `[&str]`, found array `[&str; 1]`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
= note: expected enum `Option<&[&str]>`
|
||||
found enum `Option<&[&str; 1]>`
|
||||
note: function defined here
|
||||
--> $DIR/issue-15783.rs:1:8
|
||||
|
|
||||
LL | pub fn foo(params: Option<&[&str]>) -> usize {
|
||||
| ^^^ -----------------------
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -2,15 +2,17 @@ error[E0057]: this function takes 0 arguments but 1 argument was supplied
|
|||
--> $DIR/issue-16939.rs:5:9
|
||||
|
|
||||
LL | |t| f(t);
|
||||
| ^ - supplied 1 argument
|
||||
| |
|
||||
| expected 0 arguments
|
||||
| ^ - argument unexpected
|
||||
|
|
||||
note: associated function defined here
|
||||
--> $SRC_DIR/core/src/ops/function.rs:LL:COL
|
||||
|
|
||||
LL | extern "rust-call" fn call(&self, args: Args) -> Self::Output;
|
||||
| ^^^^
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL | |t| f();
|
||||
| ~~~
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -2,10 +2,11 @@ error[E0308]: mismatched types
|
|||
--> $DIR/issue-17033.rs:2:10
|
||||
|
|
||||
LL | (*p)(())
|
||||
| ^^
|
||||
| |
|
||||
| expected `&mut ()`, found `()`
|
||||
| help: consider mutably borrowing here: `&mut ()`
|
||||
| ---- ^^
|
||||
| | |
|
||||
| | expected `&mut ()`, found `()`
|
||||
| | help: consider mutably borrowing here: `&mut ()`
|
||||
| arguments to this function are incorrect
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -2,15 +2,26 @@ error[E0061]: this function takes 2 arguments but 1 argument was supplied
|
|||
--> $DIR/issue-18819.rs:16:5
|
||||
|
|
||||
LL | print_x(X);
|
||||
| ^^^^^^^ - supplied 1 argument
|
||||
| |
|
||||
| expected 2 arguments
|
||||
| ^^^^^^^---
|
||||
| ||
|
||||
| |expected reference, found struct `X`
|
||||
| an argument of type `&str` is missing
|
||||
|
|
||||
= note: expected reference `&dyn Foo<Item = bool>`
|
||||
found struct `X`
|
||||
note: function defined here
|
||||
--> $DIR/issue-18819.rs:11:4
|
||||
|
|
||||
LL | fn print_x(_: &dyn Foo<Item=bool>, extra: &str) {
|
||||
| ^^^^^^^ ---------------------- -----------
|
||||
help: consider borrowing here
|
||||
|
|
||||
LL | print_x(&X);
|
||||
| ~~
|
||||
help: provide the argument
|
||||
|
|
||||
LL | print_x({&dyn Foo<Item = bool>}, {&str});
|
||||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -2,10 +2,17 @@ error[E0308]: mismatched types
|
|||
--> $DIR/issue-24819.rs:5:9
|
||||
|
|
||||
LL | foo(&mut v);
|
||||
| ^^^^^^ expected struct `HashSet`, found struct `Vec`
|
||||
| --- ^^^^^^ expected struct `HashSet`, found struct `Vec`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
= note: expected mutable reference `&mut HashSet<u32>`
|
||||
found mutable reference `&mut Vec<_>`
|
||||
note: function defined here
|
||||
--> $DIR/issue-24819.rs:10:4
|
||||
|
|
||||
LL | fn foo(h: &mut HashSet<u32>) {
|
||||
| ^^^ --------------------
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
macro_rules! some_macro {
|
||||
($other: expr) => ({
|
||||
$other(None) //~ NOTE supplied 1 argument
|
||||
$other(None) //~ NOTE argument unexpected
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -9,5 +9,5 @@ fn some_function() {} //~ NOTE defined here
|
|||
fn main() {
|
||||
some_macro!(some_function);
|
||||
//~^ ERROR this function takes 0 arguments but 1 argument was supplied
|
||||
//~| NOTE expected 0 arguments
|
||||
//~| NOTE in this expansion of some_macro!
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,16 +2,20 @@ error[E0061]: this function takes 0 arguments but 1 argument was supplied
|
|||
--> $DIR/issue-26094.rs:10:17
|
||||
|
|
||||
LL | $other(None)
|
||||
| ---- supplied 1 argument
|
||||
| ---- argument unexpected
|
||||
...
|
||||
LL | some_macro!(some_function);
|
||||
| ^^^^^^^^^^^^^ expected 0 arguments
|
||||
| ^^^^^^^^^^^^^
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/issue-26094.rs:7:4
|
||||
|
|
||||
LL | fn some_function() {}
|
||||
| ^^^^^^^^^^^^^
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL | some_function()
|
||||
| ~~~~~~~~~~~~~~~
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -2,5 +2,6 @@ fn main() {
|
|||
let needlesArr: Vec<char> = vec!['a', 'f'];
|
||||
needlesArr.iter().fold(|x, y| {
|
||||
});
|
||||
//~^^ ERROR this function takes 2 arguments but 1 argument was supplied
|
||||
//~^^ ERROR mismatched types
|
||||
//~| ERROR this function takes 2 arguments but 1 argument was supplied
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,19 +1,34 @@
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-3044.rs:3:35
|
||||
|
|
||||
LL | needlesArr.iter().fold(|x, y| {
|
||||
| ___________________________________^
|
||||
LL | | });
|
||||
| |_____^ expected closure, found `()`
|
||||
|
|
||||
= note: expected closure `[closure@$DIR/issue-3044.rs:3:28: 4:6]`
|
||||
found unit type `()`
|
||||
|
||||
error[E0061]: this function takes 2 arguments but 1 argument was supplied
|
||||
--> $DIR/issue-3044.rs:3:23
|
||||
|
|
||||
LL | needlesArr.iter().fold(|x, y| {
|
||||
| _______________________^^^^_-
|
||||
| | |
|
||||
| | expected 2 arguments
|
||||
| _______________________^^^^-
|
||||
LL | | });
|
||||
| |_____- supplied 1 argument
|
||||
| |______- an argument is missing
|
||||
|
|
||||
note: associated function defined here
|
||||
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
||||
|
|
||||
LL | fn fold<B, F>(mut self, init: B, mut f: F) -> B
|
||||
| ^^^^
|
||||
help: provide the argument
|
||||
|
|
||||
LL ~ needlesArr.iter().fold(|x, y| {
|
||||
LL ~ }, {_});
|
||||
|
|
||||
|
||||
error: aborting due to previous error
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0061`.
|
||||
Some errors have detailed explanations: E0061, E0308.
|
||||
For more information about an error, try `rustc --explain E0061`.
|
||||
|
|
|
|||
|
|
@ -2,10 +2,17 @@ error[E0308]: mismatched types
|
|||
--> $DIR/issue-43420-no-over-suggest.rs:8:9
|
||||
|
|
||||
LL | foo(&a);
|
||||
| ^^ expected slice `[u16]`, found struct `Vec`
|
||||
| --- ^^ expected slice `[u16]`, found struct `Vec`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
= note: expected reference `&[u16]`
|
||||
found reference `&Vec<u8>`
|
||||
note: function defined here
|
||||
--> $DIR/issue-43420-no-over-suggest.rs:4:4
|
||||
|
|
||||
LL | fn foo(b: &[u16]) {}
|
||||
| ^^^ ---------
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/issue-4517.rs:5:9
|
||||
|
|
||||
LL | bar(foo);
|
||||
| ^^^ expected `usize`, found array `[u8; 4]`
|
||||
| --- ^^^ expected `usize`, found array `[u8; 4]`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/issue-4517.rs:1:4
|
||||
|
|
||||
LL | fn bar(int_param: usize) {}
|
||||
| ^^^ ----------------
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -2,19 +2,33 @@ error[E0308]: mismatched types
|
|||
--> $DIR/issue-46756-consider-borrowing-cast-or-binexpr.rs:12:42
|
||||
|
|
||||
LL | light_flows_our_war_of_mocking_words(behold as usize);
|
||||
| ^^^^^^^^^^^^^^^
|
||||
| |
|
||||
| expected `&usize`, found `usize`
|
||||
| help: consider borrowing here: `&(behold as usize)`
|
||||
| ------------------------------------ ^^^^^^^^^^^^^^^
|
||||
| | |
|
||||
| | expected `&usize`, found `usize`
|
||||
| | help: consider borrowing here: `&(behold as usize)`
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/issue-46756-consider-borrowing-cast-or-binexpr.rs:5:4
|
||||
|
|
||||
LL | fn light_flows_our_war_of_mocking_words(and_yet: &usize) -> usize {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ---------------
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-46756-consider-borrowing-cast-or-binexpr.rs:14:42
|
||||
|
|
||||
LL | light_flows_our_war_of_mocking_words(with_tears + 4);
|
||||
| ^^^^^^^^^^^^^^
|
||||
| |
|
||||
| expected `&usize`, found `usize`
|
||||
| help: consider borrowing here: `&(with_tears + 4)`
|
||||
| ------------------------------------ ^^^^^^^^^^^^^^
|
||||
| | |
|
||||
| | expected `&usize`, found `usize`
|
||||
| | help: consider borrowing here: `&(with_tears + 4)`
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/issue-46756-consider-borrowing-cast-or-binexpr.rs:5:4
|
||||
|
|
||||
LL | fn light_flows_our_war_of_mocking_words(and_yet: &usize) -> usize {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ---------------
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -2,10 +2,17 @@ error[E0308]: mismatched types
|
|||
--> $DIR/issue-48364.rs:2:21
|
||||
|
|
||||
LL | b"".starts_with(stringify!(foo))
|
||||
| ^^^^^^^^^^^^^^^ expected slice `[u8]`, found `str`
|
||||
| ----------- ^^^^^^^^^^^^^^^ expected slice `[u8]`, found `str`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
= note: expected reference `&[u8]`
|
||||
found reference `&'static str`
|
||||
note: associated function defined here
|
||||
--> $SRC_DIR/core/src/slice/mod.rs:LL:COL
|
||||
|
|
||||
LL | pub fn starts_with(&self, needle: &[T]) -> bool
|
||||
| ^^^^^^^^^^^
|
||||
= note: this error originates in the macro `stringify` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: aborting due to previous error
|
||||
|
|
|
|||
|
|
@ -2,15 +2,17 @@ error[E0061]: this function takes 1 argument but 2 arguments were supplied
|
|||
--> $DIR/issue-4935.rs:5:13
|
||||
|
|
||||
LL | fn main() { foo(5, 6) }
|
||||
| ^^^ - - supplied 2 arguments
|
||||
| |
|
||||
| expected 1 argument
|
||||
| ^^^ - argument unexpected
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/issue-4935.rs:3:4
|
||||
|
|
||||
LL | fn foo(a: usize) {}
|
||||
| ^^^ --------
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL | fn main() { foo(5) }
|
||||
| ~~~~~~
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,11 +4,18 @@ error[E0308]: mismatched types
|
|||
LL | fn foo<F: FnMut()>() {
|
||||
| - this type parameter
|
||||
LL | let _: Box<F> = Box::new(|| ());
|
||||
| ^^^^^ expected type parameter `F`, found closure
|
||||
| -------- ^^^^^ expected type parameter `F`, found closure
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
= note: expected type parameter `F`
|
||||
found closure `[closure@$DIR/issue-51154.rs:2:30: 2:35]`
|
||||
= help: every closure has a distinct type and so could not always match the caller-chosen type of parameter `F`
|
||||
note: associated function defined here
|
||||
--> $SRC_DIR/alloc/src/boxed.rs:LL:COL
|
||||
|
|
||||
LL | pub fn new(x: T) -> Self {
|
||||
| ^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -2,10 +2,17 @@ error[E0308]: mismatched types
|
|||
--> $DIR/issue-5216.rs:3:21
|
||||
|
|
||||
LL | pub static C: S = S(f);
|
||||
| ^ expected struct `Box`, found fn item
|
||||
| - ^ expected struct `Box`, found fn item
|
||||
| |
|
||||
| arguments to this struct are incorrect
|
||||
|
|
||||
= note: expected struct `Box<(dyn FnMut() + Sync + 'static)>`
|
||||
found fn item `fn() {f}`
|
||||
note: tuple struct defined here
|
||||
--> $DIR/issue-5216.rs:2:8
|
||||
|
|
||||
LL | struct S(Box<dyn FnMut() + Sync>);
|
||||
| ^
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-5216.rs:8:19
|
||||
|
|
|
|||
|
|
@ -2,10 +2,17 @@ error[E0308]: mismatched types
|
|||
--> $DIR/issue-61106.rs:3:9
|
||||
|
|
||||
LL | foo(x.clone());
|
||||
| ^^^^^^^^^
|
||||
| |
|
||||
| expected `&str`, found struct `String`
|
||||
| help: consider borrowing here: `&x`
|
||||
| --- ^^^^^^^^^
|
||||
| | |
|
||||
| | expected `&str`, found struct `String`
|
||||
| | help: consider borrowing here: `&x`
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/issue-61106.rs:6:4
|
||||
|
|
||||
LL | fn foo(_: &str) {}
|
||||
| ^^^ -------
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,17 @@ error[E0308]: mismatched types
|
|||
LL | impl<T> S0<T> {
|
||||
| - this type parameter
|
||||
LL | const C: S0<u8> = Self(0);
|
||||
| ^ expected type parameter `T`, found integer
|
||||
| ---- ^ expected type parameter `T`, found integer
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
= note: expected type parameter `T`
|
||||
found type `{integer}`
|
||||
note: tuple struct defined here
|
||||
--> $DIR/issue-69306.rs:3:8
|
||||
|
|
||||
LL | struct S0<T>(T);
|
||||
| ^^
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-69306.rs:5:23
|
||||
|
|
@ -27,10 +34,17 @@ LL | impl<T> S0<T> {
|
|||
| - this type parameter
|
||||
...
|
||||
LL | Self(0);
|
||||
| ^ expected type parameter `T`, found integer
|
||||
| ---- ^ expected type parameter `T`, found integer
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
= note: expected type parameter `T`
|
||||
found type `{integer}`
|
||||
note: tuple struct defined here
|
||||
--> $DIR/issue-69306.rs:3:8
|
||||
|
|
||||
LL | struct S0<T>(T);
|
||||
| ^^
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-69306.rs:27:14
|
||||
|
|
@ -39,10 +53,17 @@ LL | impl<T> Foo<T> for <S0<T> as Fun>::Out {
|
|||
| - this type parameter
|
||||
LL | fn foo() {
|
||||
LL | Self(0);
|
||||
| ^ expected type parameter `T`, found integer
|
||||
| ---- ^ expected type parameter `T`, found integer
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
= note: expected type parameter `T`
|
||||
found type `{integer}`
|
||||
note: tuple struct defined here
|
||||
--> $DIR/issue-69306.rs:3:8
|
||||
|
|
||||
LL | struct S0<T>(T);
|
||||
| ^^
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-69306.rs:33:32
|
||||
|
|
@ -50,10 +71,17 @@ error[E0308]: mismatched types
|
|||
LL | impl<T> S1<T, u8> {
|
||||
| - this type parameter
|
||||
LL | const C: S1<u8, u8> = Self(0, 1);
|
||||
| ^ expected type parameter `T`, found integer
|
||||
| ---- ^ expected type parameter `T`, found integer
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
= note: expected type parameter `T`
|
||||
found type `{integer}`
|
||||
note: tuple struct defined here
|
||||
--> $DIR/issue-69306.rs:31:8
|
||||
|
|
||||
LL | struct S1<T, U>(T, U);
|
||||
| ^^
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-69306.rs:33:27
|
||||
|
|
@ -74,12 +102,19 @@ LL | impl<T> S2<T> {
|
|||
LL | fn map<U>(x: U) -> S2<U> {
|
||||
| - found type parameter
|
||||
LL | Self(x)
|
||||
| ^ expected type parameter `T`, found type parameter `U`
|
||||
| ---- ^ expected type parameter `T`, found type parameter `U`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
= note: expected type parameter `T`
|
||||
found type parameter `U`
|
||||
= note: a type parameter was expected, but a different one was found; you might be missing a type parameter or trait bound
|
||||
= note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters
|
||||
note: tuple struct defined here
|
||||
--> $DIR/issue-69306.rs:38:8
|
||||
|
|
||||
LL | struct S2<T>(T);
|
||||
| ^^
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-69306.rs:41:9
|
||||
|
|
|
|||
|
|
@ -2,11 +2,21 @@ error[E0308]: mismatched types
|
|||
--> $DIR/issue-29084.rs:4:13
|
||||
|
|
||||
LL | bar(&mut $d);
|
||||
| ^^^^^^^ expected `u8`, found `&mut u8`
|
||||
| --- ^^^^^^^ expected `u8`, found `&mut u8`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
...
|
||||
LL | foo!(0u8);
|
||||
| --------- in this macro invocation
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/issue-29084.rs:3:12
|
||||
|
|
||||
LL | fn bar(d: u8) { }
|
||||
| ^^^ -----
|
||||
...
|
||||
LL | foo!(0u8);
|
||||
| --------- in this macro invocation
|
||||
= note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: aborting due to previous error
|
||||
|
|
|
|||
|
|
@ -2,43 +2,49 @@ error[E0061]: this function takes 0 arguments but 1 argument was supplied
|
|||
--> $DIR/method-call-err-msg.rs:13:7
|
||||
|
|
||||
LL | x.zero(0)
|
||||
| ^^^^ - supplied 1 argument
|
||||
| |
|
||||
| expected 0 arguments
|
||||
| ^^^^ - argument unexpected
|
||||
|
|
||||
note: associated function defined here
|
||||
--> $DIR/method-call-err-msg.rs:5:8
|
||||
|
|
||||
LL | fn zero(self) -> Foo { self }
|
||||
| ^^^^ ----
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL | x.zero()
|
||||
| ~~~~~~
|
||||
|
||||
error[E0061]: this function takes 1 argument but 0 arguments were supplied
|
||||
--> $DIR/method-call-err-msg.rs:14:7
|
||||
|
|
||||
LL | .one()
|
||||
| ^^^- supplied 0 arguments
|
||||
| |
|
||||
| expected 1 argument
|
||||
| ^^^-- an argument of type `isize` is missing
|
||||
|
|
||||
note: associated function defined here
|
||||
--> $DIR/method-call-err-msg.rs:6:8
|
||||
|
|
||||
LL | fn one(self, _: isize) -> Foo { self }
|
||||
| ^^^ ---- --------
|
||||
help: provide the argument
|
||||
|
|
||||
LL | .one({isize})
|
||||
| ~~~~~~~~~~~~
|
||||
|
||||
error[E0061]: this function takes 2 arguments but 1 argument was supplied
|
||||
--> $DIR/method-call-err-msg.rs:15:7
|
||||
|
|
||||
LL | .two(0);
|
||||
| ^^^ - supplied 1 argument
|
||||
| |
|
||||
| expected 2 arguments
|
||||
| ^^^--- an argument of type `isize` is missing
|
||||
|
|
||||
note: associated function defined here
|
||||
--> $DIR/method-call-err-msg.rs:7:8
|
||||
|
|
||||
LL | fn two(self, _: isize, _: isize) -> Foo { self }
|
||||
| ^^^ ---- -------- --------
|
||||
help: provide the argument
|
||||
|
|
||||
LL | .two(0, {isize});
|
||||
| ~~~~~~~~~~~~~~~
|
||||
|
||||
error[E0599]: `Foo` is not an iterator
|
||||
--> $DIR/method-call-err-msg.rs:19:7
|
||||
|
|
@ -74,15 +80,17 @@ error[E0061]: this function takes 3 arguments but 0 arguments were supplied
|
|||
--> $DIR/method-call-err-msg.rs:21:7
|
||||
|
|
||||
LL | y.three::<usize>();
|
||||
| ^^^^^--------- supplied 0 arguments
|
||||
| |
|
||||
| expected 3 arguments
|
||||
| ^^^^^^^^^^^^^^-- three arguments of type `usize`, `usize`, and `usize` are missing
|
||||
|
|
||||
note: associated function defined here
|
||||
--> $DIR/method-call-err-msg.rs:8:8
|
||||
|
|
||||
LL | fn three<T>(self, _: T, _: T, _: T) -> Foo { self }
|
||||
| ^^^^^ ---- ---- ---- ----
|
||||
help: provide the arguments
|
||||
|
|
||||
LL | y.three::<usize>({usize}, {usize}, {usize});
|
||||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -2,19 +2,33 @@ error[E0308]: mismatched types
|
|||
--> $DIR/method-self-arg-1.rs:11:14
|
||||
|
|
||||
LL | Foo::bar(x);
|
||||
| ^
|
||||
| |
|
||||
| expected `&Foo`, found struct `Foo`
|
||||
| help: consider borrowing here: `&x`
|
||||
| -------- ^
|
||||
| | |
|
||||
| | expected `&Foo`, found struct `Foo`
|
||||
| | help: consider borrowing here: `&x`
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: associated function defined here
|
||||
--> $DIR/method-self-arg-1.rs:6:8
|
||||
|
|
||||
LL | fn bar(&self) {}
|
||||
| ^^^ -----
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/method-self-arg-1.rs:13:14
|
||||
|
|
||||
LL | Foo::bar(&42);
|
||||
| ^^^ expected struct `Foo`, found integer
|
||||
| -------- ^^^ expected struct `Foo`, found integer
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
= note: expected reference `&Foo`
|
||||
found reference `&{integer}`
|
||||
note: associated function defined here
|
||||
--> $DIR/method-self-arg-1.rs:6:8
|
||||
|
|
||||
LL | fn bar(&self) {}
|
||||
| ^^^ -----
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -1,17 +1,20 @@
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-26480.rs:16:19
|
||||
|
|
||||
LL | write(stdout, $arr.as_ptr() as *const i8,
|
||||
| ----- arguments to this function are incorrect
|
||||
LL | $arr.len() * size_of($arr[0]));
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u64`, found `usize`
|
||||
...
|
||||
LL | write!(hello);
|
||||
| ------------- in this macro invocation
|
||||
|
|
||||
= note: this error originates in the macro `write` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
help: you can convert a `usize` to a `u64` and panic if the converted value doesn't fit
|
||||
note: function defined here
|
||||
--> $DIR/issue-26480.rs:2:8
|
||||
|
|
||||
LL | ($arr.len() * size_of($arr[0])).try_into().unwrap());
|
||||
| + +++++++++++++++++++++
|
||||
LL | fn write(fildes: i32, buf: *const i8, nbyte: u64) -> i64;
|
||||
| ^^^^^
|
||||
= note: this error originates in the macro `write` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0605]: non-primitive cast: `{integer}` as `()`
|
||||
--> $DIR/issue-26480.rs:22:19
|
||||
|
|
|
|||
|
|
@ -5,7 +5,9 @@ LL | impl<bool> Parser<bool> for bool {
|
|||
| ---- this type parameter
|
||||
LL | fn parse(text: &str) -> Option<bool> {
|
||||
LL | Some(true)
|
||||
| ^^^^ expected type parameter `bool`, found `bool`
|
||||
| ---- ^^^^ expected type parameter `bool`, found `bool`
|
||||
| |
|
||||
| arguments to this enum variant are incorrect
|
||||
|
|
||||
= note: expected type parameter `bool` (type parameter `bool`)
|
||||
found type `bool` (`bool`)
|
||||
|
|
|
|||
|
|
@ -2,8 +2,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/numeric-literal-cast.rs:6:9
|
||||
|
|
||||
LL | foo(1u8);
|
||||
| ^^^ expected `u16`, found `u8`
|
||||
| --- ^^^ expected `u16`, found `u8`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/numeric-literal-cast.rs:1:4
|
||||
|
|
||||
LL | fn foo(_: u16) {}
|
||||
| ^^^ ------
|
||||
help: change the type of the numeric literal from `u8` to `u16`
|
||||
|
|
||||
LL | foo(1u16);
|
||||
|
|
@ -13,8 +20,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/numeric-literal-cast.rs:8:10
|
||||
|
|
||||
LL | foo1(2f32);
|
||||
| ^^^^ expected `f64`, found `f32`
|
||||
| ---- ^^^^ expected `f64`, found `f32`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/numeric-literal-cast.rs:2:4
|
||||
|
|
||||
LL | fn foo1(_: f64) {}
|
||||
| ^^^^ ------
|
||||
help: change the type of the numeric literal from `f32` to `f64`
|
||||
|
|
||||
LL | foo1(2f64);
|
||||
|
|
@ -24,8 +38,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/numeric-literal-cast.rs:10:10
|
||||
|
|
||||
LL | foo2(3i16);
|
||||
| ^^^^ expected `i32`, found `i16`
|
||||
| ---- ^^^^ expected `i32`, found `i16`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/numeric-literal-cast.rs:3:4
|
||||
|
|
||||
LL | fn foo2(_: i32) {}
|
||||
| ^^^^ ------
|
||||
help: change the type of the numeric literal from `i16` to `i32`
|
||||
|
|
||||
LL | foo2(3i32);
|
||||
|
|
|
|||
|
|
@ -30,5 +30,4 @@ fn main() {
|
|||
//~^ ERROR this function takes 1 argument but 0 arguments were supplied
|
||||
let ans = s("burma", "shave");
|
||||
//~^ ERROR this function takes 1 argument but 2 arguments were supplied
|
||||
//~| ERROR mismatched types
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,43 +2,51 @@ error[E0308]: mismatched types
|
|||
--> $DIR/overloaded-calls-bad.rs:28:17
|
||||
|
|
||||
LL | let ans = s("what");
|
||||
| ^^^^^^ expected `isize`, found `&str`
|
||||
| - ^^^^^^ expected `isize`, found `&str`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: associated function defined here
|
||||
--> $SRC_DIR/core/src/ops/function.rs:LL:COL
|
||||
|
|
||||
LL | extern "rust-call" fn call_mut(&mut self, args: Args) -> Self::Output;
|
||||
| ^^^^^^^^
|
||||
|
||||
error[E0057]: this function takes 1 argument but 0 arguments were supplied
|
||||
--> $DIR/overloaded-calls-bad.rs:29:15
|
||||
|
|
||||
LL | let ans = s();
|
||||
| ^-- supplied 0 arguments
|
||||
| |
|
||||
| expected 1 argument
|
||||
| ^-- an argument of type `isize` is missing
|
||||
|
|
||||
note: associated function defined here
|
||||
--> $SRC_DIR/core/src/ops/function.rs:LL:COL
|
||||
|
|
||||
LL | extern "rust-call" fn call_mut(&mut self, args: Args) -> Self::Output;
|
||||
| ^^^^^^^^
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/overloaded-calls-bad.rs:31:17
|
||||
help: provide the argument
|
||||
|
|
||||
LL | let ans = s("burma", "shave");
|
||||
| ^^^^^^^ expected `isize`, found `&str`
|
||||
LL | let ans = s({isize});
|
||||
| ~~~~~~~~~~
|
||||
|
||||
error[E0057]: this function takes 1 argument but 2 arguments were supplied
|
||||
--> $DIR/overloaded-calls-bad.rs:31:15
|
||||
|
|
||||
LL | let ans = s("burma", "shave");
|
||||
| ^ ------- ------- supplied 2 arguments
|
||||
| |
|
||||
| expected 1 argument
|
||||
| ^ ------- ------- argument unexpected
|
||||
| |
|
||||
| expected `isize`, found `&str`
|
||||
|
|
||||
note: associated function defined here
|
||||
--> $SRC_DIR/core/src/ops/function.rs:LL:COL
|
||||
|
|
||||
LL | extern "rust-call" fn call_mut(&mut self, args: Args) -> Self::Output;
|
||||
| ^^^^^^^^
|
||||
help: remove the extra argument
|
||||
|
|
||||
LL | let ans = s({isize});
|
||||
| ~~~~~~~~~~
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0057, E0308.
|
||||
For more information about an error, try `rustc --explain E0057`.
|
||||
|
|
|
|||
|
|
@ -2,10 +2,17 @@ error[E0308]: mismatched types
|
|||
--> $DIR/trait-bounds-cant-coerce.rs:13:7
|
||||
|
|
||||
LL | a(x);
|
||||
| ^ expected trait `Foo + Send`, found trait `Foo`
|
||||
| - ^ expected trait `Foo + Send`, found trait `Foo`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
= note: expected struct `Box<(dyn Foo + Send + 'static)>`
|
||||
found struct `Box<(dyn Foo + 'static)>`
|
||||
note: function defined here
|
||||
--> $DIR/trait-bounds-cant-coerce.rs:5:4
|
||||
|
|
||||
LL | fn a(_x: Box<dyn Foo + Send>) {
|
||||
| ^ -----------------------
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -2,13 +2,19 @@ error[E0308]: mismatched types
|
|||
--> $DIR/mut-cross-borrowing.rs:7:7
|
||||
|
|
||||
LL | f(x)
|
||||
| ^
|
||||
| |
|
||||
| expected `&mut isize`, found struct `Box`
|
||||
| help: consider mutably borrowing here: `&mut x`
|
||||
| - ^
|
||||
| | |
|
||||
| | expected `&mut isize`, found struct `Box`
|
||||
| | help: consider mutably borrowing here: `&mut x`
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
= note: expected mutable reference `&mut isize`
|
||||
found struct `Box<{integer}>`
|
||||
note: function defined here
|
||||
--> $DIR/mut-cross-borrowing.rs:1:4
|
||||
|
|
||||
LL | fn f(_: &mut isize) {}
|
||||
| ^ -------------
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -2,10 +2,17 @@ error[E0308]: mismatched types
|
|||
--> $DIR/call-fn-never-arg-wrong-type.rs:10:9
|
||||
|
|
||||
LL | foo("wow");
|
||||
| ^^^^^ expected `!`, found `&str`
|
||||
| --- ^^^^^ expected `!`, found `&str`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
= note: expected type `!`
|
||||
found reference `&'static str`
|
||||
note: function defined here
|
||||
--> $DIR/call-fn-never-arg-wrong-type.rs:5:4
|
||||
|
|
||||
LL | fn foo(x: !) -> ! {
|
||||
| ^^^ ----
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -2,23 +2,23 @@ error[E0061]: this function takes 4 arguments but 3 arguments were supplied
|
|||
--> $DIR/not-enough-arguments.rs:27:3
|
||||
|
|
||||
LL | foo(1, 2, 3);
|
||||
| ^^^ - - - supplied 3 arguments
|
||||
| |
|
||||
| expected 4 arguments
|
||||
| ^^^--------- an argument of type `isize` is missing
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/not-enough-arguments.rs:5:4
|
||||
|
|
||||
LL | fn foo(a: isize, b: isize, c: isize, d:isize) {
|
||||
| ^^^ -------- -------- -------- -------
|
||||
help: provide the argument
|
||||
|
|
||||
LL | foo(1, 2, 3, {isize});
|
||||
| ~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
error[E0061]: this function takes 6 arguments but 3 arguments were supplied
|
||||
--> $DIR/not-enough-arguments.rs:29:3
|
||||
|
|
||||
LL | bar(1, 2, 3);
|
||||
| ^^^ - - - supplied 3 arguments
|
||||
| |
|
||||
| expected 6 arguments
|
||||
| ^^^--------- three arguments of type `i32`, `i32`, and `i32` are missing
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/not-enough-arguments.rs:10:4
|
||||
|
|
@ -37,6 +37,10 @@ LL | e: i32,
|
|||
| ------
|
||||
LL | f: i32,
|
||||
| ------
|
||||
help: provide the arguments
|
||||
|
|
||||
LL | bar(1, 2, 3, {i32}, {i32}, {i32});
|
||||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -2,8 +2,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:38:11
|
||||
|
|
||||
LL | id_i8(a16);
|
||||
| ^^^ expected `i8`, found `i16`
|
||||
| ----- ^^^ expected `i8`, found `i16`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:15:8
|
||||
|
|
||||
LL | fn id_i8(n: i8) -> i8 { n }
|
||||
| ^^^^^ -----
|
||||
help: you can convert an `i16` to an `i8` and panic if the converted value doesn't fit
|
||||
|
|
||||
LL | id_i8(a16.try_into().unwrap());
|
||||
|
|
@ -13,8 +20,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:41:11
|
||||
|
|
||||
LL | id_i8(a32);
|
||||
| ^^^ expected `i8`, found `i32`
|
||||
| ----- ^^^ expected `i8`, found `i32`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:15:8
|
||||
|
|
||||
LL | fn id_i8(n: i8) -> i8 { n }
|
||||
| ^^^^^ -----
|
||||
help: you can convert an `i32` to an `i8` and panic if the converted value doesn't fit
|
||||
|
|
||||
LL | id_i8(a32.try_into().unwrap());
|
||||
|
|
@ -24,8 +38,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:44:11
|
||||
|
|
||||
LL | id_i8(a64);
|
||||
| ^^^ expected `i8`, found `i64`
|
||||
| ----- ^^^ expected `i8`, found `i64`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:15:8
|
||||
|
|
||||
LL | fn id_i8(n: i8) -> i8 { n }
|
||||
| ^^^^^ -----
|
||||
help: you can convert an `i64` to an `i8` and panic if the converted value doesn't fit
|
||||
|
|
||||
LL | id_i8(a64.try_into().unwrap());
|
||||
|
|
@ -35,8 +56,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:47:11
|
||||
|
|
||||
LL | id_i8(asize);
|
||||
| ^^^^^ expected `i8`, found `isize`
|
||||
| ----- ^^^^^ expected `i8`, found `isize`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:15:8
|
||||
|
|
||||
LL | fn id_i8(n: i8) -> i8 { n }
|
||||
| ^^^^^ -----
|
||||
help: you can convert an `isize` to an `i8` and panic if the converted value doesn't fit
|
||||
|
|
||||
LL | id_i8(asize.try_into().unwrap());
|
||||
|
|
@ -46,8 +74,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:51:12
|
||||
|
|
||||
LL | id_i16(a8);
|
||||
| ^^ expected `i16`, found `i8`
|
||||
| ------ ^^ expected `i16`, found `i8`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:16:8
|
||||
|
|
||||
LL | fn id_i16(n: i16) -> i16 { n }
|
||||
| ^^^^^^ ------
|
||||
help: you can convert an `i8` to an `i16`
|
||||
|
|
||||
LL | id_i16(a8.into());
|
||||
|
|
@ -57,8 +92,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:55:12
|
||||
|
|
||||
LL | id_i16(a32);
|
||||
| ^^^ expected `i16`, found `i32`
|
||||
| ------ ^^^ expected `i16`, found `i32`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:16:8
|
||||
|
|
||||
LL | fn id_i16(n: i16) -> i16 { n }
|
||||
| ^^^^^^ ------
|
||||
help: you can convert an `i32` to an `i16` and panic if the converted value doesn't fit
|
||||
|
|
||||
LL | id_i16(a32.try_into().unwrap());
|
||||
|
|
@ -68,8 +110,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:58:12
|
||||
|
|
||||
LL | id_i16(a64);
|
||||
| ^^^ expected `i16`, found `i64`
|
||||
| ------ ^^^ expected `i16`, found `i64`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:16:8
|
||||
|
|
||||
LL | fn id_i16(n: i16) -> i16 { n }
|
||||
| ^^^^^^ ------
|
||||
help: you can convert an `i64` to an `i16` and panic if the converted value doesn't fit
|
||||
|
|
||||
LL | id_i16(a64.try_into().unwrap());
|
||||
|
|
@ -79,8 +128,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:61:12
|
||||
|
|
||||
LL | id_i16(asize);
|
||||
| ^^^^^ expected `i16`, found `isize`
|
||||
| ------ ^^^^^ expected `i16`, found `isize`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:16:8
|
||||
|
|
||||
LL | fn id_i16(n: i16) -> i16 { n }
|
||||
| ^^^^^^ ------
|
||||
help: you can convert an `isize` to an `i16` and panic if the converted value doesn't fit
|
||||
|
|
||||
LL | id_i16(asize.try_into().unwrap());
|
||||
|
|
@ -90,8 +146,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:65:12
|
||||
|
|
||||
LL | id_i32(a8);
|
||||
| ^^ expected `i32`, found `i8`
|
||||
| ------ ^^ expected `i32`, found `i8`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:17:8
|
||||
|
|
||||
LL | fn id_i32(n: i32) -> i32 { n }
|
||||
| ^^^^^^ ------
|
||||
help: you can convert an `i8` to an `i32`
|
||||
|
|
||||
LL | id_i32(a8.into());
|
||||
|
|
@ -101,8 +164,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:68:12
|
||||
|
|
||||
LL | id_i32(a16);
|
||||
| ^^^ expected `i32`, found `i16`
|
||||
| ------ ^^^ expected `i32`, found `i16`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:17:8
|
||||
|
|
||||
LL | fn id_i32(n: i32) -> i32 { n }
|
||||
| ^^^^^^ ------
|
||||
help: you can convert an `i16` to an `i32`
|
||||
|
|
||||
LL | id_i32(a16.into());
|
||||
|
|
@ -112,8 +182,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:72:12
|
||||
|
|
||||
LL | id_i32(a64);
|
||||
| ^^^ expected `i32`, found `i64`
|
||||
| ------ ^^^ expected `i32`, found `i64`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:17:8
|
||||
|
|
||||
LL | fn id_i32(n: i32) -> i32 { n }
|
||||
| ^^^^^^ ------
|
||||
help: you can convert an `i64` to an `i32` and panic if the converted value doesn't fit
|
||||
|
|
||||
LL | id_i32(a64.try_into().unwrap());
|
||||
|
|
@ -123,8 +200,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:75:12
|
||||
|
|
||||
LL | id_i32(asize);
|
||||
| ^^^^^ expected `i32`, found `isize`
|
||||
| ------ ^^^^^ expected `i32`, found `isize`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:17:8
|
||||
|
|
||||
LL | fn id_i32(n: i32) -> i32 { n }
|
||||
| ^^^^^^ ------
|
||||
help: you can convert an `isize` to an `i32` and panic if the converted value doesn't fit
|
||||
|
|
||||
LL | id_i32(asize.try_into().unwrap());
|
||||
|
|
@ -134,8 +218,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:79:12
|
||||
|
|
||||
LL | id_i64(a8);
|
||||
| ^^ expected `i64`, found `i8`
|
||||
| ------ ^^ expected `i64`, found `i8`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:18:8
|
||||
|
|
||||
LL | fn id_i64(n: i64) -> i64 { n }
|
||||
| ^^^^^^ ------
|
||||
help: you can convert an `i8` to an `i64`
|
||||
|
|
||||
LL | id_i64(a8.into());
|
||||
|
|
@ -145,8 +236,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:82:12
|
||||
|
|
||||
LL | id_i64(a16);
|
||||
| ^^^ expected `i64`, found `i16`
|
||||
| ------ ^^^ expected `i64`, found `i16`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:18:8
|
||||
|
|
||||
LL | fn id_i64(n: i64) -> i64 { n }
|
||||
| ^^^^^^ ------
|
||||
help: you can convert an `i16` to an `i64`
|
||||
|
|
||||
LL | id_i64(a16.into());
|
||||
|
|
@ -156,8 +254,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:85:12
|
||||
|
|
||||
LL | id_i64(a32);
|
||||
| ^^^ expected `i64`, found `i32`
|
||||
| ------ ^^^ expected `i64`, found `i32`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:18:8
|
||||
|
|
||||
LL | fn id_i64(n: i64) -> i64 { n }
|
||||
| ^^^^^^ ------
|
||||
help: you can convert an `i32` to an `i64`
|
||||
|
|
||||
LL | id_i64(a32.into());
|
||||
|
|
@ -167,8 +272,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:89:12
|
||||
|
|
||||
LL | id_i64(asize);
|
||||
| ^^^^^ expected `i64`, found `isize`
|
||||
| ------ ^^^^^ expected `i64`, found `isize`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:18:8
|
||||
|
|
||||
LL | fn id_i64(n: i64) -> i64 { n }
|
||||
| ^^^^^^ ------
|
||||
help: you can convert an `isize` to an `i64` and panic if the converted value doesn't fit
|
||||
|
|
||||
LL | id_i64(asize.try_into().unwrap());
|
||||
|
|
@ -178,8 +290,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:93:14
|
||||
|
|
||||
LL | id_isize(a8);
|
||||
| ^^ expected `isize`, found `i8`
|
||||
| -------- ^^ expected `isize`, found `i8`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:19:8
|
||||
|
|
||||
LL | fn id_isize(n: isize) -> isize { n }
|
||||
| ^^^^^^^^ --------
|
||||
help: you can convert an `i8` to an `isize`
|
||||
|
|
||||
LL | id_isize(a8.into());
|
||||
|
|
@ -189,8 +308,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:96:14
|
||||
|
|
||||
LL | id_isize(a16);
|
||||
| ^^^ expected `isize`, found `i16`
|
||||
| -------- ^^^ expected `isize`, found `i16`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:19:8
|
||||
|
|
||||
LL | fn id_isize(n: isize) -> isize { n }
|
||||
| ^^^^^^^^ --------
|
||||
help: you can convert an `i16` to an `isize`
|
||||
|
|
||||
LL | id_isize(a16.into());
|
||||
|
|
@ -200,8 +326,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:99:14
|
||||
|
|
||||
LL | id_isize(a32);
|
||||
| ^^^ expected `isize`, found `i32`
|
||||
| -------- ^^^ expected `isize`, found `i32`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:19:8
|
||||
|
|
||||
LL | fn id_isize(n: isize) -> isize { n }
|
||||
| ^^^^^^^^ --------
|
||||
help: you can convert an `i32` to an `isize` and panic if the converted value doesn't fit
|
||||
|
|
||||
LL | id_isize(a32.try_into().unwrap());
|
||||
|
|
@ -211,8 +344,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:102:14
|
||||
|
|
||||
LL | id_isize(a64);
|
||||
| ^^^ expected `isize`, found `i64`
|
||||
| -------- ^^^ expected `isize`, found `i64`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:19:8
|
||||
|
|
||||
LL | fn id_isize(n: isize) -> isize { n }
|
||||
| ^^^^^^^^ --------
|
||||
help: you can convert an `i64` to an `isize` and panic if the converted value doesn't fit
|
||||
|
|
||||
LL | id_isize(a64.try_into().unwrap());
|
||||
|
|
@ -222,8 +362,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:108:11
|
||||
|
|
||||
LL | id_i8(c16);
|
||||
| ^^^ expected `i8`, found `i16`
|
||||
| ----- ^^^ expected `i8`, found `i16`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:15:8
|
||||
|
|
||||
LL | fn id_i8(n: i8) -> i8 { n }
|
||||
| ^^^^^ -----
|
||||
help: you can convert an `i16` to an `i8` and panic if the converted value doesn't fit
|
||||
|
|
||||
LL | id_i8(c16.try_into().unwrap());
|
||||
|
|
@ -233,8 +380,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:111:11
|
||||
|
|
||||
LL | id_i8(c32);
|
||||
| ^^^ expected `i8`, found `i32`
|
||||
| ----- ^^^ expected `i8`, found `i32`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:15:8
|
||||
|
|
||||
LL | fn id_i8(n: i8) -> i8 { n }
|
||||
| ^^^^^ -----
|
||||
help: you can convert an `i32` to an `i8` and panic if the converted value doesn't fit
|
||||
|
|
||||
LL | id_i8(c32.try_into().unwrap());
|
||||
|
|
@ -244,8 +398,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:114:11
|
||||
|
|
||||
LL | id_i8(c64);
|
||||
| ^^^ expected `i8`, found `i64`
|
||||
| ----- ^^^ expected `i8`, found `i64`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:15:8
|
||||
|
|
||||
LL | fn id_i8(n: i8) -> i8 { n }
|
||||
| ^^^^^ -----
|
||||
help: you can convert an `i64` to an `i8` and panic if the converted value doesn't fit
|
||||
|
|
||||
LL | id_i8(c64.try_into().unwrap());
|
||||
|
|
@ -255,8 +416,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:118:12
|
||||
|
|
||||
LL | id_i16(c8);
|
||||
| ^^ expected `i16`, found `i8`
|
||||
| ------ ^^ expected `i16`, found `i8`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:16:8
|
||||
|
|
||||
LL | fn id_i16(n: i16) -> i16 { n }
|
||||
| ^^^^^^ ------
|
||||
help: you can convert an `i8` to an `i16`
|
||||
|
|
||||
LL | id_i16(c8.into());
|
||||
|
|
@ -266,8 +434,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:122:12
|
||||
|
|
||||
LL | id_i16(c32);
|
||||
| ^^^ expected `i16`, found `i32`
|
||||
| ------ ^^^ expected `i16`, found `i32`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:16:8
|
||||
|
|
||||
LL | fn id_i16(n: i16) -> i16 { n }
|
||||
| ^^^^^^ ------
|
||||
help: you can convert an `i32` to an `i16` and panic if the converted value doesn't fit
|
||||
|
|
||||
LL | id_i16(c32.try_into().unwrap());
|
||||
|
|
@ -277,8 +452,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:125:12
|
||||
|
|
||||
LL | id_i16(c64);
|
||||
| ^^^ expected `i16`, found `i64`
|
||||
| ------ ^^^ expected `i16`, found `i64`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:16:8
|
||||
|
|
||||
LL | fn id_i16(n: i16) -> i16 { n }
|
||||
| ^^^^^^ ------
|
||||
help: you can convert an `i64` to an `i16` and panic if the converted value doesn't fit
|
||||
|
|
||||
LL | id_i16(c64.try_into().unwrap());
|
||||
|
|
@ -288,8 +470,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:129:12
|
||||
|
|
||||
LL | id_i32(c8);
|
||||
| ^^ expected `i32`, found `i8`
|
||||
| ------ ^^ expected `i32`, found `i8`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:17:8
|
||||
|
|
||||
LL | fn id_i32(n: i32) -> i32 { n }
|
||||
| ^^^^^^ ------
|
||||
help: you can convert an `i8` to an `i32`
|
||||
|
|
||||
LL | id_i32(c8.into());
|
||||
|
|
@ -299,8 +488,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:132:12
|
||||
|
|
||||
LL | id_i32(c16);
|
||||
| ^^^ expected `i32`, found `i16`
|
||||
| ------ ^^^ expected `i32`, found `i16`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:17:8
|
||||
|
|
||||
LL | fn id_i32(n: i32) -> i32 { n }
|
||||
| ^^^^^^ ------
|
||||
help: you can convert an `i16` to an `i32`
|
||||
|
|
||||
LL | id_i32(c16.into());
|
||||
|
|
@ -310,8 +506,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:136:12
|
||||
|
|
||||
LL | id_i32(c64);
|
||||
| ^^^ expected `i32`, found `i64`
|
||||
| ------ ^^^ expected `i32`, found `i64`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:17:8
|
||||
|
|
||||
LL | fn id_i32(n: i32) -> i32 { n }
|
||||
| ^^^^^^ ------
|
||||
help: you can convert an `i64` to an `i32` and panic if the converted value doesn't fit
|
||||
|
|
||||
LL | id_i32(c64.try_into().unwrap());
|
||||
|
|
@ -321,8 +524,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:140:12
|
||||
|
|
||||
LL | id_i64(a8);
|
||||
| ^^ expected `i64`, found `i8`
|
||||
| ------ ^^ expected `i64`, found `i8`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:18:8
|
||||
|
|
||||
LL | fn id_i64(n: i64) -> i64 { n }
|
||||
| ^^^^^^ ------
|
||||
help: you can convert an `i8` to an `i64`
|
||||
|
|
||||
LL | id_i64(a8.into());
|
||||
|
|
@ -332,8 +542,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:143:12
|
||||
|
|
||||
LL | id_i64(a16);
|
||||
| ^^^ expected `i64`, found `i16`
|
||||
| ------ ^^^ expected `i64`, found `i16`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:18:8
|
||||
|
|
||||
LL | fn id_i64(n: i64) -> i64 { n }
|
||||
| ^^^^^^ ------
|
||||
help: you can convert an `i16` to an `i64`
|
||||
|
|
||||
LL | id_i64(a16.into());
|
||||
|
|
@ -343,8 +560,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:146:12
|
||||
|
|
||||
LL | id_i64(a32);
|
||||
| ^^^ expected `i64`, found `i32`
|
||||
| ------ ^^^ expected `i64`, found `i32`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:18:8
|
||||
|
|
||||
LL | fn id_i64(n: i64) -> i64 { n }
|
||||
| ^^^^^^ ------
|
||||
help: you can convert an `i32` to an `i64`
|
||||
|
|
||||
LL | id_i64(a32.into());
|
||||
|
|
@ -354,8 +578,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:152:11
|
||||
|
|
||||
LL | id_u8(b16);
|
||||
| ^^^ expected `u8`, found `u16`
|
||||
| ----- ^^^ expected `u8`, found `u16`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:27:8
|
||||
|
|
||||
LL | fn id_u8(n: u8) -> u8 { n }
|
||||
| ^^^^^ -----
|
||||
help: you can convert a `u16` to a `u8` and panic if the converted value doesn't fit
|
||||
|
|
||||
LL | id_u8(b16.try_into().unwrap());
|
||||
|
|
@ -365,8 +596,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:155:11
|
||||
|
|
||||
LL | id_u8(b32);
|
||||
| ^^^ expected `u8`, found `u32`
|
||||
| ----- ^^^ expected `u8`, found `u32`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:27:8
|
||||
|
|
||||
LL | fn id_u8(n: u8) -> u8 { n }
|
||||
| ^^^^^ -----
|
||||
help: you can convert a `u32` to a `u8` and panic if the converted value doesn't fit
|
||||
|
|
||||
LL | id_u8(b32.try_into().unwrap());
|
||||
|
|
@ -376,8 +614,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:158:11
|
||||
|
|
||||
LL | id_u8(b64);
|
||||
| ^^^ expected `u8`, found `u64`
|
||||
| ----- ^^^ expected `u8`, found `u64`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:27:8
|
||||
|
|
||||
LL | fn id_u8(n: u8) -> u8 { n }
|
||||
| ^^^^^ -----
|
||||
help: you can convert a `u64` to a `u8` and panic if the converted value doesn't fit
|
||||
|
|
||||
LL | id_u8(b64.try_into().unwrap());
|
||||
|
|
@ -387,8 +632,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:161:11
|
||||
|
|
||||
LL | id_u8(bsize);
|
||||
| ^^^^^ expected `u8`, found `usize`
|
||||
| ----- ^^^^^ expected `u8`, found `usize`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:27:8
|
||||
|
|
||||
LL | fn id_u8(n: u8) -> u8 { n }
|
||||
| ^^^^^ -----
|
||||
help: you can convert a `usize` to a `u8` and panic if the converted value doesn't fit
|
||||
|
|
||||
LL | id_u8(bsize.try_into().unwrap());
|
||||
|
|
@ -398,8 +650,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:165:12
|
||||
|
|
||||
LL | id_u16(b8);
|
||||
| ^^ expected `u16`, found `u8`
|
||||
| ------ ^^ expected `u16`, found `u8`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:28:8
|
||||
|
|
||||
LL | fn id_u16(n: u16) -> u16 { n }
|
||||
| ^^^^^^ ------
|
||||
help: you can convert a `u8` to a `u16`
|
||||
|
|
||||
LL | id_u16(b8.into());
|
||||
|
|
@ -409,8 +668,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:169:12
|
||||
|
|
||||
LL | id_u16(b32);
|
||||
| ^^^ expected `u16`, found `u32`
|
||||
| ------ ^^^ expected `u16`, found `u32`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:28:8
|
||||
|
|
||||
LL | fn id_u16(n: u16) -> u16 { n }
|
||||
| ^^^^^^ ------
|
||||
help: you can convert a `u32` to a `u16` and panic if the converted value doesn't fit
|
||||
|
|
||||
LL | id_u16(b32.try_into().unwrap());
|
||||
|
|
@ -420,8 +686,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:172:12
|
||||
|
|
||||
LL | id_u16(b64);
|
||||
| ^^^ expected `u16`, found `u64`
|
||||
| ------ ^^^ expected `u16`, found `u64`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:28:8
|
||||
|
|
||||
LL | fn id_u16(n: u16) -> u16 { n }
|
||||
| ^^^^^^ ------
|
||||
help: you can convert a `u64` to a `u16` and panic if the converted value doesn't fit
|
||||
|
|
||||
LL | id_u16(b64.try_into().unwrap());
|
||||
|
|
@ -431,8 +704,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:175:12
|
||||
|
|
||||
LL | id_u16(bsize);
|
||||
| ^^^^^ expected `u16`, found `usize`
|
||||
| ------ ^^^^^ expected `u16`, found `usize`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:28:8
|
||||
|
|
||||
LL | fn id_u16(n: u16) -> u16 { n }
|
||||
| ^^^^^^ ------
|
||||
help: you can convert a `usize` to a `u16` and panic if the converted value doesn't fit
|
||||
|
|
||||
LL | id_u16(bsize.try_into().unwrap());
|
||||
|
|
@ -442,8 +722,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:179:12
|
||||
|
|
||||
LL | id_u32(b8);
|
||||
| ^^ expected `u32`, found `u8`
|
||||
| ------ ^^ expected `u32`, found `u8`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:29:8
|
||||
|
|
||||
LL | fn id_u32(n: u32) -> u32 { n }
|
||||
| ^^^^^^ ------
|
||||
help: you can convert a `u8` to a `u32`
|
||||
|
|
||||
LL | id_u32(b8.into());
|
||||
|
|
@ -453,8 +740,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:182:12
|
||||
|
|
||||
LL | id_u32(b16);
|
||||
| ^^^ expected `u32`, found `u16`
|
||||
| ------ ^^^ expected `u32`, found `u16`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:29:8
|
||||
|
|
||||
LL | fn id_u32(n: u32) -> u32 { n }
|
||||
| ^^^^^^ ------
|
||||
help: you can convert a `u16` to a `u32`
|
||||
|
|
||||
LL | id_u32(b16.into());
|
||||
|
|
@ -464,8 +758,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:186:12
|
||||
|
|
||||
LL | id_u32(b64);
|
||||
| ^^^ expected `u32`, found `u64`
|
||||
| ------ ^^^ expected `u32`, found `u64`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:29:8
|
||||
|
|
||||
LL | fn id_u32(n: u32) -> u32 { n }
|
||||
| ^^^^^^ ------
|
||||
help: you can convert a `u64` to a `u32` and panic if the converted value doesn't fit
|
||||
|
|
||||
LL | id_u32(b64.try_into().unwrap());
|
||||
|
|
@ -475,8 +776,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:189:12
|
||||
|
|
||||
LL | id_u32(bsize);
|
||||
| ^^^^^ expected `u32`, found `usize`
|
||||
| ------ ^^^^^ expected `u32`, found `usize`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:29:8
|
||||
|
|
||||
LL | fn id_u32(n: u32) -> u32 { n }
|
||||
| ^^^^^^ ------
|
||||
help: you can convert a `usize` to a `u32` and panic if the converted value doesn't fit
|
||||
|
|
||||
LL | id_u32(bsize.try_into().unwrap());
|
||||
|
|
@ -486,8 +794,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:193:12
|
||||
|
|
||||
LL | id_u64(b8);
|
||||
| ^^ expected `u64`, found `u8`
|
||||
| ------ ^^ expected `u64`, found `u8`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:30:8
|
||||
|
|
||||
LL | fn id_u64(n: u64) -> u64 { n }
|
||||
| ^^^^^^ ------
|
||||
help: you can convert a `u8` to a `u64`
|
||||
|
|
||||
LL | id_u64(b8.into());
|
||||
|
|
@ -497,8 +812,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:196:12
|
||||
|
|
||||
LL | id_u64(b16);
|
||||
| ^^^ expected `u64`, found `u16`
|
||||
| ------ ^^^ expected `u64`, found `u16`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:30:8
|
||||
|
|
||||
LL | fn id_u64(n: u64) -> u64 { n }
|
||||
| ^^^^^^ ------
|
||||
help: you can convert a `u16` to a `u64`
|
||||
|
|
||||
LL | id_u64(b16.into());
|
||||
|
|
@ -508,8 +830,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:199:12
|
||||
|
|
||||
LL | id_u64(b32);
|
||||
| ^^^ expected `u64`, found `u32`
|
||||
| ------ ^^^ expected `u64`, found `u32`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:30:8
|
||||
|
|
||||
LL | fn id_u64(n: u64) -> u64 { n }
|
||||
| ^^^^^^ ------
|
||||
help: you can convert a `u32` to a `u64`
|
||||
|
|
||||
LL | id_u64(b32.into());
|
||||
|
|
@ -519,8 +848,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:203:12
|
||||
|
|
||||
LL | id_u64(bsize);
|
||||
| ^^^^^ expected `u64`, found `usize`
|
||||
| ------ ^^^^^ expected `u64`, found `usize`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:30:8
|
||||
|
|
||||
LL | fn id_u64(n: u64) -> u64 { n }
|
||||
| ^^^^^^ ------
|
||||
help: you can convert a `usize` to a `u64` and panic if the converted value doesn't fit
|
||||
|
|
||||
LL | id_u64(bsize.try_into().unwrap());
|
||||
|
|
@ -530,8 +866,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:207:14
|
||||
|
|
||||
LL | id_usize(b8);
|
||||
| ^^ expected `usize`, found `u8`
|
||||
| -------- ^^ expected `usize`, found `u8`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:31:8
|
||||
|
|
||||
LL | fn id_usize(n: usize) -> usize { n }
|
||||
| ^^^^^^^^ --------
|
||||
help: you can convert a `u8` to a `usize`
|
||||
|
|
||||
LL | id_usize(b8.into());
|
||||
|
|
@ -541,8 +884,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:210:14
|
||||
|
|
||||
LL | id_usize(b16);
|
||||
| ^^^ expected `usize`, found `u16`
|
||||
| -------- ^^^ expected `usize`, found `u16`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:31:8
|
||||
|
|
||||
LL | fn id_usize(n: usize) -> usize { n }
|
||||
| ^^^^^^^^ --------
|
||||
help: you can convert a `u16` to a `usize`
|
||||
|
|
||||
LL | id_usize(b16.into());
|
||||
|
|
@ -552,8 +902,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:213:14
|
||||
|
|
||||
LL | id_usize(b32);
|
||||
| ^^^ expected `usize`, found `u32`
|
||||
| -------- ^^^ expected `usize`, found `u32`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:31:8
|
||||
|
|
||||
LL | fn id_usize(n: usize) -> usize { n }
|
||||
| ^^^^^^^^ --------
|
||||
help: you can convert a `u32` to a `usize` and panic if the converted value doesn't fit
|
||||
|
|
||||
LL | id_usize(b32.try_into().unwrap());
|
||||
|
|
@ -563,8 +920,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/integer-literal-suffix-inference.rs:216:14
|
||||
|
|
||||
LL | id_usize(b64);
|
||||
| ^^^ expected `usize`, found `u64`
|
||||
| -------- ^^^ expected `usize`, found `u64`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/integer-literal-suffix-inference.rs:31:8
|
||||
|
|
||||
LL | fn id_usize(n: usize) -> usize { n }
|
||||
| ^^^^^^^^ --------
|
||||
help: you can convert a `u64` to a `usize` and panic if the converted value doesn't fit
|
||||
|
|
||||
LL | id_usize(b64.try_into().unwrap());
|
||||
|
|
|
|||
|
|
@ -2,8 +2,15 @@ error[E0308]: mismatched types
|
|||
--> $DIR/len.rs:3:10
|
||||
|
|
||||
LL | test(array.len());
|
||||
| ^^^^^^^^^^^ expected `u32`, found `usize`
|
||||
| ---- ^^^^^^^^^^^ expected `u32`, found `usize`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/len.rs:6:4
|
||||
|
|
||||
LL | fn test(length: u32) {
|
||||
| ^^^^ -----------
|
||||
help: you can convert a `usize` to a `u32` and panic if the converted value doesn't fit
|
||||
|
|
||||
LL | test(array.len().try_into().unwrap());
|
||||
|
|
|
|||
|
|
@ -2,127 +2,295 @@ error[E0308]: mismatched types
|
|||
--> $DIR/numeric-cast-without-suggestion.rs:17:18
|
||||
|
|
||||
LL | foo::<usize>(x_f64);
|
||||
| ^^^^^ expected `usize`, found `f64`
|
||||
| ------------ ^^^^^ expected `usize`, found `f64`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/numeric-cast-without-suggestion.rs:1:4
|
||||
|
|
||||
LL | fn foo<N>(_x: N) {}
|
||||
| ^^^ -----
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/numeric-cast-without-suggestion.rs:18:18
|
||||
|
|
||||
LL | foo::<usize>(x_f32);
|
||||
| ^^^^^ expected `usize`, found `f32`
|
||||
| ------------ ^^^^^ expected `usize`, found `f32`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/numeric-cast-without-suggestion.rs:1:4
|
||||
|
|
||||
LL | fn foo<N>(_x: N) {}
|
||||
| ^^^ -----
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/numeric-cast-without-suggestion.rs:19:18
|
||||
|
|
||||
LL | foo::<isize>(x_f64);
|
||||
| ^^^^^ expected `isize`, found `f64`
|
||||
| ------------ ^^^^^ expected `isize`, found `f64`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/numeric-cast-without-suggestion.rs:1:4
|
||||
|
|
||||
LL | fn foo<N>(_x: N) {}
|
||||
| ^^^ -----
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/numeric-cast-without-suggestion.rs:20:18
|
||||
|
|
||||
LL | foo::<isize>(x_f32);
|
||||
| ^^^^^ expected `isize`, found `f32`
|
||||
| ------------ ^^^^^ expected `isize`, found `f32`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/numeric-cast-without-suggestion.rs:1:4
|
||||
|
|
||||
LL | fn foo<N>(_x: N) {}
|
||||
| ^^^ -----
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/numeric-cast-without-suggestion.rs:21:16
|
||||
|
|
||||
LL | foo::<u64>(x_f64);
|
||||
| ^^^^^ expected `u64`, found `f64`
|
||||
| ---------- ^^^^^ expected `u64`, found `f64`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/numeric-cast-without-suggestion.rs:1:4
|
||||
|
|
||||
LL | fn foo<N>(_x: N) {}
|
||||
| ^^^ -----
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/numeric-cast-without-suggestion.rs:22:16
|
||||
|
|
||||
LL | foo::<u64>(x_f32);
|
||||
| ^^^^^ expected `u64`, found `f32`
|
||||
| ---------- ^^^^^ expected `u64`, found `f32`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/numeric-cast-without-suggestion.rs:1:4
|
||||
|
|
||||
LL | fn foo<N>(_x: N) {}
|
||||
| ^^^ -----
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/numeric-cast-without-suggestion.rs:23:16
|
||||
|
|
||||
LL | foo::<i64>(x_f64);
|
||||
| ^^^^^ expected `i64`, found `f64`
|
||||
| ---------- ^^^^^ expected `i64`, found `f64`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/numeric-cast-without-suggestion.rs:1:4
|
||||
|
|
||||
LL | fn foo<N>(_x: N) {}
|
||||
| ^^^ -----
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/numeric-cast-without-suggestion.rs:24:16
|
||||
|
|
||||
LL | foo::<i64>(x_f32);
|
||||
| ^^^^^ expected `i64`, found `f32`
|
||||
| ---------- ^^^^^ expected `i64`, found `f32`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/numeric-cast-without-suggestion.rs:1:4
|
||||
|
|
||||
LL | fn foo<N>(_x: N) {}
|
||||
| ^^^ -----
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/numeric-cast-without-suggestion.rs:25:16
|
||||
|
|
||||
LL | foo::<u32>(x_f64);
|
||||
| ^^^^^ expected `u32`, found `f64`
|
||||
| ---------- ^^^^^ expected `u32`, found `f64`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/numeric-cast-without-suggestion.rs:1:4
|
||||
|
|
||||
LL | fn foo<N>(_x: N) {}
|
||||
| ^^^ -----
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/numeric-cast-without-suggestion.rs:26:16
|
||||
|
|
||||
LL | foo::<u32>(x_f32);
|
||||
| ^^^^^ expected `u32`, found `f32`
|
||||
| ---------- ^^^^^ expected `u32`, found `f32`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/numeric-cast-without-suggestion.rs:1:4
|
||||
|
|
||||
LL | fn foo<N>(_x: N) {}
|
||||
| ^^^ -----
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/numeric-cast-without-suggestion.rs:27:16
|
||||
|
|
||||
LL | foo::<i32>(x_f64);
|
||||
| ^^^^^ expected `i32`, found `f64`
|
||||
| ---------- ^^^^^ expected `i32`, found `f64`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/numeric-cast-without-suggestion.rs:1:4
|
||||
|
|
||||
LL | fn foo<N>(_x: N) {}
|
||||
| ^^^ -----
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/numeric-cast-without-suggestion.rs:28:16
|
||||
|
|
||||
LL | foo::<i32>(x_f32);
|
||||
| ^^^^^ expected `i32`, found `f32`
|
||||
| ---------- ^^^^^ expected `i32`, found `f32`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/numeric-cast-without-suggestion.rs:1:4
|
||||
|
|
||||
LL | fn foo<N>(_x: N) {}
|
||||
| ^^^ -----
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/numeric-cast-without-suggestion.rs:29:16
|
||||
|
|
||||
LL | foo::<u16>(x_f64);
|
||||
| ^^^^^ expected `u16`, found `f64`
|
||||
| ---------- ^^^^^ expected `u16`, found `f64`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/numeric-cast-without-suggestion.rs:1:4
|
||||
|
|
||||
LL | fn foo<N>(_x: N) {}
|
||||
| ^^^ -----
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/numeric-cast-without-suggestion.rs:30:16
|
||||
|
|
||||
LL | foo::<u16>(x_f32);
|
||||
| ^^^^^ expected `u16`, found `f32`
|
||||
| ---------- ^^^^^ expected `u16`, found `f32`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/numeric-cast-without-suggestion.rs:1:4
|
||||
|
|
||||
LL | fn foo<N>(_x: N) {}
|
||||
| ^^^ -----
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/numeric-cast-without-suggestion.rs:31:16
|
||||
|
|
||||
LL | foo::<i16>(x_f64);
|
||||
| ^^^^^ expected `i16`, found `f64`
|
||||
| ---------- ^^^^^ expected `i16`, found `f64`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/numeric-cast-without-suggestion.rs:1:4
|
||||
|
|
||||
LL | fn foo<N>(_x: N) {}
|
||||
| ^^^ -----
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/numeric-cast-without-suggestion.rs:32:16
|
||||
|
|
||||
LL | foo::<i16>(x_f32);
|
||||
| ^^^^^ expected `i16`, found `f32`
|
||||
| ---------- ^^^^^ expected `i16`, found `f32`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/numeric-cast-without-suggestion.rs:1:4
|
||||
|
|
||||
LL | fn foo<N>(_x: N) {}
|
||||
| ^^^ -----
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/numeric-cast-without-suggestion.rs:33:15
|
||||
|
|
||||
LL | foo::<u8>(x_f64);
|
||||
| ^^^^^ expected `u8`, found `f64`
|
||||
| --------- ^^^^^ expected `u8`, found `f64`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/numeric-cast-without-suggestion.rs:1:4
|
||||
|
|
||||
LL | fn foo<N>(_x: N) {}
|
||||
| ^^^ -----
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/numeric-cast-without-suggestion.rs:34:15
|
||||
|
|
||||
LL | foo::<u8>(x_f32);
|
||||
| ^^^^^ expected `u8`, found `f32`
|
||||
| --------- ^^^^^ expected `u8`, found `f32`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/numeric-cast-without-suggestion.rs:1:4
|
||||
|
|
||||
LL | fn foo<N>(_x: N) {}
|
||||
| ^^^ -----
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/numeric-cast-without-suggestion.rs:35:15
|
||||
|
|
||||
LL | foo::<i8>(x_f64);
|
||||
| ^^^^^ expected `i8`, found `f64`
|
||||
| --------- ^^^^^ expected `i8`, found `f64`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/numeric-cast-without-suggestion.rs:1:4
|
||||
|
|
||||
LL | fn foo<N>(_x: N) {}
|
||||
| ^^^ -----
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/numeric-cast-without-suggestion.rs:36:15
|
||||
|
|
||||
LL | foo::<i8>(x_f32);
|
||||
| ^^^^^ expected `i8`, found `f32`
|
||||
| --------- ^^^^^ expected `i8`, found `f32`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/numeric-cast-without-suggestion.rs:1:4
|
||||
|
|
||||
LL | fn foo<N>(_x: N) {}
|
||||
| ^^^ -----
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/numeric-cast-without-suggestion.rs:37:16
|
||||
|
|
||||
LL | foo::<f32>(x_f64);
|
||||
| ^^^^^ expected `f32`, found `f64`
|
||||
| ---------- ^^^^^ expected `f32`, found `f64`
|
||||
| |
|
||||
| arguments to this function are incorrect
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/numeric-cast-without-suggestion.rs:1:4
|
||||
|
|
||||
LL | fn foo<N>(_x: N) {}
|
||||
| ^^^ -----
|
||||
|
||||
error: aborting due to 21 previous errors
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1,298 +0,0 @@
|
|||
// run-rustfix
|
||||
|
||||
fn foo<N>(_x: N) {}
|
||||
|
||||
fn main() {
|
||||
foo::<usize>(42_usize);
|
||||
foo::<usize>(42_usize);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<usize>(42_usize);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<usize>(42_usize);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<usize>(42_usize);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<usize>(42_usize);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<usize>(42_usize);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<usize>(42_usize);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<usize>(42_usize);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<usize>(42_usize);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<usize>(42usize);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<usize>(42usize);
|
||||
//~^ ERROR mismatched types
|
||||
|
||||
foo::<isize>(42_isize);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<isize>(42_isize);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<isize>(42_isize);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<isize>(42_isize);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<isize>(42_isize);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<isize>(42_isize);
|
||||
foo::<isize>(42_isize);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<isize>(42_isize);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<isize>(42_isize);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<isize>(42_isize);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<isize>(42isize);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<isize>(42isize);
|
||||
//~^ ERROR mismatched types
|
||||
|
||||
foo::<u64>(42_u64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u64>(42_u64);
|
||||
foo::<u64>(42_u64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u64>(42_u64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u64>(42_u64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u64>(42_u64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u64>(42_u64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u64>(42_u64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u64>(42_u64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u64>(42_u64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u64>(42u64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u64>(42u64);
|
||||
//~^ ERROR mismatched types
|
||||
|
||||
foo::<i64>(42_i64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i64>(42_i64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i64>(42_i64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i64>(42_i64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i64>(42_i64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i64>(42_i64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i64>(42_i64);
|
||||
foo::<i64>(42_i64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i64>(42_i64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i64>(42_i64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i64>(42i64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i64>(42i64);
|
||||
//~^ ERROR mismatched types
|
||||
|
||||
foo::<u32>(42_u32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u32>(42_u32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u32>(42_u32);
|
||||
foo::<u32>(42_u32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u32>(42_u32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u32>(42_u32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u32>(42_u32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u32>(42_u32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u32>(42_u32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u32>(42_u32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u32>(42u32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u32>(42u32);
|
||||
//~^ ERROR mismatched types
|
||||
|
||||
foo::<i32>(42_i32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i32>(42_i32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i32>(42_i32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i32>(42_i32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i32>(42_i32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i32>(42_i32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i32>(42_i32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i32>(42_i32);
|
||||
foo::<i32>(42_i32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i32>(42_i32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i32>(42i32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i32>(42i32);
|
||||
//~^ ERROR mismatched types
|
||||
|
||||
foo::<u16>(42_u16);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u16>(42_u16);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u16>(42_u16);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u16>(42_u16);
|
||||
foo::<u16>(42_u16);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u16>(42_u16);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u16>(42_u16);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u16>(42_u16);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u16>(42_u16);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u16>(42_u16);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u16>(42u16);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u16>(42u16);
|
||||
//~^ ERROR mismatched types
|
||||
|
||||
foo::<i16>(42_i16);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i16>(42_i16);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i16>(42_i16);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i16>(42_i16);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i16>(42_i16);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i16>(42_i16);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i16>(42_i16);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i16>(42_i16);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i16>(42_i16);
|
||||
foo::<i16>(42_i16);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i16>(42i16);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i16>(42i16);
|
||||
//~^ ERROR mismatched types
|
||||
|
||||
foo::<u8>(42_u8);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u8>(42_u8);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u8>(42_u8);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u8>(42_u8);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u8>(42_u8);
|
||||
foo::<u8>(42_u8);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u8>(42_u8);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u8>(42_u8);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u8>(42_u8);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u8>(42_u8);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u8>(42u8);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u8>(42u8);
|
||||
//~^ ERROR mismatched types
|
||||
|
||||
foo::<i8>(42_i8);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i8>(42_i8);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i8>(42_i8);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i8>(42_i8);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i8>(42_i8);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i8>(42_i8);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i8>(42_i8);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i8>(42_i8);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i8>(42_i8);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i8>(42_i8);
|
||||
foo::<i8>(42i8);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i8>(42i8);
|
||||
//~^ ERROR mismatched types
|
||||
|
||||
foo::<f64>(42_f64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<f64>(42_f64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<f64>(42_u32.into());
|
||||
//~^ ERROR mismatched types
|
||||
foo::<f64>(42_u16.into());
|
||||
//~^ ERROR mismatched types
|
||||
foo::<f64>(42_u8.into());
|
||||
//~^ ERROR mismatched types
|
||||
foo::<f64>(42_f64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<f64>(42_f64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<f64>(42_i32.into());
|
||||
//~^ ERROR mismatched types
|
||||
foo::<f64>(42_i16.into());
|
||||
//~^ ERROR mismatched types
|
||||
foo::<f64>(42_i8.into());
|
||||
//~^ ERROR mismatched types
|
||||
foo::<f64>(42.0_f64);
|
||||
foo::<f64>(42.0_f64);
|
||||
//~^ ERROR mismatched types
|
||||
|
||||
foo::<f32>(42_f32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<f32>(42_f32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<f32>(42_f32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<f32>(42_u16.into());
|
||||
//~^ ERROR mismatched types
|
||||
foo::<f32>(42_u8.into());
|
||||
//~^ ERROR mismatched types
|
||||
foo::<f32>(42_f32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<f32>(42_f32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<f32>(42_f32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<f32>(42_i16.into());
|
||||
//~^ ERROR mismatched types
|
||||
foo::<f32>(42_i8.into());
|
||||
//~^ ERROR mismatched types
|
||||
foo::<f32>(42.0_f32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<f32>(42.0_f32);
|
||||
|
||||
foo::<u32>((42_u8 as u16).into());
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i32>((-42_i8).into());
|
||||
//~^ ERROR mismatched types
|
||||
}
|
||||
|
|
@ -1,298 +0,0 @@
|
|||
// run-rustfix
|
||||
|
||||
fn foo<N>(_x: N) {}
|
||||
|
||||
fn main() {
|
||||
foo::<usize>(42_usize);
|
||||
foo::<usize>(42_u64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<usize>(42_u32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<usize>(42_u16);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<usize>(42_u8);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<usize>(42_isize);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<usize>(42_i64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<usize>(42_i32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<usize>(42_i16);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<usize>(42_i8);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<usize>(42.0_f64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<usize>(42.0_f32);
|
||||
//~^ ERROR mismatched types
|
||||
|
||||
foo::<isize>(42_usize);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<isize>(42_u64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<isize>(42_u32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<isize>(42_u16);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<isize>(42_u8);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<isize>(42_isize);
|
||||
foo::<isize>(42_i64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<isize>(42_i32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<isize>(42_i16);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<isize>(42_i8);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<isize>(42.0_f64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<isize>(42.0_f32);
|
||||
//~^ ERROR mismatched types
|
||||
|
||||
foo::<u64>(42_usize);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u64>(42_u64);
|
||||
foo::<u64>(42_u32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u64>(42_u16);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u64>(42_u8);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u64>(42_isize);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u64>(42_i64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u64>(42_i32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u64>(42_i16);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u64>(42_i8);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u64>(42.0_f64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u64>(42.0_f32);
|
||||
//~^ ERROR mismatched types
|
||||
|
||||
foo::<i64>(42_usize);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i64>(42_u64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i64>(42_u32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i64>(42_u16);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i64>(42_u8);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i64>(42_isize);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i64>(42_i64);
|
||||
foo::<i64>(42_i32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i64>(42_i16);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i64>(42_i8);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i64>(42.0_f64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i64>(42.0_f32);
|
||||
//~^ ERROR mismatched types
|
||||
|
||||
foo::<u32>(42_usize);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u32>(42_u64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u32>(42_u32);
|
||||
foo::<u32>(42_u16);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u32>(42_u8);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u32>(42_isize);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u32>(42_i64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u32>(42_i32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u32>(42_i16);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u32>(42_i8);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u32>(42.0_f64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u32>(42.0_f32);
|
||||
//~^ ERROR mismatched types
|
||||
|
||||
foo::<i32>(42_usize);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i32>(42_u64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i32>(42_u32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i32>(42_u16);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i32>(42_u8);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i32>(42_isize);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i32>(42_i64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i32>(42_i32);
|
||||
foo::<i32>(42_i16);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i32>(42_i8);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i32>(42.0_f64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i32>(42.0_f32);
|
||||
//~^ ERROR mismatched types
|
||||
|
||||
foo::<u16>(42_usize);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u16>(42_u64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u16>(42_u32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u16>(42_u16);
|
||||
foo::<u16>(42_u8);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u16>(42_isize);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u16>(42_i64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u16>(42_i32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u16>(42_i16);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u16>(42_i8);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u16>(42.0_f64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u16>(42.0_f32);
|
||||
//~^ ERROR mismatched types
|
||||
|
||||
foo::<i16>(42_usize);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i16>(42_u64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i16>(42_u32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i16>(42_u16);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i16>(42_u8);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i16>(42_isize);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i16>(42_i64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i16>(42_i32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i16>(42_i16);
|
||||
foo::<i16>(42_i8);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i16>(42.0_f64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i16>(42.0_f32);
|
||||
//~^ ERROR mismatched types
|
||||
|
||||
foo::<u8>(42_usize);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u8>(42_u64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u8>(42_u32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u8>(42_u16);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u8>(42_u8);
|
||||
foo::<u8>(42_isize);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u8>(42_i64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u8>(42_i32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u8>(42_i16);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u8>(42_i8);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u8>(42.0_f64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<u8>(42.0_f32);
|
||||
//~^ ERROR mismatched types
|
||||
|
||||
foo::<i8>(42_usize);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i8>(42_u64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i8>(42_u32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i8>(42_u16);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i8>(42_u8);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i8>(42_isize);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i8>(42_i64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i8>(42_i32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i8>(42_i16);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i8>(42_i8);
|
||||
foo::<i8>(42.0_f64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i8>(42.0_f32);
|
||||
//~^ ERROR mismatched types
|
||||
|
||||
foo::<f64>(42_usize);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<f64>(42_u64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<f64>(42_u32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<f64>(42_u16);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<f64>(42_u8);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<f64>(42_isize);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<f64>(42_i64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<f64>(42_i32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<f64>(42_i16);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<f64>(42_i8);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<f64>(42.0_f64);
|
||||
foo::<f64>(42.0_f32);
|
||||
//~^ ERROR mismatched types
|
||||
|
||||
foo::<f32>(42_usize);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<f32>(42_u64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<f32>(42_u32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<f32>(42_u16);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<f32>(42_u8);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<f32>(42_isize);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<f32>(42_i64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<f32>(42_i32);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<f32>(42_i16);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<f32>(42_i8);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<f32>(42.0_f64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<f32>(42.0_f32);
|
||||
|
||||
foo::<u32>(42_u8 as u16);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i32>(-42_i8);
|
||||
//~^ ERROR mismatched types
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
73
src/test/ui/numeric/numeric-suffix/numeric-suffix-i32.fixed
Normal file
73
src/test/ui/numeric/numeric-suffix/numeric-suffix-i32.fixed
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
// run-rustfix
|
||||
|
||||
fn foo<N>(_x: N) {}
|
||||
//~^ NOTE function defined here
|
||||
//~| NOTE function defined here
|
||||
//~| NOTE function defined here
|
||||
//~| NOTE function defined here
|
||||
//~| NOTE function defined here
|
||||
//~| NOTE function defined here
|
||||
//~| NOTE function defined here
|
||||
//~| NOTE function defined here
|
||||
//~| NOTE function defined here
|
||||
//~| NOTE function defined here
|
||||
//~| NOTE function defined here
|
||||
//~| NOTE
|
||||
//~| NOTE
|
||||
//~| NOTE
|
||||
//~| NOTE
|
||||
//~| NOTE
|
||||
//~| NOTE
|
||||
//~| NOTE
|
||||
//~| NOTE
|
||||
//~| NOTE
|
||||
//~| NOTE
|
||||
//~| NOTE
|
||||
|
||||
fn main() {
|
||||
foo::<i32>(42_i32);
|
||||
//~^ ERROR mismatched types
|
||||
//~| NOTE expected
|
||||
//~| NOTE arguments
|
||||
foo::<i32>(42_i32);
|
||||
//~^ ERROR mismatched types
|
||||
//~| NOTE expected
|
||||
//~| NOTE arguments
|
||||
foo::<i32>(42_i32);
|
||||
//~^ ERROR mismatched types
|
||||
//~| NOTE expected
|
||||
//~| NOTE arguments
|
||||
foo::<i32>(42_i32);
|
||||
//~^ ERROR mismatched types
|
||||
//~| NOTE expected
|
||||
//~| NOTE arguments
|
||||
foo::<i32>(42_i32);
|
||||
//~^ ERROR mismatched types
|
||||
//~| NOTE expected
|
||||
//~| NOTE arguments
|
||||
foo::<i32>(42_i32);
|
||||
//~^ ERROR mismatched types
|
||||
//~| NOTE expected
|
||||
//~| NOTE arguments
|
||||
foo::<i32>(42_i32);
|
||||
//~^ ERROR mismatched types
|
||||
//~| NOTE expected
|
||||
//~| NOTE arguments
|
||||
foo::<i32>(42_i32);
|
||||
foo::<i32>(42_i32);
|
||||
//~^ ERROR mismatched types
|
||||
//~| NOTE expected
|
||||
//~| NOTE arguments
|
||||
foo::<i32>(42_i32);
|
||||
//~^ ERROR mismatched types
|
||||
//~| NOTE expected
|
||||
//~| NOTE arguments
|
||||
foo::<i32>(42i32);
|
||||
//~^ ERROR mismatched types
|
||||
//~| NOTE expected
|
||||
//~| NOTE arguments
|
||||
foo::<i32>(42i32);
|
||||
//~^ ERROR mismatched types
|
||||
//~| NOTE expected
|
||||
//~| NOTE arguments
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue