Avoid having to handle an Option in the type system

This commit is contained in:
Oli Scherer
2025-02-05 15:22:10 +00:00
parent 4f2b108816
commit 0e7b283573
21 changed files with 146 additions and 109 deletions

View File

@@ -90,8 +90,8 @@ impl RustcInternal for Pattern {
fn internal<'tcx>(&self, tables: &mut Tables<'_>, tcx: TyCtxt<'tcx>) -> Self::T<'tcx> {
tcx.mk_pat(match self {
Pattern::Range { start, end, include_end } => rustc_ty::PatternKind::Range {
start: start.as_ref().map(|c| c.internal(tables, tcx)),
end: end.as_ref().map(|c| c.internal(tables, tcx)),
start: start.as_ref().unwrap().internal(tables, tcx),
end: end.as_ref().unwrap().internal(tables, tcx),
include_end: if *include_end { RangeEnd::Included } else { RangeEnd::Excluded },
},
})