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 | let x = foo(5)(2); | ^^^^^^^^^ not a function error: aborting due to 2 previous errors Some errors occurred: E0308, E0618. For more information about an error, try `rustc --explain E0308`.