Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustdoc: Make some pub items crate-private #93185

Merged
merged 1 commit into from
Jan 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/librustdoc/clean/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ impl Item {

/// Convenience wrapper around [`Self::from_def_id_and_parts`] which converts
/// `hir_id` to a [`DefId`]
pub fn from_hir_id_and_parts(
crate fn from_hir_id_and_parts(
hir_id: hir::HirId,
name: Option<Symbol>,
kind: ItemKind,
Expand All @@ -438,7 +438,7 @@ impl Item {
Item::from_def_id_and_parts(cx.tcx.hir().local_def_id(hir_id).to_def_id(), name, kind, cx)
}

pub fn from_def_id_and_parts(
crate fn from_def_id_and_parts(
def_id: DefId,
name: Option<Symbol>,
kind: ItemKind,
Expand All @@ -456,7 +456,7 @@ impl Item {
)
}

pub fn from_def_id_and_attrs_and_parts(
crate fn from_def_id_and_attrs_and_parts(
def_id: DefId,
name: Option<Symbol>,
kind: ItemKind,
Expand Down Expand Up @@ -984,26 +984,26 @@ crate fn collapse_doc_fragments(doc_strings: &[DocFragment]) -> String {
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
crate struct ItemLink {
/// The original link written in the markdown
pub(crate) link: String,
crate link: String,
/// The link text displayed in the HTML.
///
/// This may not be the same as `link` if there was a disambiguator
/// in an intra-doc link (e.g. \[`fn@f`\])
pub(crate) link_text: String,
pub(crate) did: DefId,
crate link_text: String,
crate did: DefId,
/// The url fragment to append to the link
pub(crate) fragment: Option<UrlFragment>,
crate fragment: Option<UrlFragment>,
}

pub struct RenderedLink {
/// The text the link was original written as.
///
/// This could potentially include disambiguators and backticks.
pub(crate) original_text: String,
crate original_text: String,
/// The text to display in the HTML
pub(crate) new_text: String,
crate new_text: String,
/// The URL to put in the `href`
pub(crate) href: String,
crate href: String,
}

/// The attributes on an [`Item`], including attributes like `#[derive(...)]` and `#[inline]`,
Expand Down
4 changes: 2 additions & 2 deletions src/librustdoc/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ use crate::passes::{self, Condition::*};
crate use rustc_session::config::{DebuggingOptions, Input, Options};

crate struct ResolverCaches {
pub all_traits: Option<Vec<DefId>>,
pub all_trait_impls: Option<Vec<DefId>>,
crate all_traits: Option<Vec<DefId>>,
crate all_trait_impls: Option<Vec<DefId>>,
}

crate struct DocContext<'tcx> {
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/html/render/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ crate struct StylePath {
}

impl StylePath {
pub fn basename(&self) -> Result<String, Error> {
crate fn basename(&self) -> Result<String, Error> {
Ok(try_none!(try_none!(self.path.file_stem(), &self.path).to_str(), &self.path).to_string())
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/passes/collect_intra_doc_links.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ struct DiagnosticInfo<'a> {

#[derive(Clone, Debug, Hash)]
struct CachedLink {
pub res: (Res, Option<UrlFragment>),
res: (Res, Option<UrlFragment>),
}

struct LinkCollector<'a, 'tcx> {
Expand Down