diff options
| author | Eric Huss <eric@huss.org> | 2020-08-14 17:52:09 -0700 |
|---|---|---|
| committer | Eric Huss <eric@huss.org> | 2020-08-14 20:15:58 -0700 |
| commit | 85a9cfaa3110f204242df8536636b73318ced145 (patch) | |
| tree | 178834246db05e93aec047221742b3055d3e45a9 /src/bootstrap | |
| parent | 73b7a0403235732daa0664bfd1bd3279b7ab5cb6 (diff) | |
Deal with spaces in the rust version.
Diffstat (limited to 'src/bootstrap')
| -rw-r--r-- | src/bootstrap/builder.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index 8536569919b..709b202052e 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -1270,7 +1270,11 @@ impl<'a> Builder<'a> { } // For `cargo doc` invocations, make rustdoc print the Rust version into the docs - rustdocflags.arg("--crate-version").arg(&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 // @@ -1447,14 +1451,14 @@ impl 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(" "); } |
