Skip to content

Commit

Permalink
Rollup merge of rust-lang#90683 - jyn514:compiler-docs, r=Mark-Simula…
Browse files Browse the repository at this point in the history
…crum

Make `compiler-docs` only control the default instead of being a hard off-switch

This also fixes `x doc src/tools/clippy` when compiler-docs is disabled.

See rust-lang#90354 (comment).

r? `@Mark-Simulacrum`
  • Loading branch information
matthiaskrgr authored Nov 9, 2021
2 parents 4fbc640 + 5bf3a5d commit 58a1e9e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
6 changes: 2 additions & 4 deletions src/bootstrap/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ impl Step for RustcDocs {
const DEFAULT: bool = true;

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
run.path("src/librustc")
let builder = run.builder;
run.path("rustc-docs").default_condition(builder.config.compiler_docs)
}

fn make_run(run: RunConfig<'_>) {
Expand All @@ -106,9 +107,6 @@ impl Step for RustcDocs {
/// Builds the `rustc-docs` installer component.
fn run(self, builder: &Builder<'_>) -> Option<GeneratedTarball> {
let host = self.host;
if !builder.config.compiler_docs {
return None;
}
builder.default_doc(&[]);

let mut tarball = Tarball::new(builder, "rustc-docs", &host.triple);
Expand Down
15 changes: 3 additions & 12 deletions src/bootstrap/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ impl Step for Rustc {

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
let builder = run.builder;
run.krate("rustc-main").path("compiler").default_condition(builder.config.docs)
run.krate("rustc-main").path("compiler").default_condition(builder.config.compiler_docs)
}

fn make_run(run: RunConfig<'_>) {
Expand Down Expand Up @@ -560,11 +560,6 @@ impl Step for Rustc {
})
.collect::<Vec<_>>();

if !builder.config.compiler_docs && !builder.was_invoked_explicitly::<Self>() {
builder.info("\tskipping - compiler/librustdoc docs disabled");
return;
}

// This is the intended out directory for compiler documentation.
let out = builder.compiler_doc_out(target);
t!(fs::create_dir_all(&out));
Expand Down Expand Up @@ -674,7 +669,8 @@ macro_rules! tool_doc {
const ONLY_HOSTS: bool = true;

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
run.krate($should_run)
let builder = run.builder;
run.krate($should_run).default_condition(builder.config.compiler_docs)
}

fn make_run(run: RunConfig<'_>) {
Expand Down Expand Up @@ -705,11 +701,6 @@ macro_rules! tool_doc {

let compiler = builder.compiler(stage, builder.config.build);

if !builder.config.compiler_docs && !builder.was_invoked_explicitly::<Self>() {
builder.info("\tskipping - compiler/tool docs disabled");
return;
}

// Build rustc docs so that we generate relative links.
builder.ensure(Rustc { stage, target });

Expand Down

0 comments on commit 58a1e9e

Please sign in to comment.