Skip to content

Commit c9cb328

Browse files
committed
Address review comments
1 parent 4b0842f commit c9cb328

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

src/tools/compiletest/src/runtest.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3463,7 +3463,7 @@ impl<'test> TestCx<'test> {
34633463
// to the `rmake_out` directory.
34643464
for path in walkdir::WalkDir::new(&self.testpaths.file).min_depth(1) {
34653465
let path = path.unwrap().path().to_path_buf();
3466-
if path.file_name().map(|s| s != OsStr::new("rmake.rs")).unwrap_or(false) {
3466+
if path.file_name().is_some_and(|s| s != "rmake.rs") {
34673467
let target = rmake_out_dir.join(path.strip_prefix(&self.testpaths.file).unwrap());
34683468
if path.is_dir() {
34693469
copy_dir_all(&path, target).unwrap();

tests/run-make/c-link-to-rust-dylib/rmake.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fn main() {
2121
run("bar");
2222

2323
let expected_extension = dynamic_lib_extension();
24-
read_dir(std::env::current_dir().unwrap(), |path| {
24+
read_dir(cwd(), |path| {
2525
if path.is_file()
2626
&& path.extension().is_some_and(|ext| ext == expected_extension)
2727
&& path.file_name().and_then(|name| name.to_str()).is_some_and(|name| {

tests/run-make/const-prop-lint/rmake.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
use std::fs;
44

5-
use run_make_support::rustc;
5+
use run_make_support::{cwd, rustc};
66

77
fn main() {
88
rustc().input("input.rs").run_fail_assert_exit_code(1);
99

10-
for entry in fs::read_dir(std::env::current_dir().unwrap()).unwrap() {
10+
for entry in fs::read_dir(cwd()).unwrap() {
1111
let entry = entry.unwrap();
1212
let path = entry.path();
1313

tests/run-make/notify-all-emit-artifacts/rmake.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// See <https://internals.rust-lang.org/t/easier-access-to-files-generated-by-emit-foo/20477>
77
extern crate run_make_support;
88

9-
use run_make_support::rustc;
9+
use run_make_support::{cwd, rustc};
1010

1111
fn main() {
1212
// With single codegen unit files are renamed to match the source file name
@@ -17,7 +17,7 @@ fn main() {
1717
.codegen_units(1)
1818
.json("artifacts")
1919
.error_format("json")
20-
.incremental(&std::env::current_dir().unwrap())
20+
.incremental(cwd())
2121
.run();
2222
let stderr = String::from_utf8_lossy(&output.stderr);
2323
for file in &["lib.o", "lib.ll", "lib.bc", "lib.s"] {
@@ -33,7 +33,7 @@ fn main() {
3333
.codegen_units(2)
3434
.json("artifacts")
3535
.error_format("json")
36-
.incremental(&std::env::current_dir().unwrap())
36+
.incremental(cwd())
3737
.run();
3838
let stderr = String::from_utf8_lossy(&output.stderr);
3939
for file in &["rcgu.o", "rcgu.ll", "rcgu.bc", "rcgu.s"] {

tests/run-make/rustdoc-scrape-examples-macros/rmake.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ ignore-cross-compile
22

3-
use run_make_support::{htmldocck, rustc, rustdoc};
3+
use run_make_support::{htmldocck, rustc, rustdoc, rust_lib_name};
44

55
fn main() {
66
let out_dir = "rustdoc";
@@ -40,7 +40,7 @@ fn main() {
4040
.crate_name("ex")
4141
.crate_type("bin")
4242
.output(&out_dir)
43-
.extern_(crate_name, format!("lib{crate_name}.rlib"))
43+
.extern_(crate_name, rust_lib_name(crate_name))
4444
.extern_(proc_crate_name, dylib_name.trim())
4545
.arg("-Zunstable-options")
4646
.arg("--scrape-examples-output-path")

0 commit comments

Comments
 (0)