Skip to content

Commit d90138b

Browse files
committed
Remove now-unnecessary blanket impl HIR check
1 parent eae2026 commit d90138b

File tree

1 file changed

+5
-22
lines changed

1 file changed

+5
-22
lines changed

src/librustdoc/clean/blanket_impl.rs

+5-22
Original file line numberDiff line numberDiff line change
@@ -101,27 +101,6 @@ impl<'a, 'tcx> BlanketImplFinder<'a, 'tcx> {
101101

102102
cx.generated_synthetics.insert((ty, trait_def_id));
103103

104-
let hir_imp = impl_def_id.as_local()
105-
.map(|local| cx.tcx.hir().expect_item(local))
106-
.and_then(|item| if let hir::ItemKind::Impl(i) = &item.kind {
107-
Some(i)
108-
} else {
109-
None
110-
});
111-
112-
let items = match hir_imp {
113-
Some(imp) => imp
114-
.items
115-
.iter()
116-
.map(|ii| cx.tcx.hir().impl_item(ii.id).clean(cx))
117-
.collect::<Vec<_>>(),
118-
None => cx.tcx
119-
.associated_items(impl_def_id)
120-
.in_definition_order()
121-
.map(|x| x.clean(cx))
122-
.collect::<Vec<_>>(),
123-
};
124-
125104
impls.push(Item {
126105
name: None,
127106
attrs: Default::default(),
@@ -138,7 +117,11 @@ impl<'a, 'tcx> BlanketImplFinder<'a, 'tcx> {
138117
// the post-inference `trait_ref`, as it's more accurate.
139118
trait_: Some(trait_ref.clean(cx)),
140119
for_: ty.clean(cx),
141-
items,
120+
items: cx.tcx
121+
.associated_items(impl_def_id)
122+
.in_definition_order()
123+
.map(|x| x.clean(cx))
124+
.collect::<Vec<_>>(),
142125
polarity: ty::ImplPolarity::Positive,
143126
kind: ImplKind::Blanket(box trait_ref.self_ty().clean(cx)),
144127
}),

0 commit comments

Comments
 (0)