Err(match_pair)
}
- PatternKind::Array { ref prefix, ref slice, ref suffix } => {
+ PatternKind::Range { .. } |
+ PatternKind::Variant { .. } => {
+ // cannot simplify, test is required
+ Err(match_pair)
+ }
+
+ PatternKind::Slice { .. } if !match_pair.slice_len_checked => {
+ Err(match_pair)
+ }
+
+ PatternKind::Array { ref prefix, ref slice, ref suffix } |
+ PatternKind::Slice { ref prefix, ref slice, ref suffix } => {
unpack!(block = self.prefix_suffix_slice(&mut candidate.match_pairs,
block,
match_pair.lvalue.clone(),
Ok(block)
}
- PatternKind::Slice { .. } |
- PatternKind::Range { .. } |
- PatternKind::Variant { .. } => {
- // cannot simplify, test is required
- Err(match_pair)
- }
-
PatternKind::Leaf { ref subpatterns } => {
// tuple struct, match subpats (if any)
candidate.match_pairs