rust/tests/ui/parser/closure-return-syntax.rs

8 lines
175 B
Rust

// Test that we cannot parse a closure with an explicit return type
// unless it uses braces.
fn main() {
let x = || -> i32 22;
//~^ ERROR expected `{`, found `22`
}