X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fbootstrap%2Fbuilder.rs;h=709b202052e577dcc6376539d2ede9cc2f42bc47;hb=85a9cfaa3110f204242df8536636b73318ced145;hp=4b0905bd6c16c8d14eee46a0c5e45b201b3a89c3;hpb=84f7991bf4152f4f17f5a5f30405220bf9513a4b;p=rust.git diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index 4b0905bd6c1..709b202052e 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -745,7 +745,6 @@ pub fn rustdoc_cmd(&self, compiler: Compiler) -> Command { .env("RUSTDOC_LIBDIR", self.rustc_libdir(compiler)) .env("CFG_RELEASE_CHANNEL", &self.config.channel) .env("RUSTDOC_REAL", self.rustdoc(compiler)) - .env("RUSTDOC_CRATE_VERSION", self.rust_version()) .env("RUSTC_BOOTSTRAP", "1") .arg("-Winvalid_codeblock_attributes"); if self.config.deny_warnings { @@ -1271,7 +1270,11 @@ pub fn cargo( } // For `cargo doc` invocations, make rustdoc print the Rust version into the docs - cargo.env("RUSTDOC_CRATE_VERSION", self.rust_version()); + // This replaces spaces with newlines because RUSTDOCFLAGS does not + // support arguments with regular spaces. Hopefully someday Cargo will + // have space support. + let rust_version = self.rust_version().replace(' ', "\n"); + rustdocflags.arg("--crate-version").arg(&rust_version); // Environment variables *required* throughout the build // @@ -1448,14 +1451,14 @@ fn new(target: TargetSelection) -> Rustflags { fn env(&mut self, env: &str) { if let Ok(s) = env::var(env) { - for part in s.split_whitespace() { + for part in s.split(' ') { self.arg(part); } } } fn arg(&mut self, arg: &str) -> &mut Self { - assert_eq!(arg.split_whitespace().count(), 1); + assert_eq!(arg.split(' ').count(), 1); if !self.0.is_empty() { self.0.push_str(" "); }