X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustdoc%2Fhtml%2Frender%2Fmod.rs;h=97ee682c11c4d6a5eb5d6f77a4516a9dcc82313c;hb=acd4dc2d0ca8676fbf105507504e24d44e5dd1f6;hp=0583efa92ffad2646a39581ef3f15b1fab7522fa;hpb=7fb3c29dc63fd0fcbb5c3698a6d0e4951452e671;p=rust.git diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs index 0583efa92ff..97ee682c11c 100644 --- a/src/librustdoc/html/render/mod.rs +++ b/src/librustdoc/html/render/mod.rs @@ -53,7 +53,7 @@ use serde::ser::SerializeSeq; use serde::{Serialize, Serializer}; -use crate::clean::{self, FakeDefId, GetDefId, RenderedLink, SelfTy}; +use crate::clean::{self, GetDefId, ItemId, RenderedLink, SelfTy}; use crate::docfs::PathError; use crate::error::Error; use crate::formats::cache::Cache; @@ -735,7 +735,7 @@ fn naive_assoc_href(it: &clean::Item, link: AssocItemLink<'_>, cx: &Context<'_>) AssocItemLink::Anchor(Some(ref id)) => format!("#{}", id), AssocItemLink::Anchor(None) => anchor, AssocItemLink::GotoSource(did, _) => { - href(did.expect_real(), cx).map(|p| format!("{}{}", p.0, anchor)).unwrap_or(anchor) + href(did.expect_def_id(), cx).map(|p| format!("{}{}", p.0, anchor)).unwrap_or(anchor) } } } @@ -867,7 +867,7 @@ fn method( ItemType::TyMethod }; - href(did.expect_real(), cx) + href(did.expect_def_id(), cx) .map(|p| format!("{}#{}.{}", p.0, ty, name)) .unwrap_or_else(|| format!("#{}.{}", ty, name)) } @@ -987,7 +987,7 @@ fn render_attributes_in_code(w: &mut Buffer, it: &clean::Item) { #[derive(Copy, Clone)] enum AssocItemLink<'a> { Anchor(Option<&'a str>), - GotoSource(FakeDefId, &'a FxHashSet), + GotoSource(ItemId, &'a FxHashSet), } impl<'a> AssocItemLink<'a> { @@ -1819,7 +1819,7 @@ fn small_url_encode(s: String) -> String { } fn sidebar_assoc_items(cx: &Context<'_>, out: &mut Buffer, it: &clean::Item) { - let did = it.def_id.expect_real(); + let did = it.def_id.expect_def_id(); if let Some(v) = cx.cache.impls.get(&did) { let mut used_links = FxHashSet::default(); let cache = cx.cache(); @@ -2109,7 +2109,7 @@ fn print_sidebar_section( "", ); - if let Some(implementors) = cx.cache.implementors.get(&it.def_id.expect_real()) { + if let Some(implementors) = cx.cache.implementors.get(&it.def_id.expect_def_id()) { let cache = cx.cache(); let mut res = implementors .iter()