Skip to content

Commit 0170ec4

Browse files
committed
rustdoc: Make some attributes methods private.
Followup to https://www.github.com/rust-lang/rust/pull/140863 Only `Item::attributes_and_repr` should be used, the rest are implementation details that can be hidden from the rest of rustdoc.
1 parent 8de4c72 commit 0170ec4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/librustdoc/clean/types.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ impl Item {
764764
Some(tcx.visibility(def_id))
765765
}
766766

767-
pub(crate) fn attributes_without_repr(&self, tcx: TyCtxt<'_>, is_json: bool) -> Vec<String> {
767+
fn attributes_without_repr(&self, tcx: TyCtxt<'_>, is_json: bool) -> Vec<String> {
768768
const ALLOWED_ATTRIBUTES: &[Symbol] =
769769
&[sym::export_name, sym::link_section, sym::no_mangle, sym::non_exhaustive];
770770

@@ -799,6 +799,7 @@ impl Item {
799799
.collect()
800800
}
801801

802+
/// Get a list of attributes to display.
802803
pub(crate) fn attributes_and_repr(
803804
&self,
804805
tcx: TyCtxt<'_>,
@@ -813,8 +814,8 @@ impl Item {
813814
attrs
814815
}
815816

816-
/// Returns a stringified `#[repr(...)]` attribute.
817-
pub(crate) fn repr(&self, tcx: TyCtxt<'_>, cache: &Cache, is_json: bool) -> Option<String> {
817+
/// Returns a stringified `#[repr(...)]` attribute, if present.
818+
fn repr(&self, tcx: TyCtxt<'_>, cache: &Cache, is_json: bool) -> Option<String> {
818819
repr_attributes(tcx, cache, self.def_id()?, self.type_(), is_json)
819820
}
820821

0 commit comments

Comments
 (0)