about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-05-13 11:20:00 +0000
committerbors <bors@rust-lang.org>2024-05-13 11:20:00 +0000
commitabb95639ef2b837dbfe7b5d18f51fadda29711cb (patch)
tree7d0474acda9f0e9c86b198b38017eff69d3fae33
parent6be7b0c7d2b085474f9f2f9323c2266f4df105d8 (diff)
parent198b073192402510eb7b0b0ec2a98ca6dbdeebc1 (diff)
downloadrust-abb95639ef2b837dbfe7b5d18f51fadda29711cb.tar.gz
rust-abb95639ef2b837dbfe7b5d18f51fadda29711cb.zip
Auto merge of #125024 - Oneirical:master, r=jieyouxu
Rewrite 3 very similar `run-make` alloc tests to rmake

Part of #121876

#121918 attempted to port these 3 tests 2 months ago. However, since then, the structure of `run-make-support` has changed a bit and new helper functions were added. Since there has been no activity on the PR, they are good low-hanging fruit to knock down, using the new functions of the current library.

There is also the removal of a useless import on a very similar test.
-rw-r--r--src/tools/tidy/src/allowed_run_make_makefiles.txt3
-rw-r--r--tests/run-make/alloc-no-oom-handling/Makefile7
-rw-r--r--tests/run-make/alloc-no-oom-handling/rmake.rs15
-rw-r--r--tests/run-make/alloc-no-rc/Makefile7
-rw-r--r--tests/run-make/alloc-no-rc/rmake.rs15
-rw-r--r--tests/run-make/alloc-no-sync/Makefile7
-rw-r--r--tests/run-make/alloc-no-sync/rmake.rs15
-rw-r--r--tests/run-make/core-no-fp-fmt-parse/rmake.rs1
8 files changed, 45 insertions, 25 deletions
diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt
index d7423682920..02a94457385 100644
--- a/src/tools/tidy/src/allowed_run_make_makefiles.txt
+++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt
@@ -1,6 +1,3 @@
-run-make/alloc-no-oom-handling/Makefile
-run-make/alloc-no-rc/Makefile
-run-make/alloc-no-sync/Makefile
 run-make/allocator-shim-circular-deps/Makefile
 run-make/allow-non-lint-warnings-cmdline/Makefile
 run-make/allow-warnings-cmdline-stability/Makefile
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 7c3ae90b58d..00000000000
--- a/tests/run-make/alloc-no-oom-handling/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-# This test checks that alloc can still compile correctly when the unstable no_global_oom_handling feature is turned on.
-# See https://github.com/rust-lang/rust/pull/84266
-
-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 00000000000..fec3c653294
--- /dev/null
+++ b/tests/run-make/alloc-no-oom-handling/rmake.rs
@@ -0,0 +1,15 @@
+// This test checks that alloc can still compile correctly
+// when the unstable no_global_oom_handling feature is turned on.
+// See https://github.com/rust-lang/rust/pull/84266
+
+use run_make_support::rustc;
+
+fn main() {
+    rustc()
+        .edition("2021")
+        .arg("-Dwarnings")
+        .crate_type("rlib")
+        .input("../../../library/alloc/src/lib.rs")
+        .cfg("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 fcfe1603b6c..00000000000
--- a/tests/run-make/alloc-no-rc/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-# This test checks that alloc can still compile correctly when the unstable no_rc feature is turned on.
-# See https://github.com/rust-lang/rust/pull/89891
-
-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 00000000000..c5744a3f5ee
--- /dev/null
+++ b/tests/run-make/alloc-no-rc/rmake.rs
@@ -0,0 +1,15 @@
+// This test checks that alloc can still compile correctly
+// when the unstable no_rc feature is turned on.
+// See https://github.com/rust-lang/rust/pull/84266
+
+use run_make_support::rustc;
+
+fn main() {
+    rustc()
+        .edition("2021")
+        .arg("-Dwarnings")
+        .crate_type("rlib")
+        .input("../../../library/alloc/src/lib.rs")
+        .cfg("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 997dbcf6603..00000000000
--- a/tests/run-make/alloc-no-sync/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-# This test checks that alloc can still compile correctly when the unstable no_sync feature is turned on.
-# See https://github.com/rust-lang/rust/pull/89891
-
-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 00000000000..6410eca80ab
--- /dev/null
+++ b/tests/run-make/alloc-no-sync/rmake.rs
@@ -0,0 +1,15 @@
+// This test checks that alloc can still compile correctly
+// when the unstable no_sync feature is turned on.
+// See https://github.com/rust-lang/rust/pull/84266
+
+use run_make_support::rustc;
+
+fn main() {
+    rustc()
+        .edition("2021")
+        .arg("-Dwarnings")
+        .crate_type("rlib")
+        .input("../../../library/alloc/src/lib.rs")
+        .cfg("no_sync")
+        .run();
+}
diff --git a/tests/run-make/core-no-fp-fmt-parse/rmake.rs b/tests/run-make/core-no-fp-fmt-parse/rmake.rs
index e3484888ca5..aef28fd2528 100644
--- a/tests/run-make/core-no-fp-fmt-parse/rmake.rs
+++ b/tests/run-make/core-no-fp-fmt-parse/rmake.rs
@@ -2,7 +2,6 @@
 // support for formatting and parsing floating-point numbers.
 
 use run_make_support::rustc;
-use std::path::PathBuf;
 
 fn main() {
     rustc()