Skip to content

Commit

Permalink
Rollup merge of rust-lang#99396 - compiler-errors:missing-tests, r=Ma…
Browse files Browse the repository at this point in the history
…rk-Simulacrum

Add some additional double-adjustment regression tests

I accidentally missed these when I rebased rust-lang#98785

cc rust-lang#98894 and rust-lang#98897
  • Loading branch information
GuillaumeGomez authored Jul 23, 2022
2 parents a9dc6a6 + 32e0ef3 commit 93f58b6
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/test/ui/argument-suggestions/issue-98894.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
fn main() {
(|_, ()| ())(if true {} else {return;});
//~^ ERROR this function takes 2 arguments but 1 argument was supplied
}
19 changes: 19 additions & 0 deletions src/test/ui/argument-suggestions/issue-98894.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
error[E0057]: this function takes 2 arguments but 1 argument was supplied
--> $DIR/issue-98894.rs:2:5
|
LL | (|_, ()| ())(if true {} else {return;});
| ^^^^^^^^^^^^--------------------------- an argument of type `()` is missing
|
note: closure defined here
--> $DIR/issue-98894.rs:2:6
|
LL | (|_, ()| ())(if true {} else {return;});
| ^^^^^^^
help: provide the argument
|
LL | (|_, ()| ())(if true {} else {return;}, ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error: aborting due to previous error

For more information about this error, try `rustc --explain E0057`.
4 changes: 4 additions & 0 deletions src/test/ui/argument-suggestions/issue-98897.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
fn main() {
(|_, ()| ())([return, ()]);
//~^ ERROR this function takes 2 arguments but 1 argument was supplied
}
19 changes: 19 additions & 0 deletions src/test/ui/argument-suggestions/issue-98897.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
error[E0057]: this function takes 2 arguments but 1 argument was supplied
--> $DIR/issue-98897.rs:2:5
|
LL | (|_, ()| ())([return, ()]);
| ^^^^^^^^^^^^-------------- an argument of type `()` is missing
|
note: closure defined here
--> $DIR/issue-98897.rs:2:6
|
LL | (|_, ()| ())([return, ()]);
| ^^^^^^^
help: provide the argument
|
LL | (|_, ()| ())([return, ()], ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error: aborting due to previous error

For more information about this error, try `rustc --explain E0057`.

0 comments on commit 93f58b6

Please sign in to comment.