Skip to content

Commit

Permalink
rustdoc: Use impl_id and for_ DefId's for Blanket item id
Browse files Browse the repository at this point in the history
  • Loading branch information
Stupremee committed Jul 5, 2021
1 parent 21424d2 commit a89912c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/librustdoc/clean/blanket_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/clean/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
Expand Down
4 changes: 2 additions & 2 deletions src/librustdoc/json/conversions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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_)))
Expand Down

0 comments on commit a89912c

Please sign in to comment.