or-patterns: middle/dead: make a hack less hacky.

This commit is contained in:
Mazdak Farrokhzad 2019-09-15 18:44:32 +02:00
parent d7139f3e6d
commit 07deb93bb2

View File

@ -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