remove un-needed variants
This commit is contained in:
parent
2069e8c218
commit
da2f897e59
@ -8,7 +8,7 @@
|
||||
//! For now, we are developing everything inside `rustc`, thus, we keep this module private.
|
||||
|
||||
use crate::rustc_smir::hir::def::DefKind;
|
||||
use crate::rustc_smir::stable_mir::ty::{BoundRegion, EarlyBoundRegion, FreeRegion, Region};
|
||||
use crate::rustc_smir::stable_mir::ty::{BoundRegion, EarlyBoundRegion, Region};
|
||||
use rustc_hir as hir;
|
||||
use rustc_middle::mir;
|
||||
use rustc_middle::mir::interpret::{alloc_range, AllocId};
|
||||
@ -1521,12 +1521,7 @@ impl<'tcx> Stable<'tcx> for ty::RegionKind<'tcx> {
|
||||
db_index.as_u32(),
|
||||
BoundRegion { var: bound_reg.var.as_u32(), kind: bound_reg.kind.stable(tables) },
|
||||
),
|
||||
ty::ReFree(free_reg) => RegionKind::ReFree(FreeRegion {
|
||||
scope: tables.region_def(free_reg.scope),
|
||||
bound_region: free_reg.bound_region.stable(tables),
|
||||
}),
|
||||
ty::ReStatic => RegionKind::ReStatic,
|
||||
ty::ReVar(vid_reg) => RegionKind::ReVar(vid_reg.as_u32()),
|
||||
ty::RePlaceholder(place_holder) => {
|
||||
RegionKind::RePlaceholder(stable_mir::ty::Placeholder {
|
||||
universe: place_holder.universe.as_u32(),
|
||||
@ -1537,7 +1532,7 @@ impl<'tcx> Stable<'tcx> for ty::RegionKind<'tcx> {
|
||||
})
|
||||
}
|
||||
ty::ReErased => RegionKind::ReErased,
|
||||
ty::ReError(_) => RegionKind::ReError(()),
|
||||
_=> unimplemented!()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -44,12 +44,9 @@ pub struct Region {
|
||||
pub enum RegionKind {
|
||||
ReEarlyBound(EarlyBoundRegion),
|
||||
ReLateBound(DebruijnIndex, BoundRegion),
|
||||
ReFree(FreeRegion),
|
||||
ReStatic,
|
||||
ReVar(RegionVid),
|
||||
RePlaceholder(Placeholder<BoundRegion>),
|
||||
ReErased,
|
||||
ReError(ErrorGuaranteed),
|
||||
}
|
||||
|
||||
pub(crate) type DebruijnIndex = u32;
|
||||
@ -69,14 +66,6 @@ pub struct BoundRegion {
|
||||
pub kind: BoundRegionKind,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct FreeRegion {
|
||||
pub scope: RegionDef,
|
||||
pub bound_region: BoundRegionKind,
|
||||
}
|
||||
|
||||
pub(crate) type RegionVid = u32;
|
||||
|
||||
pub(crate) type UniverseIndex = u32;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
@ -85,8 +74,6 @@ pub struct Placeholder<T> {
|
||||
pub bound: T,
|
||||
}
|
||||
|
||||
pub(crate) type ErrorGuaranteed = ();
|
||||
|
||||
#[derive(Clone, Copy, PartialEq, Eq)]
|
||||
pub struct Span(pub usize);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user