提交 c388c11a 编写于 作者: V varkor

Special-case (RangeEnd::Included, Ordering::Equal) in lower_pattern_unadjusted

上级 effb3d05
......@@ -391,7 +391,12 @@ fn lower_pattern_unadjusted(&mut self, pat: &'tcx hir::Pat) -> Pattern<'tcx> {
err.emit();
PatternKind::Wild
},
(RangeEnd::Included, Some(_)) => PatternKind::Range { lo, hi, end },
(RangeEnd::Included, Some(Ordering::Equal)) => {
PatternKind::Constant { value: lo }
}
(RangeEnd::Included, Some(Ordering::Less)) => {
PatternKind::Range { lo, hi, end }
}
}
}
_ => PatternKind::Wild
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册