Skip to content

Commit 55b5816

Browse files
committed
rewrite unknown-mod-stdin to rmake
1 parent c4c0897 commit 55b5816

File tree

3 files changed

+25
-9
lines changed

3 files changed

+25
-9
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ run-make/track-path-dep-info/Makefile
187187
run-make/track-pgo-dep-info/Makefile
188188
run-make/translation/Makefile
189189
run-make/type-mismatch-same-crate-name/Makefile
190-
run-make/unknown-mod-stdin/Makefile
191190
run-make/unstable-flag-required/Makefile
192191
run-make/used-cdylib-macos/Makefile
193192
run-make/volatile-intrinsics/Makefile

tests/run-make/unknown-mod-stdin/Makefile

-8
This file was deleted.
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Rustc displays a compilation error when it finds a `mod` (module)
2+
// statement referencing a file that does not exist. However, a bug from 2019
3+
// caused invalid `mod` statements to silently insert empty inline modules
4+
// instead of showing an error if the invalid `mod` statement had been passed
5+
// through standard input. This test checks that this bug does not make a resurgence.
6+
// See https://github.com/rust-lang/rust/issues/65601
7+
8+
// NOTE: This is not a UI test, because the bug which this test
9+
// is checking for is specifically tied to passing
10+
// `mod unknown;` through standard input.
11+
12+
use run_make_support::{diff, rustc};
13+
14+
fn main() {
15+
let out = rustc().crate_type("rlib").stdin(b"mod unknown;").arg("-").run_fail();
16+
diff()
17+
.actual_text("actual-stdout", out.stdout_utf8())
18+
.expected_file("unknown-mod.stdout")
19+
.run();
20+
diff()
21+
.actual_text("actual-stderr", out.stderr_utf8())
22+
.expected_file("unknown-mod.stderr")
23+
.normalize(r#"\\"#, "/")
24+
.run();
25+
}

0 commit comments

Comments
 (0)