Skip to content

Commit b084c52

Browse files
committed
Generate docs for bootstrap itself
This verifies the intra-doc links are correct, and hopefully makes things easier for new contributors.
1 parent eb9da7b commit b084c52

File tree

5 files changed

+12
-4
lines changed

5 files changed

+12
-4
lines changed

src/bootstrap/builder.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ impl PathSet {
264264

265265
/// A convenience wrapper for Steps which know they have no aliases and all their sets contain only a single path.
266266
///
267-
/// This can be used with [`ShouldRun::krate`], [`ShouldRun::path`], or [`ShouldRun::alias`].
267+
/// This can be used with [`ShouldRun::crate_or_deps`], [`ShouldRun::path`], or [`ShouldRun::alias`].
268268
#[track_caller]
269269
pub fn assert_single_path(&self) -> &TaskPath {
270270
match self {
@@ -787,6 +787,7 @@ impl<'a> Builder<'a> {
787787
doc::EditionGuide,
788788
doc::StyleGuide,
789789
doc::Tidy,
790+
doc::Bootstrap,
790791
),
791792
Kind::Dist => describe!(
792793
dist::Docs,

src/bootstrap/doc.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,8 @@ macro_rules! tool_doc {
839839
)+
840840

841841
cargo.rustdocflag("--document-private-items");
842+
// Since we always pass --document-private-items, there's no need to warn about linking to private items.
843+
cargo.rustdocflag("-Arustdoc::private-intra-doc-links");
842844
cargo.rustdocflag("--enable-index-page");
843845
cargo.rustdocflag("--show-type-layout");
844846
cargo.rustdocflag("--generate-link-to-definition");
@@ -882,7 +884,8 @@ tool_doc!(
882884
// "cargo-credential-wincred",
883885
]
884886
);
885-
tool_doc!(Tidy, "tidy", "src/tools/tidy", ["tidy"]);
887+
tool_doc!(Tidy, "tidy", "src/tools/tidy", rustc_tool = false, ["tidy"]);
888+
tool_doc!(Bootstrap, "bootstrap", "src/bootstrap", rustc_tool = false, ["bootstrap"]);
886889

887890
#[derive(Ord, PartialOrd, Debug, Copy, Clone, Hash, PartialEq, Eq)]
888891
pub struct ErrorIndex {

src/bootstrap/download.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ impl Config {
123123
/// This is only required on NixOS and uses the PatchELF utility to
124124
/// change the interpreter/RPATH of ELF executables.
125125
///
126-
/// Please see https://nixos.org/patchelf.html for more information
126+
/// Please see <https://nixos.org/patchelf.html> for more information
127127
fn fix_bin_or_dylib(&self, fname: &Path) {
128128
assert_eq!(SHOULD_FIX_BINS_AND_DYLIBS.get(), Some(&true));
129129
println!("attempting to patch {}", fname.display());

src/bootstrap/lib.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1011,6 +1011,8 @@ impl Build {
10111011
}
10121012

10131013
/// Return a `Group` guard for a [`Step`] that is built for each `--stage`.
1014+
///
1015+
/// [`Step`]: crate::builder::Step
10141016
fn msg(
10151017
&self,
10161018
action: impl Into<Kind>,
@@ -1035,6 +1037,8 @@ impl Build {
10351037
}
10361038

10371039
/// Return a `Group` guard for a [`Step`] that is only built once and isn't affected by `--stage`.
1040+
///
1041+
/// [`Step`]: crate::builder::Step
10381042
fn msg_unstaged(
10391043
&self,
10401044
action: impl Into<Kind>,

src/bootstrap/util.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ fn absolute_windows(path: &std::path::Path) -> std::io::Result<std::path::PathBu
488488
}
489489
}
490490

491-
/// Adapted from https://github.com/llvm/llvm-project/blob/782e91224601e461c019e0a4573bbccc6094fbcd/llvm/cmake/modules/HandleLLVMOptions.cmake#L1058-L1079
491+
/// Adapted from <https://github.com/llvm/llvm-project/blob/782e91224601e461c019e0a4573bbccc6094fbcd/llvm/cmake/modules/HandleLLVMOptions.cmake#L1058-L1079>
492492
///
493493
/// When `clang-cl` is used with instrumentation, we need to add clang's runtime library resource
494494
/// directory to the linker flags, otherwise there will be linker errors about the profiler runtime

0 commit comments

Comments
 (0)