Add Bound ty to SMIR
This commit is contained in:
parent
648cf070eb
commit
7af1697138
2 changed files with 18 additions and 1 deletions
|
@ -826,7 +826,9 @@ impl<'tcx> Stable<'tcx> for Ty<'tcx> {
|
|||
TyKind::Alias(alias_kind.stable(tables), alias_ty.stable(tables))
|
||||
}
|
||||
ty::Param(param_ty) => TyKind::Param(param_ty.stable(tables)),
|
||||
ty::Bound(_, _) => todo!(),
|
||||
ty::Bound(debruijn_idx, bound_ty) => {
|
||||
TyKind::Bound(debruijn_idx.as_usize(), bound_ty.stable(tables))
|
||||
}
|
||||
ty::Placeholder(..)
|
||||
| ty::GeneratorWitness(_)
|
||||
| ty::GeneratorWitnessMIR(_, _)
|
||||
|
@ -845,3 +847,11 @@ impl<'tcx> Stable<'tcx> for rustc_middle::ty::ParamTy {
|
|||
ParamTy { index: self.index, name: self.name.to_string() }
|
||||
}
|
||||
}
|
||||
|
||||
impl<'tcx> Stable<'tcx> for rustc_middle::ty::BoundTy {
|
||||
type T = stable_mir::ty::BoundTy;
|
||||
fn stable(&self, tables: &mut Tables<'tcx>) -> Self::T {
|
||||
use stable_mir::ty::BoundTy;
|
||||
BoundTy { var: self.var.as_usize(), kind: self.kind.stable(tables) }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@ pub enum TyKind {
|
|||
RigidTy(RigidTy),
|
||||
Alias(AliasKind, AliasTy),
|
||||
Param(ParamTy),
|
||||
Bound(usize, BoundTy),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
|
@ -235,3 +236,9 @@ pub struct ParamTy {
|
|||
pub index: u32,
|
||||
pub name: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct BoundTy {
|
||||
pub var: usize,
|
||||
pub kind: BoundTyKind,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue