about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOneirical <manchot@videotron.ca>2024-06-13 16:19:59 -0400
committerOneirical <manchot@videotron.ca>2024-06-14 10:02:39 -0400
commitcabc9822537a7ded20a64092917bf81d3f994c71 (patch)
treea2d0fa4e33fcf3e8b70436885e878731ca8c858a
parentff82e43ca3dfc91e85c15070f836ca9cd692a476 (diff)
downloadrust-cabc9822537a7ded20a64092917bf81d3f994c71.tar.gz
rust-cabc9822537a7ded20a64092917bf81d3f994c71.zip
rewrite invalid-staticlib to rmake
-rw-r--r--src/tools/tidy/src/allowed_run_make_makefiles.txt2
-rw-r--r--tests/run-make/invalid-staticlib/Makefile5
-rw-r--r--tests/run-make/invalid-staticlib/rmake.rs17
3 files changed, 17 insertions, 7 deletions
diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt
index be9df226d64..a4ca3151baa 100644
--- a/src/tools/tidy/src/allowed_run_make_makefiles.txt
+++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt
@@ -75,7 +75,6 @@ run-make/interdependent-c-libraries/Makefile
 run-make/intrinsic-unreachable/Makefile
 run-make/invalid-library/Makefile
 run-make/invalid-so/Makefile
-run-make/invalid-staticlib/Makefile
 run-make/issue-107094/Makefile
 run-make/issue-10971-temps-dir/Makefile
 run-make/issue-109934-lto-debuginfo/Makefile
@@ -96,7 +95,6 @@ run-make/issue-40535/Makefile
 run-make/issue-47384/Makefile
 run-make/issue-47551/Makefile
 run-make/issue-51671/Makefile
-run-make/issue-64153/Makefile
 run-make/issue-68794-textrel-on-minimal-lib/Makefile
 run-make/issue-69368/Makefile
 run-make/issue-83045/Makefile
diff --git a/tests/run-make/invalid-staticlib/Makefile b/tests/run-make/invalid-staticlib/Makefile
deleted file mode 100644
index 3f0f74ce3cb..00000000000
--- a/tests/run-make/invalid-staticlib/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-include ../tools.mk
-
-all:
-	touch $(TMPDIR)/libfoo.a
-	echo | $(RUSTC) - --crate-type=rlib -lstatic=foo 2>&1 | $(CGREP) "failed to add native library"
diff --git a/tests/run-make/invalid-staticlib/rmake.rs b/tests/run-make/invalid-staticlib/rmake.rs
new file mode 100644
index 00000000000..45129293247
--- /dev/null
+++ b/tests/run-make/invalid-staticlib/rmake.rs
@@ -0,0 +1,17 @@
+// If the static library provided is not valid (in this test,
+// created as an empty file),
+// rustc should print a normal error message and not throw
+// an internal compiler error (ICE).
+// See https://github.com/rust-lang/rust/pull/28673
+
+use run_make_support::{fs_wrapper, rustc, static_lib_name};
+
+fn main() {
+    fs_wrapper::create_file(static_lib_name("foo"));
+    rustc()
+        .arg("-")
+        .crate_type("rlib")
+        .arg("-lstatic=foo")
+        .run_fail()
+        .assert_stderr_contains("failed to add native library");
+}