Skip to content

Commit 419a4e5

Browse files
committed
use rustc_version also to parse host in compiletest
1 parent 05f2b2e commit 419a4e5

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

tests/compiletest.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,9 @@ fn get_host() -> String {
147147
.output()
148148
.expect("rustc not found for -vV")
149149
.stdout;
150-
let host = std::str::from_utf8(&host).expect("sysroot is not utf8");
151-
let host = host.split("\nhost: ").nth(1).expect(
152-
"no host: part in rustc -vV",
153-
);
154-
let host = host.split('\n').next().expect("no \n after host");
155-
String::from(host)
150+
let host = std::str::from_utf8(&host).expect("host is not utf8");
151+
let version_meta = rustc_version::version_meta_for(&host).expect("failed to parse rustc version info");
152+
version_meta.host
156153
}
157154

158155
fn run_pass_miri(opt: bool) {

0 commit comments

Comments
 (0)