From 419a4e5d3cd50cec8563c181907aea0086e1ca97 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 10 Dec 2018 13:14:46 +0100 Subject: [PATCH] use rustc_version also to parse host in compiletest --- tests/compiletest.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/compiletest.rs b/tests/compiletest.rs index f0ebbf6b07..c3f2805575 100644 --- a/tests/compiletest.rs +++ b/tests/compiletest.rs @@ -147,12 +147,9 @@ fn get_host() -> String { .output() .expect("rustc not found for -vV") .stdout; - let host = std::str::from_utf8(&host).expect("sysroot is not utf8"); - let host = host.split("\nhost: ").nth(1).expect( - "no host: part in rustc -vV", - ); - let host = host.split('\n').next().expect("no \n after host"); - String::from(host) + let host = std::str::from_utf8(&host).expect("host is not utf8"); + let version_meta = rustc_version::version_meta_for(&host).expect("failed to parse rustc version info"); + version_meta.host } fn run_pass_miri(opt: bool) {