Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 4df47a0

Browse files
committed
Add test of closure precedence with return type
1 parent 193d827 commit 4df47a0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/ui-fulldeps/pprust-parenthesis-insertion.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ static EXPRS: &[&str] = &[
7373
// Closures and jumps have equal precedence.
7474
"|| return break 2",
7575
"return break || 2",
76+
// Closures with a return type have especially high precedence.
77+
"(|| -> T { x }) + 1", // FIXME: no parenthesis needed.
78+
"(|| { x }) + 1",
7679
// These mean different things.
7780
"if let _ = true && false {}",
7881
"if let _ = (true && false) {}",

0 commit comments

Comments
 (0)