|
7 | 7 | //!
|
8 | 8 | //! For now, we are developing everything inside `rustc`, thus, we keep this module private.
|
9 | 9 |
|
10 |
| -use hir::def::DefKind; |
| 10 | +use crate::rustc_internal::{self, opaque}; |
| 11 | +use crate::stable_mir::mir::{CopyNonOverlapping, UserTypeProjection, VariantIdx}; |
| 12 | +use crate::stable_mir::ty::{ |
| 13 | + EarlyBoundRegion, FloatTy, GenericParamDef, IntTy, Movability, RigidTy, Span, TyKind, UintTy, |
| 14 | +}; |
| 15 | +use crate::stable_mir::{self, CompilerError, Context}; |
11 | 16 | use rustc_hir as hir;
|
12 | 17 | use rustc_middle::mir;
|
13 | 18 | use rustc_middle::mir::interpret::{alloc_range, AllocId};
|
@@ -1506,6 +1511,27 @@ impl<'tcx> Stable<'tcx> for ty::Region<'tcx> {
|
1506 | 1511 | }
|
1507 | 1512 | }
|
1508 | 1513 |
|
| 1514 | +impl<'tcx> Stable<'tcx> for ty::RegionKind<'tcx> { |
| 1515 | + type T = stable_mir::ty::RegionKind; |
| 1516 | + |
| 1517 | + fn stable(&self, tables: &mut Tables<'tcx>) -> Self::T { |
| 1518 | + match self { |
| 1519 | + ty::ReEarlyBound(early_reg) => RegionKind::ReEarlyBound(EarlyBoundRegion { |
| 1520 | + def_id: tables.region_def(early_reg.def_id), |
| 1521 | + index: early_reg.index, |
| 1522 | + name: early_reg.name.to_string(), |
| 1523 | + }), |
| 1524 | + ty::ReLateBound(_, _) => todo!(), |
| 1525 | + ty::ReFree(_) => todo!(), |
| 1526 | + ty::ReStatic => todo!(), |
| 1527 | + ty::ReVar(_) => todo!(), |
| 1528 | + ty::RePlaceholder(_) => todo!(), |
| 1529 | + ty::ReErased => todo!(), |
| 1530 | + ty::ReError(_) => todo!(), |
| 1531 | + } |
| 1532 | + } |
| 1533 | +} |
| 1534 | + |
1509 | 1535 | impl<'tcx> Stable<'tcx> for rustc_span::Span {
|
1510 | 1536 | type T = stable_mir::ty::Span;
|
1511 | 1537 |
|
|
0 commit comments