blob: 194cfab8527c014a2a08d212364d6449f92d670e [file] [log] [blame]
error[E0308]: mismatched types
--> $DIR/issue-20862.rs:12:5
|
LL | fn foo(x: i32) {
| - possibly return type missing here?
LL | |y| x + y
| ^^^^^^^^^ expected (), found closure
|
= note: expected type `()`
found type `[closure@$DIR/issue-20862.rs:12:5: 12:14 x:_]`
error[E0618]: expected function, found `()`
--> $DIR/issue-20862.rs:17:13
|
LL | / fn foo(x: i32) {
LL | | |y| x + y
LL | | //~^ ERROR: mismatched types
LL | | }
| |_- `foo` defined here returns `()`
...
LL | let x = foo(5)(2);
| ^^^^^^---
| |
| call expression requires function
error: aborting due to 2 previous errors
Some errors occurred: E0308, E0618.
For more information about an error, try `rustc --explain E0308`.