Skip to content

Commit 07deb93

Browse files
committed
or-patterns: middle/dead: make a hack less hacky.
1 parent d7139f3 commit 07deb93

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/librustc/middle/dead.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,8 @@ impl<'a, 'tcx> Visitor<'tcx> for MarkSymbolVisitor<'a, 'tcx> {
260260

261261
fn visit_arm(&mut self, arm: &'tcx hir::Arm) {
262262
let pats = arm.top_pats_hack();
263-
if pats.len() == 1 {
264-
let variants = pats[0].necessary_variants();
263+
if let [pat] = pats {
264+
let variants = pat.necessary_variants();
265265

266266
// Inside the body, ignore constructions of variants
267267
// necessary for the pattern to match. Those construction sites

0 commit comments

Comments
 (0)