|
10 | 10 | use crate::rustc_internal::{self, opaque};
|
11 | 11 | use crate::stable_mir::mir::{CopyNonOverlapping, UserTypeProjection, VariantIdx};
|
12 | 12 | use crate::stable_mir::ty::{
|
13 |
| - FloatTy, GenericParamDef, IntTy, Movability, RigidTy, Span, TyKind, UintTy, |
| 13 | + EarlyBoundRegion, FloatTy, GenericParamDef, IntTy, Movability, RigidTy, Span, TyKind, UintTy, |
14 | 14 | };
|
15 | 15 | use crate::stable_mir::{self, CompilerError, Context};
|
16 | 16 | use rustc_hir as hir;
|
@@ -1514,6 +1514,27 @@ impl<'tcx> Stable<'tcx> for ty::Region<'tcx> {
|
1514 | 1514 | }
|
1515 | 1515 | }
|
1516 | 1516 |
|
| 1517 | +impl<'tcx> Stable<'tcx> for ty::RegionKind<'tcx> { |
| 1518 | + type T = stable_mir::ty::RegionKind; |
| 1519 | + |
| 1520 | + fn stable(&self, tables: &mut Tables<'tcx>) -> Self::T { |
| 1521 | + match self { |
| 1522 | + ty::ReEarlyBound(early_reg) => RegionKind::ReEarlyBound(EarlyBoundRegion { |
| 1523 | + def_id: tables.region_def(early_reg.def_id), |
| 1524 | + index: early_reg.index, |
| 1525 | + name: early_reg.name.to_string(), |
| 1526 | + }), |
| 1527 | + ty::ReLateBound(_, _) => todo!(), |
| 1528 | + ty::ReFree(_) => todo!(), |
| 1529 | + ty::ReStatic => todo!(), |
| 1530 | + ty::ReVar(_) => todo!(), |
| 1531 | + ty::RePlaceholder(_) => todo!(), |
| 1532 | + ty::ReErased => todo!(), |
| 1533 | + ty::ReError(_) => todo!(), |
| 1534 | + } |
| 1535 | + } |
| 1536 | +} |
| 1537 | + |
1517 | 1538 | impl<'tcx> Stable<'tcx> for rustc_span::Span {
|
1518 | 1539 | type T = stable_mir::ty::Span;
|
1519 | 1540 |
|
|
0 commit comments