1
Fork 0

add CoroutineWitness to covered types

This commit is contained in:
Oğuz Ağcayazı 2023-11-10 17:02:08 +03:00
parent 3d0e99d632
commit 6812f64c35
4 changed files with 14 additions and 1 deletions

View file

@ -104,6 +104,10 @@ impl<'tcx> Tables<'tcx> {
stable_mir::ty::RegionDef(self.create_def_id(did))
}
pub fn coroutine_witness_def(&mut self, did: DefId) -> stable_mir::ty::CoroutineWitnessDef {
stable_mir::ty::CoroutineWitnessDef(self.create_def_id(did))
}
pub fn prov(&mut self, aid: AllocId) -> stable_mir::ty::Prov {
stable_mir::ty::Prov(self.create_alloc_id(aid))
}

View file

@ -1292,7 +1292,11 @@ impl<'tcx> Stable<'tcx> for ty::TyKind<'tcx> {
ty::Bound(debruijn_idx, bound_ty) => {
TyKind::Bound(debruijn_idx.as_usize(), bound_ty.stable(tables))
}
ty::Placeholder(..) | ty::CoroutineWitness(..) | ty::Infer(_) | ty::Error(_) => {
ty::CoroutineWitness(def_id, args) => TyKind::RigidTy(RigidTy::CoroutineWitness(
tables.coroutine_witness_def(*def_id),
args.stable(tables),
)),
ty::Placeholder(..) | ty::Infer(_) | ty::Error(_) => {
unreachable!();
}
}