Skip to content

Commit 94017c0

Browse files
committed
fixup of argument-suggestions/exotic-calls.rs
1 parent 6ddabd3 commit 94017c0

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

tests/ui/argument-suggestions/exotic-calls.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ fn foo<T: Fn()>(t: T) {
77
//~^ ERROR function takes 0 arguments but 1 argument was supplied
88
}
99

10+
/// Regression test for <https://github.com/rust-lang/rust/issues/16939>
1011
fn foo2<T: Fn()>(f: T) {
1112
|t| f(t);
1213
//~^ ERROR function takes 0 arguments but 1 argument was supplied

tests/ui/argument-suggestions/exotic-calls.stderr

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ LL + t();
1616
|
1717

1818
error[E0057]: this function takes 0 arguments but 1 argument was supplied
19-
--> $DIR/exotic-calls.rs:11:9
19+
--> $DIR/exotic-calls.rs:12:9
2020
|
2121
LL | |t| f(t);
2222
| ^ - unexpected argument
2323
|
2424
note: callable defined here
25-
--> $DIR/exotic-calls.rs:10:12
25+
--> $DIR/exotic-calls.rs:11:12
2626
|
2727
LL | fn foo2<T: Fn()>(f: T) {
2828
| ^^^^
@@ -33,13 +33,13 @@ LL + |t| f();
3333
|
3434

3535
error[E0057]: this function takes 0 arguments but 1 argument was supplied
36-
--> $DIR/exotic-calls.rs:16:5
36+
--> $DIR/exotic-calls.rs:17:5
3737
|
3838
LL | t(1i32);
3939
| ^ ---- unexpected argument of type `i32`
4040
|
4141
note: type parameter defined here
42-
--> $DIR/exotic-calls.rs:15:11
42+
--> $DIR/exotic-calls.rs:16:11
4343
|
4444
LL | fn bar(t: impl Fn()) {
4545
| ^^^^^^^^^
@@ -50,13 +50,13 @@ LL + t();
5050
|
5151

5252
error[E0057]: this function takes 0 arguments but 1 argument was supplied
53-
--> $DIR/exotic-calls.rs:25:5
53+
--> $DIR/exotic-calls.rs:26:5
5454
|
5555
LL | baz()(1i32)
5656
| ^^^^^ ---- unexpected argument of type `i32`
5757
|
5858
note: opaque type defined here
59-
--> $DIR/exotic-calls.rs:20:13
59+
--> $DIR/exotic-calls.rs:21:13
6060
|
6161
LL | fn baz() -> impl Fn() {
6262
| ^^^^^^^^^
@@ -67,13 +67,13 @@ LL + baz()()
6767
|
6868

6969
error[E0057]: this function takes 0 arguments but 1 argument was supplied
70-
--> $DIR/exotic-calls.rs:31:5
70+
--> $DIR/exotic-calls.rs:32:5
7171
|
7272
LL | x(1i32);
7373
| ^ ---- unexpected argument of type `i32`
7474
|
7575
note: closure defined here
76-
--> $DIR/exotic-calls.rs:30:13
76+
--> $DIR/exotic-calls.rs:31:13
7777
|
7878
LL | let x = || {};
7979
| ^^

0 commit comments

Comments
 (0)