Add test of closure precedence with return type

This commit is contained in:
David Tolnay 2024-12-02 17:37:03 -08:00
parent 193d82797c
commit 4df47a09a4
No known key found for this signature in database
GPG key ID: F9BA143B95FF6D82

View file

@ -73,6 +73,9 @@ static EXPRS: &[&str] = &[
// Closures and jumps have equal precedence.
"|| return break 2",
"return break || 2",
// Closures with a return type have especially high precedence.
"(|| -> T { x }) + 1", // FIXME: no parenthesis needed.
"(|| { x }) + 1",
// These mean different things.
"if let _ = true && false {}",
"if let _ = (true && false) {}",