From 397eb4f237b92f77eadf12c0bea7cfea5a31a92a Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 30 Jan 2019 11:39:19 +0100 Subject: [PATCH] Add missing generation for test and proc_macro, remove old macro redirection --- src/bootstrap/bin/rustdoc.rs | 20 +++++++++++++++++--- src/bootstrap/doc.rs | 11 ++++++----- src/librustdoc/html/render.rs | 9 --------- 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/src/bootstrap/bin/rustdoc.rs b/src/bootstrap/bin/rustdoc.rs index dec74e60c71f3..aeb15821b0bb7 100644 --- a/src/bootstrap/bin/rustdoc.rs +++ b/src/bootstrap/bin/rustdoc.rs @@ -16,6 +16,7 @@ fn main() { let libdir = env::var_os("RUSTDOC_LIBDIR").expect("RUSTDOC_LIBDIR was not set"); let stage = env::var("RUSTC_STAGE").expect("RUSTC_STAGE was not set"); let sysroot = env::var_os("RUSTC_SYSROOT").expect("RUSTC_SYSROOT was not set"); + let mut has_unstable = false; use std::str::FromStr; @@ -54,9 +55,22 @@ fn main() { // it up so we can make rustdoc print this into the docs if let Some(version) = env::var_os("RUSTDOC_CRATE_VERSION") { // This "unstable-options" can be removed when `--crate-version` is stabilized - cmd.arg("-Z") - .arg("unstable-options") - .arg("--crate-version").arg(version); + if !has_unstable { + cmd.arg("-Z") + .arg("unstable-options"); + } + cmd.arg("--crate-version").arg(version); + has_unstable = true; + } + + // Needed to be able to run all rustdoc tests. + if let Some(_) = env::var_os("RUSTDOC_GENERATE_REDIRECT_PAGES") { + // This "unstable-options" can be removed when `--generate-redirect-pages` is stabilized + if !has_unstable { + cmd.arg("-Z") + .arg("unstable-options"); + } + cmd.arg("--generate-redirect-pages"); } if verbose > 1 { diff --git a/src/bootstrap/doc.rs b/src/bootstrap/doc.rs index 0028997a7df09..af95b622e23f3 100644 --- a/src/bootstrap/doc.rs +++ b/src/bootstrap/doc.rs @@ -317,8 +317,7 @@ fn invoke_rustdoc(builder: &Builder, compiler: Compiler, target: Interned