about summary refs log tree commit diff
path: root/src/librustdoc/passes
diff options
context:
space:
mode:
authorNoah Lev <camelidcamel@gmail.com>2022-01-05 18:12:26 -0800
committerNoah Lev <camelidcamel@gmail.com>2022-01-06 11:48:47 -0800
commit1064003f8c39e138c3fefa9104fd74ffe81df3e8 (patch)
treed598dc355eff418b1de4ef2bb93145e4caef23c9 /src/librustdoc/passes
parent7e3132adb375480aebff297217e3125165cc56b2 (diff)
downloadrust-1064003f8c39e138c3fefa9104fd74ffe81df3e8.tar.gz
rust-1064003f8c39e138c3fefa9104fd74ffe81df3e8.zip
Use fragment instead of side channel for prim. assoc. items
I had the epiphany that now that fragments are "semantic" -- rather than
just strings -- they fill the role that used to be handled by the side
channel. I think I may be able to get rid of the other uses of the side
channel using this technique too.
Diffstat (limited to 'src/librustdoc/passes')
-rw-r--r--src/librustdoc/passes/collect_intra_doc_links.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/librustdoc/passes/collect_intra_doc_links.rs b/src/librustdoc/passes/collect_intra_doc_links.rs
index ddb9f53c695..fe390f6354c 100644
--- a/src/librustdoc/passes/collect_intra_doc_links.rs
+++ b/src/librustdoc/passes/collect_intra_doc_links.rs
@@ -1353,7 +1353,9 @@ impl LinkCollector<'_, '_> {
 
         match res {
             Res::Primitive(prim) => {
-                if let Some((kind, id)) = self.kind_side_channel.take() {
+                if let Some(UrlFragment::Def(_, id)) = fragment {
+                    let kind = self.cx.tcx.def_kind(id);
+
                     // We're actually resolving an associated item of a primitive, so we need to
                     // verify the disambiguator (if any) matches the type of the associated item.
                     // This case should really follow the same flow as the `Res::Def` branch below,