Skip to content

Commit 8ece5ce

Browse files
committed
rewrite output-filename-overwrites-input to rmake
1 parent e088edd commit 8ece5ce

File tree

3 files changed

+21
-15
lines changed

3 files changed

+21
-15
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ run-make/no-duplicate-libs/Makefile
152152
run-make/obey-crate-type-flag/Makefile
153153
run-make/optimization-remarks-dir-pgo/Makefile
154154
run-make/optimization-remarks-dir/Makefile
155-
run-make/output-filename-overwrites-input/Makefile
156155
run-make/output-type-permutations/Makefile
157156
run-make/output-with-hyphens/Makefile
158157
run-make/override-aliased-flags/Makefile

tests/run-make/output-filename-overwrites-input/Makefile

-14
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
}

0 commit comments

Comments
 (0)