diff options
author | Camille GILLOT <gillot.camille@gmail.com> | 2023-04-30 14:08:26 +0000 |
---|---|---|
committer | Mark Rousskov <mark.simulacrum@gmail.com> | 2023-05-06 11:12:48 -0400 |
commit | 7fc63a62eeef5dd6c81ba744fa7f4890c2b86b90 (patch) | |
tree | 1838a8a3d6487aa13d7bf63772cd567070f2ee56 | |
parent | cc38d9fe09fc068e5b070b31f4bd2f211ca5c067 (diff) | |
download | rust-7fc63a62eeef5dd6c81ba744fa7f4890c2b86b90.tar.gz |
Remove wrong assertion.
-rw-r--r-- | compiler/rustc_mir_build/src/thir/pattern/check_match.rs | 3 | ||||
-rw-r--r-- | tests/ui/match/guards-parenthesized-and.rs | 10 |
2 files changed, 10 insertions, 3 deletions
diff --git a/compiler/rustc_mir_build/src/thir/pattern/check_match.rs b/compiler/rustc_mir_build/src/thir/pattern/check_match.rs index bac46db2b1e..8f58db504f6 100644 --- a/compiler/rustc_mir_build/src/thir/pattern/check_match.rs +++ b/compiler/rustc_mir_build/src/thir/pattern/check_match.rs @@ -334,9 +334,6 @@ impl<'p, 'tcx> MatchVisitor<'_, 'p, 'tcx> { let refutable = !is_let_irrefutable(&mut ncx, local_lint_level, tpat); Some((expr.span, refutable)) } - ExprKind::LogicalOp { op: LogicalOp::And, .. } => { - bug!() - } _ => None, } }; diff --git a/tests/ui/match/guards-parenthesized-and.rs b/tests/ui/match/guards-parenthesized-and.rs new file mode 100644 index 00000000000..3a1c341f3ee --- /dev/null +++ b/tests/ui/match/guards-parenthesized-and.rs @@ -0,0 +1,10 @@ +// check-pass + +fn main() { + let c = 1; + let w = "T"; + match Some(5) { + None if c == 1 && (w != "Y" && w != "E") => {} + _ => panic!(), + } +} |