File tree 3 files changed +25
-9
lines changed
tests/run-make/unknown-mod-stdin
3 files changed +25
-9
lines changed Original file line number Diff line number Diff line change @@ -187,7 +187,6 @@ run-make/track-path-dep-info/Makefile
187
187
run-make/track-pgo-dep-info/Makefile
188
188
run-make/translation/Makefile
189
189
run-make/type-mismatch-same-crate-name/Makefile
190
- run-make/unknown-mod-stdin/Makefile
191
190
run-make/unstable-flag-required/Makefile
192
191
run-make/used-cdylib-macos/Makefile
193
192
run-make/volatile-intrinsics/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