Skip to content

Commit 0715bb1

Browse files
committed
Auto merge of #147138 - jackh726:split-canonical-bound, r=lcnr
Split Bound index into Canonical and Bound See [#t-types/trait-system-refactor > perf &rust-lang#96;async-closures/post-mono-higher-ranked-hang.rs&rust-lang#96;](https://rust-lang.zulipchat.com/#narrow/channel/364551-t-types.2Ftrait-system-refactor/topic/perf.20.60async-closures.2Fpost-mono-higher-ranked-hang.2Ers.60/with/541535613) for context Things compile and tests pass, but not sure if this actually solves the perf issue (edit: it does). Opening up this to do a perf (and maybe crater) run. r? lcnr
2 parents faafb73 + 2aad3df commit 0715bb1

File tree

1 file changed

+5
-2
lines changed
  • rustc_public/src/unstable/convert/stable

1 file changed

+5
-2
lines changed

rustc_public/src/unstable/convert/stable/ty.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,10 @@ impl<'tcx> Stable<'tcx> for ty::TyKind<'tcx> {
453453
TyKind::Alias(alias_kind.stable(tables, cx), alias_ty.stable(tables, cx))
454454
}
455455
ty::Param(param_ty) => TyKind::Param(param_ty.stable(tables, cx)),
456-
ty::Bound(debruijn_idx, bound_ty) => {
456+
ty::Bound(ty::BoundVarIndexKind::Canonical, _) => {
457+
unreachable!()
458+
}
459+
ty::Bound(ty::BoundVarIndexKind::Bound(debruijn_idx), bound_ty) => {
457460
TyKind::Bound(debruijn_idx.as_usize(), bound_ty.stable(tables, cx))
458461
}
459462
ty::CoroutineWitness(def_id, args) => TyKind::RigidTy(RigidTy::CoroutineWitness(
@@ -907,7 +910,7 @@ impl<'tcx> Stable<'tcx> for ty::RegionKind<'tcx> {
907910
index: early_reg.index,
908911
name: early_reg.name.to_string(),
909912
}),
910-
ty::ReBound(db_index, bound_reg) => RegionKind::ReBound(
913+
ty::ReBound(ty::BoundVarIndexKind::Bound(db_index), bound_reg) => RegionKind::ReBound(
911914
db_index.as_u32(),
912915
BoundRegion {
913916
var: bound_reg.var.as_u32(),

0 commit comments

Comments
 (0)