Skip to content

Commit

Permalink
rustc_metadata: Encode even less doc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
petrochenkov committed Oct 29, 2022
1 parent 33b55ac commit d080532
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions compiler/rustc_metadata/src/rmeta/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit d080532

Please sign in to comment.