about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPietro Albini <pietro@pietroalbini.org>2020-11-16 14:36:49 +0100
committerPietro Albini <pietro@pietroalbini.org>2020-11-16 19:26:03 +0100
commit32d3146ea6507e181f1738bda513d6ece63f071d (patch)
tree5b5eeabb9f0ae3170742f658f355677f3ce14e51
parentf5230fbf76bafd86ee4376a0e26e551df8d17fec (diff)
downloadrust-32d3146ea6507e181f1738bda513d6ece63f071d.tar.gz
rust-32d3146ea6507e181f1738bda513d6ece63f071d.zip
build-manifest: strip newline from rustc version
-rw-r--r--src/tools/build-manifest/src/versions.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/tools/build-manifest/src/versions.rs b/src/tools/build-manifest/src/versions.rs
index f1a42e7145f..11575139adc 100644
--- a/src/tools/build-manifest/src/versions.rs
+++ b/src/tools/build-manifest/src/versions.rs
@@ -7,7 +7,6 @@ use std::path::{Path, PathBuf};
 use tar::Archive;
 
 const DEFAULT_TARGET: &str = "x86_64-unknown-linux-gnu";
-const RUSTC_VERSION: &str = include_str!("../../../version");
 
 #[derive(Debug, Hash, Eq, PartialEq, Clone)]
 pub(crate) enum PkgType {
@@ -177,10 +176,10 @@ impl Versions {
     ) -> Result<String, Error> {
         let component_name = package.tarball_component_name();
         let version = match self.channel.as_str() {
-            "stable" => RUSTC_VERSION.into(),
+            "stable" => self.rustc_version().into(),
             "beta" => "beta".into(),
             "nightly" => "nightly".into(),
-            _ => format!("{}-dev", RUSTC_VERSION),
+            _ => format!("{}-dev", self.rustc_version()),
         };
 
         if package.target_independent() {
@@ -199,6 +198,7 @@ impl Versions {
     }
 
     pub(crate) fn rustc_version(&self) -> &str {
-        RUSTC_VERSION
+        const RUSTC_VERSION: &str = include_str!("../../../version");
+        RUSTC_VERSION.trim()
     }
 }