Skip to content

Commit 4c736a2

Browse files
committed
Auto merge of rust-lang#103496 - petrochenkov:effvisdoc2, r=lqd
rustc_metadata: Encode even less doc comments The fact that `def_id` is in the `tcx.privacy_access_levels(())` table is not very meaningful, especially after rust-lang#102026, `is_exported` (or `is_reachable` in the worst case) is what you need. Follow up to rust-lang#98450. r? `@GuillaumeGomez` `@lqd`
2 parents e70cbef + d080532 commit 4c736a2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Diff for: compiler/rustc_metadata/src/rmeta/encoder.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -788,8 +788,7 @@ fn should_encode_attr(
788788
} else if attr.doc_str().is_some() {
789789
// We keep all public doc comments because they might be "imported" into downstream crates
790790
// if they use `#[doc(inline)]` to copy an item's documentation into their own.
791-
*is_def_id_public
792-
.get_or_insert_with(|| tcx.effective_visibilities(()).effective_vis(def_id).is_some())
791+
*is_def_id_public.get_or_insert_with(|| tcx.effective_visibilities(()).is_exported(def_id))
793792
} else if attr.has_name(sym::doc) {
794793
// If this is a `doc` attribute, and it's marked `inline` (as in `#[doc(inline)]`), we can
795794
// remove it. It won't be inlinable in downstream crates.

0 commit comments

Comments
 (0)