render the rust version into std/compiler/test docs

This commit is contained in:
QuietMisdreavus
2017-10-09 15:21:11 -05:00
parent fcee950660
commit 7ea286e854
2 changed files with 13 additions and 1 deletions

View File

@@ -48,6 +48,14 @@ fn main() {
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() {
Ok(s) => s.code().unwrap_or(1),
Err(e) => panic!("\n\nfailed to run {:?}: {}\n\n", cmd, e),