A ConstantValue constructor with a slice pattern is an error

This commit is contained in:
Nadrieril 2020-10-17 20:07:06 +01:00
parent c3d0445021
commit 99852e0db6

View file

@ -2559,7 +2559,6 @@ fn specialize_one_pattern<'p, 'tcx>(
let suffix = suffix.iter().enumerate().map(|(i, p)| (arity - suffix.len() + i, p));
Some(ctor_wild_subpatterns.replace_fields_indexed(prefix.chain(suffix)))
}
ConstantValue(_) => None,
_ => span_bug!(pat.span, "unexpected ctor {:?} for slice pat", constructor),
},