about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2022-05-23 07:43:52 +0200
committerGitHub <noreply@github.com>2022-05-23 07:43:52 +0200
commitb5ff4ad02ce4f491d37d56cd4b81dd142f709a4a (patch)
treed9d89d7a3d8372cf9ad549463202dbbc49d7baa6 /src/test
parent06e89fdcfdf2211f489b875b76f78340cb57440c (diff)
parent21a7b4cb97ce1992645ac04efef1c06172d82a61 (diff)
downloadrust-b5ff4ad02ce4f491d37d56cd4b81dd142f709a4a.tar.gz
rust-b5ff4ad02ce4f491d37d56cd4b81dd142f709a4a.zip
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
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/argument-suggestions/issue-97197.rs6
-rw-r--r--src/test/ui/argument-suggestions/issue-97197.stderr19
-rw-r--r--src/test/ui/argument-suggestions/missing_arguments.stderr2
3 files changed, 26 insertions, 1 deletions
diff --git a/src/test/ui/argument-suggestions/issue-97197.rs b/src/test/ui/argument-suggestions/issue-97197.rs
new file mode 100644
index 00000000000..6f9f4293e49
--- /dev/null
+++ b/src/test/ui/argument-suggestions/issue-97197.rs
@@ -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: ()) -> () {}
diff --git a/src/test/ui/argument-suggestions/issue-97197.stderr b/src/test/ui/argument-suggestions/issue-97197.stderr
new file mode 100644
index 00000000000..10689d50957
--- /dev/null
+++ b/src/test/ui/argument-suggestions/issue-97197.stderr
@@ -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`.
diff --git a/src/test/ui/argument-suggestions/missing_arguments.stderr b/src/test/ui/argument-suggestions/missing_arguments.stderr
index b4dadb1b9da..5236d15b945 100644
--- a/src/test/ui/argument-suggestions/missing_arguments.stderr
+++ b/src/test/ui/argument-suggestions/missing_arguments.stderr
@@ -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