Rollup merge of #97303 - compiler-errors:arg-typos, r=jackh726
Fix some typos in arg checking algorithm Fixes #97197 Also fixes a typo where if we're missing args A, B, C, we actually say A, B, B
This commit is contained in:
commit
b5ff4ad02c
4 changed files with 31 additions and 6 deletions
6
src/test/ui/argument-suggestions/issue-97197.rs
Normal file
6
src/test/ui/argument-suggestions/issue-97197.rs
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
fn main() {
|
||||
g((), ());
|
||||
//~^ ERROR this function takes 6 arguments but 2 arguments were supplied
|
||||
}
|
||||
|
||||
pub fn g(a1: (), a2: bool, a3: bool, a4: bool, a5: bool, a6: ()) -> () {}
|
||||
19
src/test/ui/argument-suggestions/issue-97197.stderr
Normal file
19
src/test/ui/argument-suggestions/issue-97197.stderr
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
error[E0061]: this function takes 6 arguments but 2 arguments were supplied
|
||||
--> $DIR/issue-97197.rs:2:5
|
||||
|
|
||||
LL | g((), ());
|
||||
| ^-------- multiple arguments are missing
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/issue-97197.rs:6:8
|
||||
|
|
||||
LL | pub fn g(a1: (), a2: bool, a3: bool, a4: bool, a5: bool, a6: ()) -> () {}
|
||||
| ^ ------ -------- -------- -------- -------- ------
|
||||
help: provide the arguments
|
||||
|
|
||||
LL | g((), {bool}, {bool}, {bool}, {bool}, ());
|
||||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0061`.
|
||||
|
|
@ -293,7 +293,7 @@ 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
|
||||
| ^^^^^^^--------------------------------- three arguments of type `f32`, `i32`, and `f32` are missing
|
||||
|
|
||||
note: function defined here
|
||||
--> $DIR/missing_arguments.rs:7:4
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue