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/invalid-tmpdir-env-var/foo.rs (renamed from tests/run-make/issue-14698/foo.rs)0
-rw-r--r--tests/run-make/invalid-tmpdir-env-var/rmake.rs18
-rw-r--r--tests/run-make/issue-14698/Makefile4
4 files changed, 18 insertions, 5 deletions
diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt
index 6b3533c2578..cc959fa24a6 100644
--- a/src/tools/tidy/src/allowed_run_make_makefiles.txt
+++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt
@@ -28,7 +28,6 @@ run-make/incr-add-rust-src-component/Makefile
 run-make/incr-foreign-head-span/Makefile
 run-make/interdependent-c-libraries/Makefile
 run-make/issue-107094/Makefile
-run-make/issue-14698/Makefile
 run-make/issue-15460/Makefile
 run-make/issue-33329/Makefile
 run-make/issue-35164/Makefile
diff --git a/tests/run-make/issue-14698/foo.rs b/tests/run-make/invalid-tmpdir-env-var/foo.rs
index f328e4d9d04..f328e4d9d04 100644
--- a/tests/run-make/issue-14698/foo.rs
+++ b/tests/run-make/invalid-tmpdir-env-var/foo.rs
diff --git a/tests/run-make/invalid-tmpdir-env-var/rmake.rs b/tests/run-make/invalid-tmpdir-env-var/rmake.rs
new file mode 100644
index 00000000000..d4258775a11
--- /dev/null
+++ b/tests/run-make/invalid-tmpdir-env-var/rmake.rs
@@ -0,0 +1,18 @@
+// When the TMP or TMPDIR variable is set to an invalid or non-existing directory,
+// this used to cause an internal compiler error (ICE). After the addition of proper
+// error handling in #28430, this test checks that the expected message is printed.
+// See https://github.com/rust-lang/rust/issues/14698
+
+use run_make_support::rustc;
+
+// NOTE: This is not a UI test despite its simplicity, as the error message contains a path
+// with some variability that is difficult to normalize
+
+fn main() {
+    rustc()
+        .input("foo.rs")
+        .env("TMP", "fake")
+        .env("TMPDIR", "fake")
+        .run_fail()
+        .assert_stderr_contains("couldn't create a temp dir");
+}
diff --git a/tests/run-make/issue-14698/Makefile b/tests/run-make/issue-14698/Makefile
deleted file mode 100644
index a1cfb5abab5..00000000000
--- a/tests/run-make/issue-14698/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-include ../tools.mk
-
-all:
-	TMP=fake TMPDIR=fake $(RUSTC) foo.rs 2>&1 | $(CGREP) "couldn't create a temp dir:"