File tree Expand file tree Collapse file tree 3 files changed +25
-9
lines changed
tests/run-make/unknown-mod-stdin Expand file tree Collapse file tree 3 files changed +25
-9
lines changed Original file line number Diff line number Diff line change @@ -212,7 +212,6 @@ run-make/track-path-dep-info/Makefile
212212run-make/track-pgo-dep-info/Makefile
213213run-make/translation/Makefile
214214run-make/type-mismatch-same-crate-name/Makefile
215- run-make/unknown-mod-stdin/Makefile
216215run-make/unstable-flag-required/Makefile
217216run-make/use-suggestions-rust-2018/Makefile
218217run-make/used-cdylib-macos/Makefile
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments