Skip to content

Commit 0a4502a

Browse files
committed
Commit 7 : Add arg path
1 parent 979c9f4 commit 0a4502a

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

src/tools/run-make-support/src/lib.rs

+6
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ impl RustcInvocationBuilder {
4545
self
4646
}
4747

48+
pub fn arg_path(&mut self, path: &[&str]) -> &mut RustcInvocationBuilder {
49+
let path_buf = path.iter().collect::<PathBuf>();
50+
self.cmd.arg(path_buf.to_str().unwrap());
51+
self
52+
}
53+
4854
#[track_caller]
4955
pub fn run(&mut self) -> Output {
5056
let caller_location = std::panic::Location::caller();

tests/run-make/alloc-no-oom-handling/rmake.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@ use run_make_support::rustc;
66
use std::path::PathBuf;
77

88
fn main() {
9-
let lib_path = PathBuf::from("../../../library/alloc/src/lib.rs");
109
rustc()
1110
.arg("--edition")
1211
.arg("2021")
1312
.arg("-Dwarnings")
1413
.arg("--crate-type")
1514
.arg("rlib")
16-
.arg(lib_path.to_str().unwrap())
15+
.arg_path(&["..", "..", "..", "library", "alloc", "src", "lib.rs"])
1716
.arg("--cfg")
1817
.arg("no_global_oom_handling")
1918
.run();

tests/run-make/alloc-no-rc/rmake.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@ use run_make_support::rustc;
66
use std::path::PathBuf;
77

88
fn main() {
9-
let lib_path = PathBuf::from("../../../library/alloc/src/lib.rs");
109
rustc()
1110
.arg("--edition")
1211
.arg("2021")
1312
.arg("-Dwarnings")
1413
.arg("--crate-type")
1514
.arg("rlib")
16-
.arg(lib_path.to_str().unwrap())
15+
.arg_path(&["..", "..", "..", "library", "alloc", "src", "lib.rs"])
1716
.arg("--cfg")
1817
.arg("no_rc")
1918
.run();

tests/run-make/alloc-no-sync/rmake.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@ use run_make_support::rustc;
66
use std::path::PathBuf;
77

88
fn main() {
9-
let lib_path = PathBuf::from("../../../library/alloc/src/lib.rs");
109
rustc()
1110
.arg("--edition")
1211
.arg("2021")
1312
.arg("-Dwarnings")
1413
.arg("--crate-type")
1514
.arg("rlib")
16-
.arg(lib_path.to_str().unwrap())
15+
.arg_path(&["..", "..", "..", "library", "alloc", "src", "lib.rs"])
1716
.arg("--cfg")
1817
.arg("no_sync")
1918
.run();

0 commit comments

Comments
 (0)