Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions compiler/rustc_public/src/unstable/convert/stable/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,12 @@ impl<'tcx> Stable<'tcx> for ty::TyKind<'tcx> {
ty::FnPtr(sig_tys, hdr) => {
TyKind::RigidTy(RigidTy::FnPtr(sig_tys.with(*hdr).stable(tables, cx)))
}
// FIXME(unsafe_binders):
ty::UnsafeBinder(_) => todo!(),
// Represent unsafe binders by their inner type with regions erased,
// matching other ty queries; full binder structure is not in RigidTy yet.
ty::UnsafeBinder(bound_ty) => {
let inner = cx.tcx.instantiate_bound_regions_with_erased((*bound_ty).into());
inner.stable(tables, cx)
}
ty::Dynamic(existential_predicates, region) => TyKind::RigidTy(RigidTy::Dynamic(
existential_predicates
.iter()
Expand All @@ -478,7 +482,12 @@ impl<'tcx> Stable<'tcx> for ty::TyKind<'tcx> {
tables.closure_def(*def_id),
generic_args.stable(tables, cx),
)),
ty::CoroutineClosure(..) => todo!("FIXME(async_closures): Lower these to SMIR"),
ty::CoroutineClosure(def_id, generic_args) => {
TyKind::RigidTy(RigidTy::CoroutineClosure(
tables.coroutine_closure_def(*def_id),
generic_args.stable(tables, cx),
))
}
ty::Coroutine(def_id, generic_args) => TyKind::RigidTy(RigidTy::Coroutine(
tables.coroutine_def(*def_id),
generic_args.stable(tables, cx),
Expand Down