about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJakub Beránek <berykubik@gmail.com>2024-06-07 14:07:02 +0200
committerJakub Beránek <berykubik@gmail.com>2024-06-07 14:07:02 +0200
commitc9cb3280f365621d724d4f07a8dc96b325a107c9 (patch)
tree4ff3aba7904249d373c43e7c791daf731d9e2a3c
parent4b0842f3cedc26ba841b6e8fb7314da2048c5ee2 (diff)
downloadrust-c9cb3280f365621d724d4f07a8dc96b325a107c9.tar.gz
rust-c9cb3280f365621d724d4f07a8dc96b325a107c9.zip
Address review comments
-rw-r--r--src/tools/compiletest/src/runtest.rs2
-rw-r--r--tests/run-make/c-link-to-rust-dylib/rmake.rs2
-rw-r--r--tests/run-make/const-prop-lint/rmake.rs4
-rw-r--r--tests/run-make/notify-all-emit-artifacts/rmake.rs6
-rw-r--r--tests/run-make/rustdoc-scrape-examples-macros/rmake.rs4
5 files changed, 9 insertions, 9 deletions
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
index c50dd2d5a99..6d4b50a9238 100644
--- a/src/tools/compiletest/src/runtest.rs
+++ b/src/tools/compiletest/src/runtest.rs
@@ -3463,7 +3463,7 @@ impl<'test> TestCx<'test> {
         // to the `rmake_out` directory.
         for path in walkdir::WalkDir::new(&self.testpaths.file).min_depth(1) {
             let path = path.unwrap().path().to_path_buf();
-            if path.file_name().map(|s| s != OsStr::new("rmake.rs")).unwrap_or(false) {
+            if path.file_name().is_some_and(|s| s != "rmake.rs") {
                 let target = rmake_out_dir.join(path.strip_prefix(&self.testpaths.file).unwrap());
                 if path.is_dir() {
                     copy_dir_all(&path, target).unwrap();
diff --git a/tests/run-make/c-link-to-rust-dylib/rmake.rs b/tests/run-make/c-link-to-rust-dylib/rmake.rs
index 37a326099d2..ec42e88032d 100644
--- a/tests/run-make/c-link-to-rust-dylib/rmake.rs
+++ b/tests/run-make/c-link-to-rust-dylib/rmake.rs
@@ -21,7 +21,7 @@ fn main() {
     run("bar");
 
     let expected_extension = dynamic_lib_extension();
-    read_dir(std::env::current_dir().unwrap(), |path| {
+    read_dir(cwd(), |path| {
         if path.is_file()
             && path.extension().is_some_and(|ext| ext == expected_extension)
             && path.file_name().and_then(|name| name.to_str()).is_some_and(|name| {
diff --git a/tests/run-make/const-prop-lint/rmake.rs b/tests/run-make/const-prop-lint/rmake.rs
index c2d3e1ab136..6d0069a84d7 100644
--- a/tests/run-make/const-prop-lint/rmake.rs
+++ b/tests/run-make/const-prop-lint/rmake.rs
@@ -2,12 +2,12 @@
 
 use std::fs;
 
-use run_make_support::rustc;
+use run_make_support::{cwd, rustc};
 
 fn main() {
     rustc().input("input.rs").run_fail_assert_exit_code(1);
 
-    for entry in fs::read_dir(std::env::current_dir().unwrap()).unwrap() {
+    for entry in fs::read_dir(cwd()).unwrap() {
         let entry = entry.unwrap();
         let path = entry.path();
 
diff --git a/tests/run-make/notify-all-emit-artifacts/rmake.rs b/tests/run-make/notify-all-emit-artifacts/rmake.rs
index 6d966793c35..1c2e08ca8f5 100644
--- a/tests/run-make/notify-all-emit-artifacts/rmake.rs
+++ b/tests/run-make/notify-all-emit-artifacts/rmake.rs
@@ -6,7 +6,7 @@
 // See <https://internals.rust-lang.org/t/easier-access-to-files-generated-by-emit-foo/20477>
 extern crate run_make_support;
 
-use run_make_support::rustc;
+use run_make_support::{cwd, rustc};
 
 fn main() {
     // With single codegen unit files are renamed to match the source file name
@@ -17,7 +17,7 @@ fn main() {
             .codegen_units(1)
             .json("artifacts")
             .error_format("json")
-            .incremental(&std::env::current_dir().unwrap())
+            .incremental(cwd())
             .run();
         let stderr = String::from_utf8_lossy(&output.stderr);
         for file in &["lib.o", "lib.ll", "lib.bc", "lib.s"] {
@@ -33,7 +33,7 @@ fn main() {
             .codegen_units(2)
             .json("artifacts")
             .error_format("json")
-            .incremental(&std::env::current_dir().unwrap())
+            .incremental(cwd())
             .run();
         let stderr = String::from_utf8_lossy(&output.stderr);
         for file in &["rcgu.o", "rcgu.ll", "rcgu.bc", "rcgu.s"] {
diff --git a/tests/run-make/rustdoc-scrape-examples-macros/rmake.rs b/tests/run-make/rustdoc-scrape-examples-macros/rmake.rs
index 2daaab76e54..c99112b6e5f 100644
--- a/tests/run-make/rustdoc-scrape-examples-macros/rmake.rs
+++ b/tests/run-make/rustdoc-scrape-examples-macros/rmake.rs
@@ -1,6 +1,6 @@
 //@ ignore-cross-compile
 
-use run_make_support::{htmldocck, rustc, rustdoc};
+use run_make_support::{htmldocck, rustc, rustdoc, rust_lib_name};
 
 fn main() {
     let out_dir = "rustdoc";
@@ -40,7 +40,7 @@ fn main() {
         .crate_name("ex")
         .crate_type("bin")
         .output(&out_dir)
-        .extern_(crate_name, format!("lib{crate_name}.rlib"))
+        .extern_(crate_name, rust_lib_name(crate_name))
         .extern_(proc_crate_name, dylib_name.trim())
         .arg("-Zunstable-options")
         .arg("--scrape-examples-output-path")