Skip to content

Commit 654ebbc

Browse files
committed
compiletest: use std::path::absolute instead of hand-rolling
1 parent 7c5de64 commit 654ebbc

File tree

1 file changed

+2
-6
lines changed
  • src/tools/compiletest/src

1 file changed

+2
-6
lines changed

Diff for: src/tools/compiletest/src/lib.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -237,10 +237,6 @@ pub fn parse_config(args: Vec<String>) -> Config {
237237
}
238238
}
239239

240-
fn make_absolute(path: PathBuf) -> PathBuf {
241-
if path.is_relative() { env::current_dir().unwrap().join(path) } else { path }
242-
}
243-
244240
let target = opt_str2(matches.opt_str("target"));
245241
let android_cross_path = opt_path(matches, "android-cross-path");
246242
let (cdb, cdb_version) = debuggers::analyze_cdb(matches.opt_str("cdb"), &target);
@@ -329,8 +325,8 @@ pub fn parse_config(args: Vec<String>) -> Config {
329325
fail_fast: matches.opt_present("fail-fast")
330326
|| env::var_os("RUSTC_TEST_FAIL_FAST").is_some(),
331327

332-
compile_lib_path: make_absolute(opt_path(matches, "compile-lib-path")),
333-
run_lib_path: make_absolute(opt_path(matches, "run-lib-path")),
328+
compile_lib_path: std::path::absolute(opt_path(matches, "compile-lib-path")),
329+
run_lib_path: std::path::absolute(opt_path(matches, "run-lib-path")),
334330
rustc_path: opt_path(matches, "rustc-path"),
335331
cargo_path: matches.opt_str("cargo-path").map(PathBuf::from),
336332
stage0_rustc_path: matches.opt_str("stage0-rustc-path").map(PathBuf::from),

0 commit comments

Comments
 (0)