Skip to content

Commit 3bff5d8

Browse files
committed
rewrite output-with-hyphens to rmake format
1 parent f5705b2 commit 3bff5d8

File tree

5 files changed

+29
-22
lines changed

5 files changed

+29
-22
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ run-make/optimization-remarks-dir/Makefile
156156
run-make/output-filename-conflicts-with-directory/Makefile
157157
run-make/output-filename-overwrites-input/Makefile
158158
run-make/output-type-permutations/Makefile
159-
run-make/output-with-hyphens/Makefile
160159
run-make/override-aliased-flags/Makefile
161160
run-make/overwrite-input/Makefile
162161
run-make/panic-abort-eh_frame/Makefile

tests/run-make/inaccessible-temp-dir/rmake.rs

-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,4 @@ fn main() {
3838
.assert_stderr_contains(
3939
"failed to find or create the directory specified by `--temps-dir`",
4040
);
41-
42-
perms.set_mode(0o666); // Unlock the directory, so that compiletest can delete it.
43-
fs_wrapper::set_permissions("inaccessible", perms);
4441
}

tests/run-make/output-with-hyphens/Makefile

-8
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Rust files with hyphens in their filename should
2+
// not result in compiled libraries keeping that hyphen -
3+
// it should become an underscore. Only bin executables
4+
// should keep the hyphen. This test ensures that this rule
5+
// remains enforced.
6+
// See https://github.com/rust-lang/rust/pull/23786
7+
8+
//@ ignore-cross-compile
9+
10+
use run_make_support::{path, rustc};
11+
12+
fn main() {
13+
rustc().input("foo-bar.rs").crate_type("bin").run();
14+
assert!(path(bin_name("foo-bar")).exists());
15+
rustc().input("foo-bar.rs").crate_type("lib").run();
16+
assert!(path(bin_name("libfoo_bar.rlib")).exists());
17+
}

tests/run-make/parallel-rustc-no-overwrite/rmake.rs

+12-10
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,19 @@
66
// See https://github.com/rust-lang/rust/pull/83846
77

88
use run_make_support::{fs_wrapper, rustc};
9+
use std::sync::{Arc, Barrier};
910
use std::thread;
1011

1112
fn main() {
12-
fs_wrapper::create_file("lib.rs");
13-
let handle1 = thread::spawn(move || {
14-
rustc().crate_type("lib").arg("-Ztemps-dir=temp1").input("lib.rs");
15-
});
16-
17-
let handle2 = thread::spawn(move || {
18-
rustc().crate_type("staticlib").arg("-Ztemps-dir=temp2").input("lib.rs");
19-
});
20-
handle1.join().expect("lib thread panicked");
21-
handle2.join().expect("staticlib thread panicked");
13+
let barrier = Arc::new(Barrier::new(2));
14+
let handle = {
15+
let barrier = Arc::clone(&barrier);
16+
thread::spawn(move || {
17+
barrier.wait();
18+
rustc().crate_type("lib").arg("-Ztemps-dir=temp1").input("lib.rs");
19+
})
20+
};
21+
barrier.wait();
22+
rustc().crate_type("staticlib").arg("-Ztemps-dir=temp2").input("lib.rs");
23+
handle.join().expect("lib thread panicked");
2224
}

0 commit comments

Comments
 (0)