rustdoc: Use impl_id and for_ DefId's for Blanket item id

This commit is contained in:
Justus K 2021-07-03 21:34:17 +02:00
parent 21424d2966
commit a89912c8c3
No known key found for this signature in database
GPG Key ID: 8C62FE98A62FC462
3 changed files with 4 additions and 4 deletions

View File

@ -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,

View File

@ -57,7 +57,7 @@
/// 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),
}

View File

@ -182,8 +182,8 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
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_)))