Skip to content

Commit 04db063

Browse files
committed
Don't build the library and standard library before documenting them
Rustdoc doesn't require the build artifacts to generate the docs, and especially in the case of rustc, it greatly increases the time needed to run the build.
1 parent e2750ba commit 04db063

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/bootstrap/doc.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,6 @@ impl Step for Std {
446446
t!(fs::create_dir_all(&out));
447447
let compiler = builder.compiler(stage, builder.config.build);
448448

449-
builder.ensure(compile::Std { compiler, target });
450449
let out_dir = builder.stage_out(compiler, Mode::Std).join(target.triple).join("doc");
451450

452451
t!(fs::copy(builder.src.join("src/doc/rust.css"), out.join("rust.css")));
@@ -564,9 +563,10 @@ impl Step for Rustc {
564563
let out = builder.compiler_doc_out(target);
565564
t!(fs::create_dir_all(&out));
566565

567-
// Build rustc.
566+
// Build the standard library, so that proc-macros can use it.
567+
// (Normally, only the metadata would be necessary, but proc-macros are special since they run at compile-time.)
568568
let compiler = builder.compiler(stage, builder.config.build);
569-
builder.ensure(compile::Rustc { compiler, target });
569+
builder.ensure(compile::Std { compiler, target: builder.config.build });
570570

571571
// This uses a shared directory so that librustdoc documentation gets
572572
// correctly built and merged with the rustc documentation. This is

0 commit comments

Comments
 (0)