diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-03-28 17:40:49 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-28 17:40:49 +0100 |
| commit | 69cfe80834f58b679fdc71420f709e585b50c18f (patch) | |
| tree | 42dde2dda649dfabd14b0181c4092b73fa279041 /tests | |
| parent | 732ded92a02f284a43ed2252853981f044821107 (diff) | |
| parent | 950b40f1119ebe5ae51555ca7d236a899b604a4c (diff) | |
| download | rust-69cfe80834f58b679fdc71420f709e585b50c18f.tar.gz rust-69cfe80834f58b679fdc71420f709e585b50c18f.zip | |
Rollup merge of #123096 - compiler-errors:postfix-match-parens, r=fmease
Don't check match scrutinee of postfix match for unused parens We only check the scrutinees of block-like constructs and a few others (return/index/assign/method calls). Just don't do it for postfix match at all. Fixes #123064 r? fmease
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/match/postfix-match/no-unused-parens.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/ui/match/postfix-match/no-unused-parens.rs b/tests/ui/match/postfix-match/no-unused-parens.rs new file mode 100644 index 00000000000..46cac7a6107 --- /dev/null +++ b/tests/ui/match/postfix-match/no-unused-parens.rs @@ -0,0 +1,8 @@ +//@ check-pass + +#![feature(postfix_match)] + +fn main() { + (&1).match { a => a }; + (1 + 2).match { b => b }; +} |
