about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeón Orell Valerian Liehr <me@fmease.dev>2024-05-30 01:12:34 +0200
committerGitHub <noreply@github.com>2024-05-30 01:12:34 +0200
commit3b6a3eb3ccd125311381085a12a7cb5d2ee37e9d (patch)
tree38b6fca6cb0484d4ba559f91af04d037bdf85a93
parentdebd22da66cfa97c74040ebf68e420672ac8560e (diff)
parent5b0e6cb6729df41d45d7b504d46aa29e2059779b (diff)
downloadrust-3b6a3eb3ccd125311381085a12a7cb5d2ee37e9d.tar.gz
rust-3b6a3eb3ccd125311381085a12a7cb5d2ee37e9d.zip
Rollup merge of #125653 - GuillaumeGomez:migrate-const-prop-lint, r=jieyouxu
Migrate `run-make/const-prop-lint` to `rmake.rs`

Part of https://github.com/rust-lang/rust/issues/121876.

r? ``@jieyouxu``
-rw-r--r--src/tools/tidy/src/allowed_run_make_makefiles.txt1
-rw-r--r--tests/run-make/const-prop-lint/Makefile9
-rw-r--r--tests/run-make/const-prop-lint/rmake.rs18
3 files changed, 18 insertions, 10 deletions
diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt
index fac11cd1566..efbb8142d61 100644
--- a/src/tools/tidy/src/allowed_run_make_makefiles.txt
+++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt
@@ -21,7 +21,6 @@ run-make/compiler-lookup-paths-2/Makefile
 run-make/compiler-lookup-paths/Makefile
 run-make/compiler-rt-works-on-mingw/Makefile
 run-make/compressed-debuginfo/Makefile
-run-make/const-prop-lint/Makefile
 run-make/const_fn_mir/Makefile
 run-make/crate-data-smoke/Makefile
 run-make/crate-hash-rustc-version/Makefile
diff --git a/tests/run-make/const-prop-lint/Makefile b/tests/run-make/const-prop-lint/Makefile
deleted file mode 100644
index f29f282f787..00000000000
--- a/tests/run-make/const-prop-lint/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-include ../tools.mk
-
-# Test that emitting an error because of arithmetic
-# overflow lint does not leave .o files around
-# because of interrupted codegen.
-
-all:
-	$(RUSTC) input.rs; test $$? -eq 1
-	ls *.o; test $$? -ne 0
diff --git a/tests/run-make/const-prop-lint/rmake.rs b/tests/run-make/const-prop-lint/rmake.rs
new file mode 100644
index 00000000000..fa27a18a591
--- /dev/null
+++ b/tests/run-make/const-prop-lint/rmake.rs
@@ -0,0 +1,18 @@
+// Tests that const prop lints interrupting codegen don't leave `.o` files around.
+
+use std::fs;
+
+use run_make_support::{rustc, tmp_dir};
+
+fn main() {
+    rustc().input("input.rs").run_fail_assert_exit_code(1);
+
+    for entry in fs::read_dir(tmp_dir()).unwrap() {
+        let entry = entry.unwrap();
+        let path = entry.path();
+
+        if path.is_file() && path.extension().is_some_and(|ext| ext == "o") {
+            panic!("there should not be `.o` files!");
+        }
+    }
+}