diff --git a/src/librustc/middle/dead.rs b/src/librustc/middle/dead.rs index 666c1cc96f2..1818dede3e2 100644 --- a/src/librustc/middle/dead.rs +++ b/src/librustc/middle/dead.rs @@ -260,8 +260,8 @@ fn visit_expr(&mut self, expr: &'tcx hir::Expr) { fn visit_arm(&mut self, arm: &'tcx hir::Arm) { let pats = arm.top_pats_hack(); - if pats.len() == 1 { - let variants = pats[0].necessary_variants(); + if let [pat] = pats { + let variants = pat.necessary_variants(); // Inside the body, ignore constructions of variants // necessary for the pattern to match. Those construction sites