]> git.lizzy.rs Git - rust.git/blob - src/test/ui/parser/closure-return-syntax.rs
Auto merge of #57006 - GuillaumeGomez:no-crate-filter, r=QuietMisdreavus
[rust.git] / src / test / ui / parser / closure-return-syntax.rs
1 // Test that we cannot parse a closure with an explicit return type
2 // unless it uses braces.
3
4 // compile-flags: -Z parse-only
5
6 fn main() {
7     let x = || -> i32 22;
8     //~^ ERROR expected one of `!`, `(`, `+`, `::`, `<`, or `{`, found `22`
9 }