Skip to content

Commit d6c5c52

Browse files
authored
Rollup merge of #79107 - pietroalbini:build-manifest-newline, r=Mark-Simulacrum
build-manifest: strip newline from rustc version Backport of #79096 on the master branch. This will also need to be included in the beta bump tomorrow. r? `@Mark-Simulacrum` `@rustbot` modify labels: beta-nominated beta-accepted T-infra
2 parents a207801 + 32d3146 commit d6c5c52

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/tools/build-manifest/src/versions.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use std::path::{Path, PathBuf};
77
use tar::Archive;
88

99
const DEFAULT_TARGET: &str = "x86_64-unknown-linux-gnu";
10-
const RUSTC_VERSION: &str = include_str!("../../../version");
1110

1211
#[derive(Debug, Hash, Eq, PartialEq, Clone)]
1312
pub(crate) enum PkgType {
@@ -177,10 +176,10 @@ impl Versions {
177176
) -> Result<String, Error> {
178177
let component_name = package.tarball_component_name();
179178
let version = match self.channel.as_str() {
180-
"stable" => RUSTC_VERSION.into(),
179+
"stable" => self.rustc_version().into(),
181180
"beta" => "beta".into(),
182181
"nightly" => "nightly".into(),
183-
_ => format!("{}-dev", RUSTC_VERSION),
182+
_ => format!("{}-dev", self.rustc_version()),
184183
};
185184

186185
if package.target_independent() {
@@ -199,6 +198,7 @@ impl Versions {
199198
}
200199

201200
pub(crate) fn rustc_version(&self) -> &str {
202-
RUSTC_VERSION
201+
const RUSTC_VERSION: &str = include_str!("../../../version");
202+
RUSTC_VERSION.trim()
203203
}
204204
}

0 commit comments

Comments
 (0)