diff options
| author | Rune Tynan <runetynan@gmail.com> | 2022-01-27 12:35:52 -0500 |
|---|---|---|
| committer | Rune Tynan <runetynan@gmail.com> | 2022-01-28 10:45:20 -0500 |
| commit | d90138bec8f406b5c01c6bed4c0e597df2f3b00f (patch) | |
| tree | 0a9df6a701dced11bcc9e85eaa32172dcda17bed /src | |
| parent | eae2026326058cb7021816d3630da1f8c47ebc6d (diff) | |
| download | rust-d90138bec8f406b5c01c6bed4c0e597df2f3b00f.tar.gz rust-d90138bec8f406b5c01c6bed4c0e597df2f3b00f.zip | |
Remove now-unnecessary blanket impl HIR check
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustdoc/clean/blanket_impl.rs | 27 |
1 files changed, 5 insertions, 22 deletions
diff --git a/src/librustdoc/clean/blanket_impl.rs b/src/librustdoc/clean/blanket_impl.rs index 75ee663b926..6f4b87750ff 100644 --- a/src/librustdoc/clean/blanket_impl.rs +++ b/src/librustdoc/clean/blanket_impl.rs @@ -101,27 +101,6 @@ impl<'a, 'tcx> BlanketImplFinder<'a, 'tcx> { cx.generated_synthetics.insert((ty, trait_def_id)); - let hir_imp = impl_def_id.as_local() - .map(|local| cx.tcx.hir().expect_item(local)) - .and_then(|item| if let hir::ItemKind::Impl(i) = &item.kind { - Some(i) - } else { - None - }); - - let items = match hir_imp { - Some(imp) => imp - .items - .iter() - .map(|ii| cx.tcx.hir().impl_item(ii.id).clean(cx)) - .collect::<Vec<_>>(), - None => cx.tcx - .associated_items(impl_def_id) - .in_definition_order() - .map(|x| x.clean(cx)) - .collect::<Vec<_>>(), - }; - impls.push(Item { name: None, attrs: Default::default(), @@ -138,7 +117,11 @@ impl<'a, 'tcx> BlanketImplFinder<'a, 'tcx> { // the post-inference `trait_ref`, as it's more accurate. trait_: Some(trait_ref.clean(cx)), for_: ty.clean(cx), - items, + items: cx.tcx + .associated_items(impl_def_id) + .in_definition_order() + .map(|x| x.clean(cx)) + .collect::<Vec<_>>(), polarity: ty::ImplPolarity::Positive, kind: ImplKind::Blanket(box trait_ref.self_ty().clean(cx)), }), |
