about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-01-11 21:01:02 +0000
committerbors <bors@rust-lang.org>2020-01-11 21:01:02 +0000
commitf363745872f9b45cfec575f3c2cac42f0c242c03 (patch)
tree01cd7d149a374dd6b77f1829bbab5fed71943f39 /src/test
parent1389494ac145a84dba025ff65969f7ab150c3f02 (diff)
parent31938366d2da5434344011f20fc2564e03228cd1 (diff)
downloadrust-f363745872f9b45cfec575f3c2cac42f0c242c03.tar.gz
rust-f363745872f9b45cfec575f3c2cac42f0c242c03.zip
Auto merge of #67458 - pnkfelix:fix-66530-by-propagating-fatal-error-from-worker, r=matthewjasper
When a codegen worker has a FatalError, propagate it instead of ICE'ing.

Fix #66530
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/non-ice-error-on-worker-io-fail.rs37
-rw-r--r--src/test/ui/non-ice-error-on-worker-io-fail.stderr6
2 files changed, 43 insertions, 0 deletions
diff --git a/src/test/ui/non-ice-error-on-worker-io-fail.rs b/src/test/ui/non-ice-error-on-worker-io-fail.rs
new file mode 100644
index 00000000000..8af17742850
--- /dev/null
+++ b/src/test/ui/non-ice-error-on-worker-io-fail.rs
@@ -0,0 +1,37 @@
+// Issue #66530: We would ICE if someone compiled with `-o /dev/null`,
+// because we would try to generate auxiliary files in `/dev/` (which
+// at least the OS X file system rejects).
+//
+// An attempt to `-o` into a directory we cannot write into should indeed
+// be an error; but not an ICE.
+
+// compile-flags: -o /dev/null
+
+// The error-pattern check occurs *before* normalization, and the error patterns
+// are wildly different between build environments. So this is a cop-out (and we
+// rely on the checking of the normalized stderr output as our actual
+// "verification" of the diagnostic).
+
+// error-pattern: error
+
+// On Mac OS X, we get an error like the below
+// normalize-stderr-test "failed to write bytecode to /dev/null.non_ice_error_on_worker_io_fail.*" -> "io error modifying /dev/"
+
+// On Linux, we get an error like the below
+// normalize-stderr-test "couldn't create a temp dir.*" -> "io error modifying /dev/"
+
+// ignore-tidy-linelength
+// ignore-windows - this is a unix-specific test
+// ignore-emscripten - the file-system issues do not replicate here
+// ignore-wasm - the file-system issues do not replicate here
+// ignore-arm - the file-system issues do not replicate here, at least on armhf-gnu
+
+#![crate_type="lib"]
+
+#![cfg_attr(not(feature = "std"), no_std)]
+pub mod task {
+    pub mod __internal {
+        use crate::task::Waker;
+    }
+    pub use core::task::Waker;
+}
diff --git a/src/test/ui/non-ice-error-on-worker-io-fail.stderr b/src/test/ui/non-ice-error-on-worker-io-fail.stderr
new file mode 100644
index 00000000000..f5601ad03d5
--- /dev/null
+++ b/src/test/ui/non-ice-error-on-worker-io-fail.stderr
@@ -0,0 +1,6 @@
+warning: ignoring --out-dir flag due to -o flag
+
+error: io error modifying /dev/
+
+error: aborting due to previous error
+