about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/tools/tidy/src/allowed_run_make_makefiles.txt1
-rw-r--r--tests/run-make/error-found-staticlib-instead-crate/Makefile5
-rw-r--r--tests/run-make/error-found-staticlib-instead-crate/rmake.rs11
3 files changed, 11 insertions, 6 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..5b2ccbf98d4 100644
--- a/src/tools/tidy/src/allowed_run_make_makefiles.txt
+++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt
@@ -38,7 +38,6 @@ run-make/emit-shared-files/Makefile
 run-make/emit-stack-sizes/Makefile
 run-make/emit-to-stdout/Makefile
 run-make/env-dep-info/Makefile
-run-make/error-found-staticlib-instead-crate/Makefile
 run-make/error-writing-dependencies/Makefile
 run-make/export-executable-symbols/Makefile
 run-make/extern-diff-internal-name/Makefile
diff --git a/tests/run-make/error-found-staticlib-instead-crate/Makefile b/tests/run-make/error-found-staticlib-instead-crate/Makefile
deleted file mode 100644
index 0eae41d720c..00000000000
--- a/tests/run-make/error-found-staticlib-instead-crate/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-include ../tools.mk
-
-all:
-	$(RUSTC) foo.rs --crate-type staticlib
-	$(RUSTC) bar.rs 2>&1 | $(CGREP) "found staticlib"
diff --git a/tests/run-make/error-found-staticlib-instead-crate/rmake.rs b/tests/run-make/error-found-staticlib-instead-crate/rmake.rs
new file mode 100644
index 00000000000..8c707092b7e
--- /dev/null
+++ b/tests/run-make/error-found-staticlib-instead-crate/rmake.rs
@@ -0,0 +1,11 @@
+// When rustc is looking for a crate but is given a staticlib instead,
+// the error message should be helpful and indicate precisely the cause
+// of the compilation failure.
+// See https://github.com/rust-lang/rust/pull/21978
+
+use run_make_support::rustc;
+
+fn main() {
+    rustc().input("foo.rs").crate_type("staticlib").run();
+    rustc().input("bar.rs").run_fail().assert_stderr_contains("found staticlib");
+}