about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorvarkor <github@varkor.com>2018-03-19 01:36:53 +0000
committervarkor <github@varkor.com>2018-03-20 11:49:30 +0000
commit61e1fbc659103513e68eae29ea830d798e2ec2d5 (patch)
tree51dbe4fa8ed4a3a7bb738e9322ce13e009e6e543 /src
parenteae6d512f0549307947e5fe1b8ee646916b82320 (diff)
downloadrust-61e1fbc659103513e68eae29ea830d798e2ec2d5.tar.gz
rust-61e1fbc659103513e68eae29ea830d798e2ec2d5.zip
Make compiletest do exact matching on triples
This avoids the issues of the previous substring matching, ensuring
`ARCH_TABLE` and `OS_TABLE` will no longer contain redundant entries.
Diffstat (limited to 'src')
-rw-r--r--src/tools/compiletest/src/util.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/tools/compiletest/src/util.rs b/src/tools/compiletest/src/util.rs
index b73f3e2f649..c612f0117aa 100644
--- a/src/tools/compiletest/src/util.rs
+++ b/src/tools/compiletest/src/util.rs
@@ -75,16 +75,18 @@ pub fn matches_os(triple: &str, name: &str) -> bool {
     if triple == "wasm32-unknown-unknown" {
         return name == "emscripten" || name == "wasm32-bare"
     }
+    let triple: Vec<_> = triple.split('-').collect();
     for &(triple_os, os) in OS_TABLE {
-        if triple.contains(triple_os) {
+        if triple.contains(&triple_os) {
             return os == name;
         }
     }
     panic!("Cannot determine OS from triple");
 }
 pub fn get_arch(triple: &str) -> &'static str {
+    let triple: Vec<_> = triple.split('-').collect();
     for &(triple_arch, arch) in ARCH_TABLE {
-        if triple.contains(triple_arch) {
+        if triple.contains(&triple_arch) {
             return arch;
         }
     }