render the rust version into std/compiler/test docs
This commit is contained in:
@@ -48,6 +48,14 @@ fn main() {
|
|||||||
cmd.arg("-Z").arg("force-unstable-if-unmarked");
|
cmd.arg("-Z").arg("force-unstable-if-unmarked");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Bootstrap's Cargo-command builder sets this variable to the current Rust version; let's pick
|
||||||
|
// 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);
|
||||||
|
}
|
||||||
|
|
||||||
std::process::exit(match cmd.status() {
|
std::process::exit(match cmd.status() {
|
||||||
Ok(s) => s.code().unwrap_or(1),
|
Ok(s) => s.code().unwrap_or(1),
|
||||||
Err(e) => panic!("\n\nfailed to run {:?}: {}\n\n", cmd, e),
|
Err(e) => panic!("\n\nfailed to run {:?}: {}\n\n", cmd, e),
|
||||||
|
|||||||
@@ -418,7 +418,8 @@ impl<'a> Builder<'a> {
|
|||||||
.env("RUSTC_SYSROOT", self.sysroot(compiler))
|
.env("RUSTC_SYSROOT", self.sysroot(compiler))
|
||||||
.env("RUSTC_LIBDIR", self.sysroot_libdir(compiler, self.build.build))
|
.env("RUSTC_LIBDIR", self.sysroot_libdir(compiler, self.build.build))
|
||||||
.env("CFG_RELEASE_CHANNEL", &self.build.config.channel)
|
.env("CFG_RELEASE_CHANNEL", &self.build.config.channel)
|
||||||
.env("RUSTDOC_REAL", self.rustdoc(host));
|
.env("RUSTDOC_REAL", self.rustdoc(host))
|
||||||
|
.env("RUSTDOC_CRATE_VERSION", self.build.rust_version());
|
||||||
cmd
|
cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -574,6 +575,9 @@ impl<'a> Builder<'a> {
|
|||||||
cargo.env("RUSTC_SAVE_ANALYSIS", "api".to_string());
|
cargo.env("RUSTC_SAVE_ANALYSIS", "api".to_string());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// For `cargo doc` invocations, make rustdoc print the Rust version into the docs
|
||||||
|
cargo.env("RUSTDOC_CRATE_VERSION", self.build.rust_version());
|
||||||
|
|
||||||
// Environment variables *required* throughout the build
|
// Environment variables *required* throughout the build
|
||||||
//
|
//
|
||||||
// FIXME: should update code to not require this env var
|
// FIXME: should update code to not require this env var
|
||||||
|
|||||||
Reference in New Issue
Block a user