From a89912c8c3a97e5d3b50833984d8dbe23a2fdf52 Mon Sep 17 00:00:00 2001 From: Justus K Date: Sat, 3 Jul 2021 21:34:17 +0200 Subject: [PATCH] rustdoc: Use `impl_id` and `for_` DefId's for Blanket item id --- src/librustdoc/clean/blanket_impl.rs | 2 +- src/librustdoc/clean/types.rs | 2 +- src/librustdoc/json/conversions.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/librustdoc/clean/blanket_impl.rs b/src/librustdoc/clean/blanket_impl.rs index 59fefee5ee4ed..c257d362694fe 100644 --- a/src/librustdoc/clean/blanket_impl.rs +++ b/src/librustdoc/clean/blanket_impl.rs @@ -96,7 +96,7 @@ impl<'a, 'tcx> BlanketImplFinder<'a, 'tcx> { name: None, attrs: Default::default(), visibility: Inherited, - def_id: ItemId::Blanket { trait_: trait_def_id, for_: item_def_id }, + def_id: ItemId::Blanket { impl_id: impl_def_id, for_: item_def_id }, kind: box ImplItem(Impl { span: self.cx.tcx.def_span(impl_def_id).clean(self.cx), unsafety: hir::Unsafety::Normal, diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs index 4ffce6c7656f0..e716e09b8b3f0 100644 --- a/src/librustdoc/clean/types.rs +++ b/src/librustdoc/clean/types.rs @@ -57,7 +57,7 @@ crate enum ItemId { /// Identifier that is used for auto traits. Auto { trait_: DefId, for_: DefId }, /// Identifier that is used for blanket implementations. - Blanket { trait_: DefId, for_: DefId }, + Blanket { impl_id: DefId, for_: DefId }, /// Identifier for primitive types. Primitive(PrimitiveType, CrateNum), } diff --git a/src/librustdoc/json/conversions.rs b/src/librustdoc/json/conversions.rs index bd9f54d2e80d7..bf8db79416b34 100644 --- a/src/librustdoc/json/conversions.rs +++ b/src/librustdoc/json/conversions.rs @@ -182,8 +182,8 @@ crate fn from_item_id(did: ItemId) -> Id { match did { ItemId::DefId(did) => Id(format!("{}", DisplayDefId(did))), - ItemId::Blanket { for_, trait_ } => { - Id(format!("b:{}-{}", DisplayDefId(trait_), DisplayDefId(for_))) + ItemId::Blanket { for_, impl_id } => { + Id(format!("b:{}-{}", DisplayDefId(impl_id), DisplayDefId(for_))) } ItemId::Auto { for_, trait_ } => { Id(format!("a:{}-{}", DisplayDefId(trait_), DisplayDefId(for_)))