From 1e6d8609c5bf98516094b194838b43afb35424f3 Mon Sep 17 00:00:00 2001 From: abhay-51 Date: Sun, 3 Mar 2024 00:10:51 +0100 Subject: [PATCH] Commit : Move alloc --- src/tools/run-make-support/src/lib.rs | 6 ++++++ tests/run-make/alloc-no-oom-handling/Makefile | 4 ---- tests/run-make/alloc-no-oom-handling/rmake.rs | 19 +++++++++++++++++++ tests/run-make/alloc-no-rc/Makefile | 4 ---- tests/run-make/alloc-no-rc/rmake.rs | 19 +++++++++++++++++++ tests/run-make/alloc-no-sync/Makefile | 4 ---- tests/run-make/alloc-no-sync/rmake.rs | 19 +++++++++++++++++++ 7 files changed, 63 insertions(+), 12 deletions(-) delete mode 100644 tests/run-make/alloc-no-oom-handling/Makefile create mode 100644 tests/run-make/alloc-no-oom-handling/rmake.rs delete mode 100644 tests/run-make/alloc-no-rc/Makefile create mode 100644 tests/run-make/alloc-no-rc/rmake.rs delete mode 100644 tests/run-make/alloc-no-sync/Makefile create mode 100644 tests/run-make/alloc-no-sync/rmake.rs diff --git a/src/tools/run-make-support/src/lib.rs b/src/tools/run-make-support/src/lib.rs index 820218732cec..de2249ba0617 100644 --- a/src/tools/run-make-support/src/lib.rs +++ b/src/tools/run-make-support/src/lib.rs @@ -45,6 +45,12 @@ impl RustcInvocationBuilder { self } + pub fn arg_path(&mut self, path: &[&str]) -> &mut RustcInvocationBuilder { + let path_buf = path.iter().collect::(); + self.cmd.arg(path_buf.to_str().unwrap()); + self + } + #[track_caller] pub fn run(&mut self) -> Output { let caller_location = std::panic::Location::caller(); diff --git a/tests/run-make/alloc-no-oom-handling/Makefile b/tests/run-make/alloc-no-oom-handling/Makefile deleted file mode 100644 index 87f74c69c793..000000000000 --- a/tests/run-make/alloc-no-oom-handling/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -include ../tools.mk - -all: - $(RUSTC) --edition=2021 -Dwarnings --crate-type=rlib ../../../library/alloc/src/lib.rs --cfg no_global_oom_handling diff --git a/tests/run-make/alloc-no-oom-handling/rmake.rs b/tests/run-make/alloc-no-oom-handling/rmake.rs new file mode 100644 index 000000000000..5a855b11f9e2 --- /dev/null +++ b/tests/run-make/alloc-no-oom-handling/rmake.rs @@ -0,0 +1,19 @@ +// ignore-tidy-linelength + +extern crate run_make_support; + +use run_make_support::rustc; +use std::path::PathBuf; + +fn main() { + rustc() + .arg("--edition") + .arg("2021") + .arg("-Dwarnings") + .arg("--crate-type") + .arg("rlib") + .arg_path(&["..", "..", "..", "library", "alloc", "src", "lib.rs"]) + .arg("--cfg") + .arg("no_global_oom_handling") + .run(); +} diff --git a/tests/run-make/alloc-no-rc/Makefile b/tests/run-make/alloc-no-rc/Makefile deleted file mode 100644 index 9824b17e6c2a..000000000000 --- a/tests/run-make/alloc-no-rc/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -include ../tools.mk - -all: - $(RUSTC) --edition=2021 -Dwarnings --crate-type=rlib ../../../library/alloc/src/lib.rs --cfg no_rc diff --git a/tests/run-make/alloc-no-rc/rmake.rs b/tests/run-make/alloc-no-rc/rmake.rs new file mode 100644 index 000000000000..c5217e22e05b --- /dev/null +++ b/tests/run-make/alloc-no-rc/rmake.rs @@ -0,0 +1,19 @@ +// ignore-tidy-linelength + +extern crate run_make_support; + +use run_make_support::rustc; +use std::path::PathBuf; + +fn main() { + rustc() + .arg("--edition") + .arg("2021") + .arg("-Dwarnings") + .arg("--crate-type") + .arg("rlib") + .arg_path(&["..", "..", "..", "library", "alloc", "src", "lib.rs"]) + .arg("--cfg") + .arg("no_rc") + .run(); +} diff --git a/tests/run-make/alloc-no-sync/Makefile b/tests/run-make/alloc-no-sync/Makefile deleted file mode 100644 index 04ec4c7d8bc9..000000000000 --- a/tests/run-make/alloc-no-sync/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -include ../tools.mk - -all: - $(RUSTC) --edition=2021 -Dwarnings --crate-type=rlib ../../../library/alloc/src/lib.rs --cfg no_sync diff --git a/tests/run-make/alloc-no-sync/rmake.rs b/tests/run-make/alloc-no-sync/rmake.rs new file mode 100644 index 000000000000..d9423620ce0d --- /dev/null +++ b/tests/run-make/alloc-no-sync/rmake.rs @@ -0,0 +1,19 @@ +// ignore-tidy-linelength + +extern crate run_make_support; + +use run_make_support::rustc; +use std::path::PathBuf; + +fn main() { + rustc() + .arg("--edition") + .arg("2021") + .arg("-Dwarnings") + .arg("--crate-type") + .arg("rlib") + .arg_path(&["..", "..", "..", "library", "alloc", "src", "lib.rs"]) + .arg("--cfg") + .arg("no_sync") + .run(); +}