Skip to content

Commit 61e1fbc

Browse files
committed
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.
1 parent eae6d51 commit 61e1fbc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/tools/compiletest/src/util.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,18 @@ pub fn matches_os(triple: &str, name: &str) -> bool {
7575
if triple == "wasm32-unknown-unknown" {
7676
return name == "emscripten" || name == "wasm32-bare"
7777
}
78+
let triple: Vec<_> = triple.split('-').collect();
7879
for &(triple_os, os) in OS_TABLE {
79-
if triple.contains(triple_os) {
80+
if triple.contains(&triple_os) {
8081
return os == name;
8182
}
8283
}
8384
panic!("Cannot determine OS from triple");
8485
}
8586
pub fn get_arch(triple: &str) -> &'static str {
87+
let triple: Vec<_> = triple.split('-').collect();
8688
for &(triple_arch, arch) in ARCH_TABLE {
87-
if triple.contains(triple_arch) {
89+
if triple.contains(&triple_arch) {
8890
return arch;
8991
}
9092
}

0 commit comments

Comments
 (0)