Skip to content

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

+3
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)