mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-29 20:46:07 +03:00
Add Bound ty to SMIR
This commit is contained in:
@@ -826,7 +826,9 @@ fn stable(&self, tables: &mut Tables<'tcx>) -> Self::T {
|
||||
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 @@ fn stable(&self, _: &mut Tables<'tcx>) -> Self::T {
|
||||
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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user