about summary refs log tree commit diff
path: root/tests/run-make/incremental-session-fail/rmake.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run-make/incremental-session-fail/rmake.rs')
-rw-r--r--tests/run-make/incremental-session-fail/rmake.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/run-make/incremental-session-fail/rmake.rs b/tests/run-make/incremental-session-fail/rmake.rs
new file mode 100644
index 00000000000..0283709f2cf
--- /dev/null
+++ b/tests/run-make/incremental-session-fail/rmake.rs
@@ -0,0 +1,15 @@
+// Failing to create the directory where output incremental
+// files would be stored used to cause an ICE (Internal Compiler
+// Error). This was patched in #85698, and this test checks that
+// the ensuing compilation failure is not an ICE.
+// See https://github.com/rust-lang/rust/pull/85698
+
+use run_make_support::{fs_wrapper, rustc};
+
+fn main() {
+    fs_wrapper::create_file("session");
+    // rustc should fail to create the session directory here.
+    let out = rustc().input("foo.rs").crate_type("rlib").incremental("session").run_fail();
+    out.assert_stderr_contains("could not create incremental compilation crate directory");
+    out.assert_stderr_not_contains("internal compiler error");
+}