rust/tests/ui/parser/issues/issue-32505.rs
Esteban Küber 6b2c6c7fd3 Detect ruby-style closure in parser
When parsing a closure without a body that is surrounded by a block,
suggest moving the opening brace after the closure head.

Fix #116608.
2023-10-12 21:50:18 +00:00

7 lines
143 B
Rust

pub fn test() {
foo(|_|) //~ ERROR expected expression, found `)`
//~^ ERROR cannot find function `foo` in this scope
}
fn main() { }