Skip to content

Commit 2ee49eb

Browse files
authored
Rollup merge of #71782 - cuviper:leave-dev-null-alone, r=Mark-Simulacrum
Use a non-existent test path instead of clobbering /dev/null Fixes #71502. r? @Mark-Simulacrum
2 parents a9c818e + fbd3fbd commit 2ee49eb

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/test/ui/non-ice-error-on-worker-io-fail.rs

+7-3
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@
44
//
55
// An attempt to `-o` into a directory we cannot write into should indeed
66
// be an error; but not an ICE.
7+
//
8+
// However, some folks run tests as root, which can write `/dev/` and end
9+
// up clobbering `/dev/null`. Instead we'll use a non-existent path, which
10+
// also used to ICE, but even root can't magically write there.
711

8-
// compile-flags: -o /dev/null
12+
// compile-flags: -o /does-not-exist/output
913

1014
// The error-pattern check occurs *before* normalization, and the error patterns
1115
// are wildly different between build environments. So this is a cop-out (and we
@@ -15,10 +19,10 @@
1519
// error-pattern: error
1620

1721
// On Mac OS X, we get an error like the below
18-
// normalize-stderr-test "failed to write bytecode to /dev/null.non_ice_error_on_worker_io_fail.*" -> "io error modifying /dev/"
22+
// normalize-stderr-test "failed to write bytecode to /does-not-exist/output.non_ice_error_on_worker_io_fail.*" -> "io error modifying /does-not-exist/"
1923

2024
// On Linux, we get an error like the below
21-
// normalize-stderr-test "couldn't create a temp dir.*" -> "io error modifying /dev/"
25+
// normalize-stderr-test "couldn't create a temp dir.*" -> "io error modifying /does-not-exist/"
2226

2327
// ignore-tidy-linelength
2428
// ignore-windows - this is a unix-specific test
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
warning: ignoring --out-dir flag due to -o flag
22

3-
error: io error modifying /dev/
3+
error: io error modifying /does-not-exist/
44

55
error: aborting due to previous error; 1 warning emitted
66

0 commit comments

Comments
 (0)