Add Param ty to SMIR
This commit is contained in:
parent
a6236fa460
commit
648cf070eb
2 changed files with 16 additions and 1 deletions
|
@ -825,7 +825,7 @@ impl<'tcx> Stable<'tcx> for Ty<'tcx> {
|
||||||
ty::Alias(alias_kind, alias_ty) => {
|
ty::Alias(alias_kind, alias_ty) => {
|
||||||
TyKind::Alias(alias_kind.stable(tables), alias_ty.stable(tables))
|
TyKind::Alias(alias_kind.stable(tables), alias_ty.stable(tables))
|
||||||
}
|
}
|
||||||
ty::Param(_) => todo!(),
|
ty::Param(param_ty) => TyKind::Param(param_ty.stable(tables)),
|
||||||
ty::Bound(_, _) => todo!(),
|
ty::Bound(_, _) => todo!(),
|
||||||
ty::Placeholder(..)
|
ty::Placeholder(..)
|
||||||
| ty::GeneratorWitness(_)
|
| ty::GeneratorWitness(_)
|
||||||
|
@ -837,3 +837,11 @@ impl<'tcx> Stable<'tcx> for Ty<'tcx> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<'tcx> Stable<'tcx> for rustc_middle::ty::ParamTy {
|
||||||
|
type T = stable_mir::ty::ParamTy;
|
||||||
|
fn stable(&self, _: &mut Tables<'tcx>) -> Self::T {
|
||||||
|
use stable_mir::ty::ParamTy;
|
||||||
|
ParamTy { index: self.index, name: self.name.to_string() }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@ type Span = Opaque;
|
||||||
pub enum TyKind {
|
pub enum TyKind {
|
||||||
RigidTy(RigidTy),
|
RigidTy(RigidTy),
|
||||||
Alias(AliasKind, AliasTy),
|
Alias(AliasKind, AliasTy),
|
||||||
|
Param(ParamTy),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
|
@ -228,3 +229,9 @@ pub struct ExistentialProjection {
|
||||||
pub generic_args: GenericArgs,
|
pub generic_args: GenericArgs,
|
||||||
pub term: TermKind,
|
pub term: TermKind,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Debug)]
|
||||||
|
pub struct ParamTy {
|
||||||
|
pub index: u32,
|
||||||
|
pub name: String,
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue