1 error[E0308]: mismatched types
2 --> $DIR/issue-20862.rs:2:5
5 | - possibly return type missing here?
7 | ^^^^^^^^^ expected `()`, found closure
9 = note: expected unit type `()`
10 found closure `[closure@$DIR/issue-20862.rs:2:5: 2:14 x:_]`
12 error[E0618]: expected function, found `()`
13 --> $DIR/issue-20862.rs:7:13
15 LL | / fn foo(x: i32) {
19 | |_- `foo` defined here returns `()`
21 LL | let x = foo(5)(2);
24 | call expression requires function
26 error: aborting due to 2 previous errors
28 Some errors have detailed explanations: E0308, E0618.
29 For more information about an error, try `rustc --explain E0308`.