Skip to content

Commit d66125e

Browse files
committed
Merged tests/ui/typeck/non-function-call-error-2 with
tests/ui/typeck/non-function-call-error
1 parent c2e43ff commit d66125e

File tree

4 files changed

+32
-32
lines changed

4 files changed

+32
-32
lines changed

tests/ui/typeck/non-function-call-error-2.rs

Lines changed: 0 additions & 7 deletions
This file was deleted.

tests/ui/typeck/non-function-call-error-2.stderr

Lines changed: 0 additions & 23 deletions
This file was deleted.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
1+
//! Regression test for issue #10969, #22468
2+
13
fn main() {
24
let foo = "bar";
35
let x = foo("baz");
46
//~^ ERROR: expected function, found `&str`
7+
8+
let i = 0i32;
9+
i();
10+
//~^ ERROR expected function, found `i32`
511
}
612

713
fn foo(file: &str) -> bool {
814
true
915
}
16+
17+
fn func(i: i32) {
18+
i(); //~ERROR expected function, found `i32`
19+
}

tests/ui/typeck/non-function-call-error.stderr

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0618]: expected function, found `&str`
2-
--> $DIR/issue-22468.rs:3:13
2+
--> $DIR/non-function-call-error.rs:5:13
33
|
44
LL | let foo = "bar";
55
| --- `foo` has type `&str`
@@ -11,6 +11,26 @@ LL | let x = foo("baz");
1111
LL | fn foo(file: &str) -> bool {
1212
| -------------------------- this function of the same name is available here, but it's shadowed by the local binding
1313

14-
error: aborting due to 1 previous error
14+
error[E0618]: expected function, found `i32`
15+
--> $DIR/non-function-call-error.rs:9:5
16+
|
17+
LL | let i = 0i32;
18+
| - `i` has type `i32`
19+
LL | i();
20+
| ^--
21+
| |
22+
| call expression requires function
23+
24+
error[E0618]: expected function, found `i32`
25+
--> $DIR/non-function-call-error.rs:18:5
26+
|
27+
LL | fn func(i: i32) {
28+
| - `i` has type `i32`
29+
LL | i();
30+
| ^--
31+
| |
32+
| call expression requires function
33+
34+
error: aborting due to 3 previous errors
1535

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

0 commit comments

Comments
 (0)