Skip to content

Commit 8b09832

Browse files
committed
Round 2: make clean_middle_ty take a binder
1 parent dbf4b8a commit 8b09832

File tree

5 files changed

+92
-56
lines changed

5 files changed

+92
-56
lines changed

src/librustdoc/clean/auto_trait.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ where
124124
unsafety: hir::Unsafety::Normal,
125125
generics: new_generics,
126126
trait_: Some(clean_trait_ref_with_bindings(self.cx, trait_ref, ThinVec::new())),
127-
for_: clean_middle_ty(ty, self.cx, None),
127+
for_: clean_middle_ty(ty::Binder::dummy(ty), self.cx, None),
128128
items: Vec::new(),
129129
polarity,
130130
kind: ImplKind::Auto,

src/librustdoc/clean/blanket_impl.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ impl<'a, 'tcx> BlanketImplFinder<'a, 'tcx> {
108108
ty::Binder::dummy(trait_ref.0),
109109
ThinVec::new(),
110110
)),
111-
for_: clean_middle_ty(ty.0, cx, None),
111+
for_: clean_middle_ty(ty::Binder::dummy(ty.0), cx, None),
112112
items: cx
113113
.tcx
114114
.associated_items(impl_def_id)
@@ -117,7 +117,7 @@ impl<'a, 'tcx> BlanketImplFinder<'a, 'tcx> {
117117
.collect::<Vec<_>>(),
118118
polarity: ty::ImplPolarity::Positive,
119119
kind: ImplKind::Blanket(Box::new(clean_middle_ty(
120-
trait_ref.0.self_ty(),
120+
ty::Binder::dummy(trait_ref.0.self_ty()),
121121
cx,
122122
None,
123123
))),

src/librustdoc/clean/inline.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ fn build_union(cx: &mut DocContext<'_>, did: DefId) -> clean::Union {
293293

294294
fn build_type_alias(cx: &mut DocContext<'_>, did: DefId) -> Box<clean::Typedef> {
295295
let predicates = cx.tcx.explicit_predicates_of(did);
296-
let type_ = clean_middle_ty(cx.tcx.type_of(did), cx, Some(did));
296+
let type_ = clean_middle_ty(ty::Binder::dummy(cx.tcx.type_of(did)), cx, Some(did));
297297

298298
Box::new(clean::Typedef {
299299
type_,
@@ -405,7 +405,7 @@ pub(crate) fn build_impl(
405405

406406
let for_ = match &impl_item {
407407
Some(impl_) => clean_ty(impl_.self_ty, cx),
408-
None => clean_middle_ty(tcx.type_of(did), cx, Some(did)),
408+
None => clean_middle_ty(ty::Binder::dummy(tcx.type_of(did)), cx, Some(did)),
409409
};
410410

411411
// Only inline impl if the implementing type is
@@ -641,14 +641,14 @@ pub(crate) fn print_inlined_const(tcx: TyCtxt<'_>, did: DefId) -> String {
641641

642642
fn build_const(cx: &mut DocContext<'_>, def_id: DefId) -> clean::Constant {
643643
clean::Constant {
644-
type_: clean_middle_ty(cx.tcx.type_of(def_id), cx, Some(def_id)),
644+
type_: clean_middle_ty(ty::Binder::dummy(cx.tcx.type_of(def_id)), cx, Some(def_id)),
645645
kind: clean::ConstantKind::Extern { def_id },
646646
}
647647
}
648648

649649
fn build_static(cx: &mut DocContext<'_>, did: DefId, mutable: bool) -> clean::Static {
650650
clean::Static {
651-
type_: clean_middle_ty(cx.tcx.type_of(did), cx, Some(did)),
651+
type_: clean_middle_ty(ty::Binder::dummy(cx.tcx.type_of(did)), cx, Some(did)),
652652
mutability: if mutable { Mutability::Mut } else { Mutability::Not },
653653
expr: None,
654654
}

0 commit comments

Comments
 (0)