Skip to content

Commit

Permalink
Rollup merge of #112220 - kylematsuda:earlybinder-fix, r=compiler-errors
Browse files Browse the repository at this point in the history
Cleanup some `EarlyBinder::skip_binder()` -> `EarlyBinder::subst_identity()`

fix some incorrect `skip_binder()`'s as identified in #112006 (review)

r? `@compiler-errors` `@lcnr` `@jackh726`

(hope it's alright to just tag everyone who commented 😅)
  • Loading branch information
matthiaskrgr authored Jun 6, 2023
2 parents 00b2b66 + 57cbe25 commit 0d24c6a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/ty/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ impl<'tcx> Instance<'tcx> {
if let Some(substs) = self.substs_for_mir_body() {
v.subst(tcx, substs)
} else {
v.skip_binder()
v.subst_identity()
}
}

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_mir_transform/src/shim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ fn build_call_shim<'tcx>(
let mut sig = if let Some(sig_substs) = sig_substs {
sig.subst(tcx, &sig_substs)
} else {
sig.skip_binder()
sig.subst_identity()
};

if let CallKind::Indirect(fnty) = call_kind {
Expand Down
6 changes: 3 additions & 3 deletions src/librustdoc/clean/blanket_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ impl<'a, 'tcx> BlanketImplFinder<'a, 'tcx> {
// the post-inference `trait_ref`, as it's more accurate.
trait_: Some(clean_trait_ref_with_bindings(
cx,
ty::Binder::dummy(trait_ref.skip_binder()),
ty::Binder::dummy(trait_ref.subst_identity()),
ThinVec::new(),
)),
for_: clean_middle_ty(ty::Binder::dummy(ty.skip_binder()), cx, None),
for_: clean_middle_ty(ty::Binder::dummy(ty.subst_identity()), cx, None),
items: cx
.tcx
.associated_items(impl_def_id)
Expand All @@ -116,7 +116,7 @@ impl<'a, 'tcx> BlanketImplFinder<'a, 'tcx> {
.collect::<Vec<_>>(),
polarity: ty::ImplPolarity::Positive,
kind: ImplKind::Blanket(Box::new(clean_middle_ty(
ty::Binder::dummy(trait_ref.skip_binder().self_ty()),
ty::Binder::dummy(trait_ref.subst_identity().self_ty()),
cx,
None,
))),
Expand Down

0 comments on commit 0d24c6a

Please sign in to comment.