Skip to content

Commit d8c04b1

Browse files
authored
Rollup merge of #83885 - jyn514:private-links, r=Mark-Simulacrum
Document compiler/ with -Aprivate-intra-doc-links Since compiler/ always passes --document-private-items, it's ok to link to items that are private.
2 parents fb6eb4a + 0a351ab commit d8c04b1

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

compiler/rustc_errors/src/diagnostic_builder.rs

-9
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ macro_rules! forward {
4545
pub fn $n:ident(&self, $($name:ident: $ty:ty),* $(,)?) -> &Self
4646
) => {
4747
$(#[$attrs])*
48-
// we always document with --document-private-items
49-
#[cfg_attr(not(bootstrap), allow(rustdoc::private_intra_doc_links))]
50-
#[cfg_attr(bootstrap, allow(private_intra_doc_links))]
5148
#[doc = concat!("See [`Diagnostic::", stringify!($n), "()`].")]
5249
pub fn $n(&self, $($name: $ty),*) -> &Self {
5350
self.diagnostic.$n($($name),*);
@@ -62,9 +59,6 @@ macro_rules! forward {
6259
) => {
6360
$(#[$attrs])*
6461
#[doc = concat!("See [`Diagnostic::", stringify!($n), "()`].")]
65-
// we always document with --document-private-items
66-
#[cfg_attr(not(bootstrap), allow(rustdoc::private_intra_doc_links))]
67-
#[cfg_attr(bootstrap, allow(private_intra_doc_links))]
6862
pub fn $n(&mut self, $($name: $ty),*) -> &mut Self {
6963
self.0.diagnostic.$n($($name),*);
7064
self
@@ -82,9 +76,6 @@ macro_rules! forward {
8276
) => {
8377
$(#[$attrs])*
8478
#[doc = concat!("See [`Diagnostic::", stringify!($n), "()`].")]
85-
// we always document with --document-private-items
86-
#[cfg_attr(not(bootstrap), allow(rustdoc::private_intra_doc_links))]
87-
#[cfg_attr(bootstrap, allow(private_intra_doc_links))]
8879
pub fn $n<$($generic: $bound),*>(&mut self, $($name: $ty),*) -> &mut Self {
8980
self.0.diagnostic.$n($($name),*);
9081
self

src/bootstrap/doc.rs

+2
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,8 @@ impl Step for Rustc {
549549
// Build cargo command.
550550
let mut cargo = builder.cargo(compiler, Mode::Rustc, SourceType::InTree, target, "doc");
551551
cargo.rustdocflag("--document-private-items");
552+
// Since we always pass --document-private-items, there's no need to warn about linking to private items.
553+
cargo.rustdocflag("-Arustdoc::private-intra-doc-links");
552554
cargo.rustdocflag("--enable-index-page");
553555
cargo.rustdocflag("-Zunstable-options");
554556
cargo.rustdocflag("-Znormalize-docs");

0 commit comments

Comments
 (0)