rust/tests/ui/parser/closure-return-syntax.rs
2023-01-11 09:32:08 +00:00

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`
}