Skip to content

Commit d080532

Browse files
committed
rustc_metadata: Encode even less doc comments
1 parent 33b55ac commit d080532

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

0 commit comments

Comments
 (0)