summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2023-04-30 14:08:26 +0000
committerMark Rousskov <mark.simulacrum@gmail.com>2023-05-06 11:12:48 -0400
commit7fc63a62eeef5dd6c81ba744fa7f4890c2b86b90 (patch)
tree1838a8a3d6487aa13d7bf63772cd567070f2ee56
parentcc38d9fe09fc068e5b070b31f4bd2f211ca5c067 (diff)
downloadrust-7fc63a62eeef5dd6c81ba744fa7f4890c2b86b90.tar.gz
Remove wrong assertion.
-rw-r--r--compiler/rustc_mir_build/src/thir/pattern/check_match.rs3
-rw-r--r--tests/ui/match/guards-parenthesized-and.rs10
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!(),
+ }
+}