From 270151bffb0be259ff20feee3801bb124c2c39ec Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 12 Dec 2018 00:33:00 +0100 Subject: Add generate-old-style-files option to rustdoc --- src/bootstrap/doc.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/bootstrap') diff --git a/src/bootstrap/doc.rs b/src/bootstrap/doc.rs index eec193c21f5..0028997a7df 100644 --- a/src/bootstrap/doc.rs +++ b/src/bootstrap/doc.rs @@ -317,7 +317,8 @@ fn invoke_rustdoc(builder: &Builder, compiler: Compiler, target: Interned Date: Wed, 30 Jan 2019 11:39:19 +0100 Subject: 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(-) (limited to 'src/bootstrap') diff --git a/src/bootstrap/bin/rustdoc.rs b/src/bootstrap/bin/rustdoc.rs index dec74e60c71..aeb15821b0b 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 0028997a7df..af95b622e23 100644 --- a/src/bootstrap/doc.rs +++ b/src/bootstrap/doc.rs @@ -317,8 +317,7 @@ fn invoke_rustdoc(builder: &Builder, compiler: Compiler, target: Interned