Skip to content

Commit c388c11

Browse files
committed
Special-case (RangeEnd::Included, Ordering::Equal) in lower_pattern_unadjusted
1 parent effb3d0 commit c388c11

File tree

1 file changed

+6
-1
lines changed
  • src/librustc_mir/hair/pattern

1 file changed

+6
-1
lines changed

src/librustc_mir/hair/pattern/mod.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,12 @@ impl<'a, 'tcx> PatternContext<'a, 'tcx> {
391391
err.emit();
392392
PatternKind::Wild
393393
},
394-
(RangeEnd::Included, Some(_)) => PatternKind::Range { lo, hi, end },
394+
(RangeEnd::Included, Some(Ordering::Equal)) => {
395+
PatternKind::Constant { value: lo }
396+
}
397+
(RangeEnd::Included, Some(Ordering::Less)) => {
398+
PatternKind::Range { lo, hi, end }
399+
}
395400
}
396401
}
397402
_ => PatternKind::Wild

0 commit comments

Comments
 (0)