Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit aa06a90

Browse files
committed
Auto merge of rust-lang#116579 - GuillaumeGomez:rm-local-from-extern-list, r=<try>
Only add non local items to `RustdocEffectiveVisibilities::extern_public` While working on rust-lang#115480, I was finally able to track down the origin of the bug, still working on the fix (how to determine if a foreign trait is publically exported from the current crate in short), which led me to this small PR. It should only list foreign items and yet we don't check if they're locals before adding them to the map. I expect a very minimal perf improvement. r? `@notriddle`
2 parents cdddcd3 + 9d214fc commit aa06a90

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/librustdoc/visit_lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ impl LibEmbargoVisitor<'_, '_> {
6666

6767
fn visit_item(&mut self, def_id: DefId) {
6868
if self.document_hidden || !self.tcx.is_doc_hidden(def_id) {
69-
self.extern_public.insert(def_id);
69+
if !def_id.is_local() {
70+
self.extern_public.insert(def_id);
71+
}
7072
if self.tcx.def_kind(def_id) == DefKind::Mod {
7173
self.visit_mod(def_id);
7274
}

0 commit comments

Comments
 (0)