Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
rewrite overwrite-input to rmake
  • Loading branch information
Oneirical committed Jun 26, 2024
commit a6bb92ada7864cbd3bdc3c2a2cb998c0ba512bca
1 change: 0 additions & 1 deletion src/tools/tidy/src/allowed_run_make_makefiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ run-make/optimization-remarks-dir-pgo/Makefile
run-make/optimization-remarks-dir/Makefile
run-make/output-type-permutations/Makefile
run-make/override-aliased-flags/Makefile
run-make/overwrite-input/Makefile
run-make/panic-abort-eh_frame/Makefile
run-make/pass-linker-flags-flavor/Makefile
run-make/pass-linker-flags-from-dep/Makefile
Expand Down
7 changes: 0 additions & 7 deletions tests/run-make/overwrite-input/Makefile

This file was deleted.

4 changes: 1 addition & 3 deletions tests/run-make/overwrite-input/file.stderr
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
warning: ignoring --out-dir flag due to -o flag

error: the input file "main.rs" would be overwritten by the generated executable

error: aborting due to 1 previous error; 1 warning emitted
error: aborting due to 1 previous error

4 changes: 1 addition & 3 deletions tests/run-make/overwrite-input/folder.stderr
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
warning: ignoring --out-dir flag due to -o flag

error: the generated executable for the input file "main.rs" conflicts with the existing directory "."

error: aborting due to 1 previous error; 1 warning emitted
error: aborting due to 1 previous error

6 changes: 0 additions & 6 deletions tests/run-make/overwrite-input/main.stderr

This file was deleted.

13 changes: 13 additions & 0 deletions tests/run-make/overwrite-input/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// An attempt to set the output `-o` into a directory or a file we cannot write into should indeed
// be an error; but not an ICE (Internal Compiler Error). This test attempts both and checks
// that the standard error matches what is expected.
// See https://github.com/rust-lang/rust/issues/66530

use run_make_support::{diff, rustc};

fn main() {
let file_out = rustc().input("main.rs").output("main.rs").run_fail().stderr_utf8();
let folder_out = rustc().input("main.rs").output(".").run_fail().stderr_utf8();
diff().expected_file("file.stderr").actual_text("actual-file-stderr", file_out).run();
diff().expected_file("folder.stderr").actual_text("actual-folder-stderr", folder_out).run();
}