1 error[E0308]: mismatched types
2 --> $DIR/issue-20862.rs:12:5
5 | - possibly return type missing here?
7 | ^^^^^^^^^ expected (), found closure
9 = note: expected type `()`
10 found type `[closure@$DIR/issue-20862.rs:12:5: 12:14 x:_]`
12 error[E0618]: expected function, found `()`
13 --> $DIR/issue-20862.rs:17:13
15 LL | let x = foo(5)(2);
16 | ^^^^^^^^^ not a function
18 error: aborting due to 2 previous errors
20 Some errors occurred: E0308, E0618.
21 For more information about an error, try `rustc --explain E0308`.