File tree Expand file tree Collapse file tree 3 files changed +21
-15
lines changed
tests/run-make/output-filename-overwrites-input Expand file tree Collapse file tree 3 files changed +21
-15
lines changed Original file line number Diff line number Diff line change @@ -152,7 +152,6 @@ run-make/no-duplicate-libs/Makefile
152152run-make/obey-crate-type-flag/Makefile
153153run-make/optimization-remarks-dir-pgo/Makefile
154154run-make/optimization-remarks-dir/Makefile
155- run-make/output-filename-overwrites-input/Makefile
156155run-make/output-type-permutations/Makefile
157156run-make/output-with-hyphens/Makefile
158157run-make/override-aliased-flags/Makefile
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ // If rustc is invoked on a file that would be overwritten by the
2+ // compilation, the compilation should fail, to avoid accidental loss.
3+ // See https://github.com/rust-lang/rust/pull/46814
4+
5+ //@ ignore-cross-compile
6+
7+ use run_make_support:: { fs_wrapper, rustc} ;
8+
9+ fn main ( ) {
10+ fs_wrapper:: copy ( "foo.rs" , "foo" ) ;
11+ rustc ( ) . input ( "foo" ) . output ( "foo" ) . run_fail ( ) . assert_stderr_contains (
12+ r#"the input file "foo" would be overwritten by the generated executable"# ,
13+ ) ;
14+ fs_wrapper:: copy ( "bar.rs" , "bar.rlib" ) ;
15+ rustc ( ) . input ( "bar.rlib" ) . output ( "bar.rlib" ) . run_fail ( ) . assert_stderr_contains (
16+ r#"the input file "bar.rlib" would be overwritten by the generated executable"# ,
17+ ) ;
18+ rustc ( ) . input ( "foo.rs" ) . output ( "foo.rs" ) . run_fail ( ) . assert_stderr_contains (
19+ r#"the input file "foo.rs" would be overwritten by the generated executable"# ,
20+ ) ;
21+ }
You can’t perform that action at this time.
0 commit comments