about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-07-15 20:31:40 +0000
committerbors <bors@rust-lang.org>2023-07-15 20:31:40 +0000
commit4c8bb79d9f565115637cc6da739f8389e79f3a29 (patch)
tree6871b050ff6f9728715135b639dcd70f7ada4443
parent425726d46b637f94995ca1c95f4f16cdb903d30e (diff)
parent1fa8b9aa567a0311b02caadffebb8a8dbffc90e2 (diff)
downloadrust-4c8bb79d9f565115637cc6da739f8389e79f3a29.tar.gz
rust-4c8bb79d9f565115637cc6da739f8389e79f3a29.zip
Auto merge of #113697 - GuillaumeGomez:rm-unneeded-externallocation-handling, r=lqd
Remove unneeded handling for `ExternalLocation::Unknown` in rustdoc render context

Should fix perf regression introduced in https://github.com/rust-lang/rust/pull/113623.

r? `@lqd`
-rw-r--r--src/librustdoc/html/render/context.rs7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/librustdoc/html/render/context.rs b/src/librustdoc/html/render/context.rs
index d0a1e223eb8..aa72af001df 100644
--- a/src/librustdoc/html/render/context.rs
+++ b/src/librustdoc/html/render/context.rs
@@ -349,12 +349,7 @@ impl<'tcx> Context<'tcx> {
                     let e = ExternalCrate { crate_num: cnum };
                     (e.name(self.tcx()), e.src_root(self.tcx()))
                 }
-                ExternalLocation::Unknown => {
-                    let e = ExternalCrate { crate_num: cnum };
-                    let name = e.name(self.tcx());
-                    root = name.to_string();
-                    (name, e.src_root(self.tcx()))
-                }
+                ExternalLocation::Unknown => return None,
             };
 
             let href = RefCell::new(PathBuf::new());