about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2024-02-02 16:09:34 +0100
committerGuillaume Gomez <guillaume.gomez@huawei.com>2024-02-04 23:03:13 +0100
commit0211221e9001314d54ece16e2634d51948f3ecb3 (patch)
tree1fe2d7594f3fdcd5326e6792415144a45144df99
parent4e3eed48926b8b70eee8beb082e37ffa4985c0ed (diff)
downloadrust-0211221e9001314d54ece16e2634d51948f3ecb3.tar.gz
rust-0211221e9001314d54ece16e2634d51948f3ecb3.zip
Prevent running some code if it is already in the map
-rw-r--r--src/librustdoc/clean/inline.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/librustdoc/clean/inline.rs b/src/librustdoc/clean/inline.rs
index aab974ad79e..f65c09bf0e8 100644
--- a/src/librustdoc/clean/inline.rs
+++ b/src/librustdoc/clean/inline.rs
@@ -196,6 +196,14 @@ pub(crate) fn load_attrs<'hir>(cx: &DocContext<'hir>, did: DefId) -> &'hir [ast:
 /// These names are used later on by HTML rendering to generate things like
 /// source links back to the original item.
 pub(crate) fn record_extern_fqn(cx: &mut DocContext<'_>, did: DefId, kind: ItemType) {
+    if did.is_local() {
+        if cx.cache.exact_paths.contains_key(&did) {
+            return;
+        }
+    } else if cx.cache.external_paths.contains_key(&did) {
+        return;
+    }
+
     let crate_name = cx.tcx.crate_name(did.krate);
 
     let relative =