diff options
author | A. Wilcox <awilcox@wilcox-tech.com> | 2019-09-28 16:46:04 +0000 |
---|---|---|
committer | A. Wilcox <awilcox@wilcox-tech.com> | 2019-09-28 16:46:04 +0000 |
commit | 7f660eb77c44872fe454eaf31b543969630670f3 (patch) | |
tree | c657ba5ee86a0f2021388bd4ff08e3b3a80dae4e /user/rust/0009-compiletest-Match-suffixed-environments.patch | |
parent | d7c07ebaf84058b90112193bf3953289c280a1a6 (diff) | |
parent | bdb273539df454bdd85dcfb37f7c0135d33477f8 (diff) | |
download | packages-7f660eb77c44872fe454eaf31b543969630670f3.tar.gz packages-7f660eb77c44872fe454eaf31b543969630670f3.tar.bz2 packages-7f660eb77c44872fe454eaf31b543969630670f3.tar.xz packages-7f660eb77c44872fe454eaf31b543969630670f3.zip |
Merge branch 'rust' into 'master'
user/rust: Bump to 1.37.0
See merge request adelie/packages!270
Diffstat (limited to 'user/rust/0009-compiletest-Match-suffixed-environments.patch')
-rw-r--r-- | user/rust/0009-compiletest-Match-suffixed-environments.patch | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/user/rust/0009-compiletest-Match-suffixed-environments.patch b/user/rust/0009-compiletest-Match-suffixed-environments.patch new file mode 100644 index 000000000..9ca4d9900 --- /dev/null +++ b/user/rust/0009-compiletest-Match-suffixed-environments.patch @@ -0,0 +1,48 @@ +From 0b28aa018f3f64913101495ce9806d356230856e Mon Sep 17 00:00:00 2001 +From: Samuel Holland <samuel@sholland.org> +Date: Mon, 2 Sep 2019 22:10:10 -0500 +Subject: [PATCH 09/16] compiletest: Match suffixed environments + +--- + src/tools/compiletest/src/header.rs | 2 +- + src/tools/compiletest/src/util.rs | 8 ++++++-- + 2 files changed, 7 insertions(+), 3 deletions(-) + +diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs +index 52f777db2da..4bf3c1a8527 100644 +--- a/src/tools/compiletest/src/header.rs ++++ b/src/tools/compiletest/src/header.rs +@@ -820,10 +820,10 @@ impl Config { + + if name == "test" || + util::matches_os(&self.target, name) || // target ++ util::matches_env(&self.target, name) || // env + name == util::get_arch(&self.target) || // architecture + name == util::get_pointer_width(&self.target) || // pointer width + name == self.stage_id.split('-').next().unwrap() || // stage +- Some(name) == util::get_env(&self.target) || // env + (self.target != self.host && name == "cross-compile") || + match self.compare_mode { + Some(CompareMode::Nll) => name == "compare-mode-nll", +diff --git a/src/tools/compiletest/src/util.rs b/src/tools/compiletest/src/util.rs +index 8caf5ca00f5..d23f4edc55d 100644 +--- a/src/tools/compiletest/src/util.rs ++++ b/src/tools/compiletest/src/util.rs +@@ -101,8 +101,12 @@ pub fn get_arch(triple: &str) -> &'static str { + panic!("Cannot determine Architecture from triple"); + } + +-pub fn get_env(triple: &str) -> Option<&str> { +- triple.split('-').nth(3) ++pub fn matches_env(triple: &str, name: &str) -> bool { ++ if let Some(env) = triple.split('-').nth(3) { ++ env.starts_with(name) ++ } else { ++ false ++ } + } + + pub fn get_pointer_width(triple: &str) -> &'static str { +-- +2.21.0 + |