Skip to content

Commit 32e0ef3

Browse files
Add some additional double-adjustment regression tests
1 parent db41351 commit 32e0ef3

File tree

4 files changed

+46
-0
lines changed

4 files changed

+46
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
fn main() {
2+
(|_, ()| ())(if true {} else {return;});
3+
//~^ ERROR this function takes 2 arguments but 1 argument was supplied
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
error[E0057]: this function takes 2 arguments but 1 argument was supplied
2+
--> $DIR/issue-98894.rs:2:5
3+
|
4+
LL | (|_, ()| ())(if true {} else {return;});
5+
| ^^^^^^^^^^^^--------------------------- an argument of type `()` is missing
6+
|
7+
note: closure defined here
8+
--> $DIR/issue-98894.rs:2:6
9+
|
10+
LL | (|_, ()| ())(if true {} else {return;});
11+
| ^^^^^^^
12+
help: provide the argument
13+
|
14+
LL | (|_, ()| ())(if true {} else {return;}, ());
15+
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16+
17+
error: aborting due to previous error
18+
19+
For more information about this error, try `rustc --explain E0057`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
fn main() {
2+
(|_, ()| ())([return, ()]);
3+
//~^ ERROR this function takes 2 arguments but 1 argument was supplied
4+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
error[E0057]: this function takes 2 arguments but 1 argument was supplied
2+
--> $DIR/issue-98897.rs:2:5
3+
|
4+
LL | (|_, ()| ())([return, ()]);
5+
| ^^^^^^^^^^^^-------------- an argument of type `()` is missing
6+
|
7+
note: closure defined here
8+
--> $DIR/issue-98897.rs:2:6
9+
|
10+
LL | (|_, ()| ())([return, ()]);
11+
| ^^^^^^^
12+
help: provide the argument
13+
|
14+
LL | (|_, ()| ())([return, ()], ());
15+
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16+
17+
error: aborting due to previous error
18+
19+
For more information about this error, try `rustc --explain E0057`.

0 commit comments

Comments
 (0)