Skip to content

Commit 7ef1a69

Browse files
committed
Auto merge of #38929 - Manishearth:compiler-docs, r=alexcrichton
Don't restrict docs in compiler-docs mode Search is broken without this. We want all crates to be included in compiler-docs mode. This was changed in #38858, this PR brings that functionality back in compiler-docs mode.
2 parents 6e18e62 + af00927 commit 7ef1a69

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

src/bootstrap/doc.rs

+17-9
Original file line numberDiff line numberDiff line change
@@ -151,17 +151,25 @@ pub fn std(build: &Build, stage: u32, target: &str) {
151151
let mut cargo = build.cargo(&compiler, Mode::Libstd, target, "doc");
152152
cargo.arg("--manifest-path")
153153
.arg(build.src.join("src/rustc/std_shim/Cargo.toml"))
154-
.arg("--features").arg(build.std_features())
155-
.arg("--no-deps");
156-
157-
for krate in &["alloc", "collections", "core", "std", "std_unicode"] {
158-
cargo.arg("-p").arg(krate);
159-
// Create all crate output directories first to make sure rustdoc uses
160-
// relative links.
161-
// FIXME: Cargo should probably do this itself.
162-
t!(fs::create_dir_all(out_dir.join(krate)));
154+
.arg("--features").arg(build.std_features());
155+
156+
// We don't want to build docs for internal std dependencies unless
157+
// in compiler-docs mode. When not in that mode, we whitelist the crates
158+
// for which docs must be built.
159+
if build.config.compiler_docs {
160+
cargo.arg("-p").arg("std");
161+
} else {
162+
cargo.arg("--no-deps");
163+
for krate in &["alloc", "collections", "core", "std", "std_unicode"] {
164+
cargo.arg("-p").arg(krate);
165+
// Create all crate output directories first to make sure rustdoc uses
166+
// relative links.
167+
// FIXME: Cargo should probably do this itself.
168+
t!(fs::create_dir_all(out_dir.join(krate)));
169+
}
163170
}
164171

172+
165173
build.run(&mut cargo);
166174
cp_r(&out_dir, &out)
167175
}

0 commit comments

Comments
 (0)