about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm
diff options
context:
space:
mode:
authorTobias Bucher <tobiasbucher5991@gmail.com>2024-05-20 23:17:11 +0200
committerTobias Bucher <tobiasbucher5991@gmail.com>2024-05-20 23:17:11 +0200
commitfa1b7f2d7865e8fd0165899f8ac2a01aca121e39 (patch)
tree0225a1a04deae5a6b51eb2f27d78efd845945d7d /compiler/rustc_codegen_llvm
parent474bee7bf540db9344ca975298b6c1646a74b772 (diff)
downloadrust-fa1b7f2d7865e8fd0165899f8ac2a01aca121e39.tar.gz
rust-fa1b7f2d7865e8fd0165899f8ac2a01aca121e39.zip
Remove some `Path::to_str` from `rustc_codegen_llvm`
Unnecessary panic paths when there's a better option.
Diffstat (limited to 'compiler/rustc_codegen_llvm')
-rw-r--r--compiler/rustc_codegen_llvm/src/back/archive.rs29
1 files changed, 14 insertions, 15 deletions
diff --git a/compiler/rustc_codegen_llvm/src/back/archive.rs b/compiler/rustc_codegen_llvm/src/back/archive.rs
index d4a3e39cef7..c304c0cbd3b 100644
--- a/compiler/rustc_codegen_llvm/src/back/archive.rs
+++ b/compiler/rustc_codegen_llvm/src/back/archive.rs
@@ -200,21 +200,20 @@ impl ArchiveBuilderBuilder for LlvmArchiveBuilderBuilder {
                 _ => panic!("unsupported arch {}", sess.target.arch),
             };
             let mut dlltool_cmd = std::process::Command::new(&dlltool);
-            dlltool_cmd.args([
-                "-d",
-                def_file_path.to_str().unwrap(),
-                "-D",
-                lib_name,
-                "-l",
-                output_path.to_str().unwrap(),
-                "-m",
-                dlltool_target_arch,
-                "-f",
-                dlltool_target_bitness,
-                "--no-leading-underscore",
-                "--temp-prefix",
-                temp_prefix.to_str().unwrap(),
-            ]);
+            dlltool_cmd
+                .arg("-d")
+                .arg(def_file_path)
+                .arg("-D")
+                .arg(lib_name)
+                .arg("-l")
+                .arg(&output_path)
+                .arg("-m")
+                .arg(dlltool_target_arch)
+                .arg("-f")
+                .arg(dlltool_target_bitness)
+                .arg("--no-leading-underscore")
+                .arg("--temp-prefix")
+                .arg(temp_prefix);
 
             match dlltool_cmd.output() {
                 Err(e) => {