From d0805321d5e225d16a036a37ae2060a9f1c45671 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Mon, 24 Oct 2022 21:58:42 +0400 Subject: [PATCH] rustc_metadata: Encode even less doc comments --- compiler/rustc_metadata/src/rmeta/encoder.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compiler/rustc_metadata/src/rmeta/encoder.rs b/compiler/rustc_metadata/src/rmeta/encoder.rs index 4e69b42416f50..e1879744c78fb 100644 --- a/compiler/rustc_metadata/src/rmeta/encoder.rs +++ b/compiler/rustc_metadata/src/rmeta/encoder.rs @@ -787,8 +787,7 @@ fn should_encode_attr( } else if attr.doc_str().is_some() { // We keep all public doc comments because they might be "imported" into downstream crates // if they use `#[doc(inline)]` to copy an item's documentation into their own. - *is_def_id_public - .get_or_insert_with(|| tcx.effective_visibilities(()).effective_vis(def_id).is_some()) + *is_def_id_public.get_or_insert_with(|| tcx.effective_visibilities(()).is_exported(def_id)) } else if attr.has_name(sym::doc) { // If this is a `doc` attribute, and it's marked `inline` (as in `#[doc(inline)]`), we can // remove it. It won't be inlinable in downstream crates.