Skip to content

Commit 63fa01e

Browse files
authored
Rollup merge of rust-lang#125346 - tbu-:pr_rm_path_to_str, r=wesleywiser
Remove some `Path::to_str` from `rustc_codegen_llvm` Unnecessary panic paths when there's a better option.
2 parents 73bb47e + fa1b7f2 commit 63fa01e

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

Diff for: compiler/rustc_codegen_llvm/src/back/archive.rs

+14-15
Original file line numberDiff line numberDiff line change
@@ -200,21 +200,20 @@ impl ArchiveBuilderBuilder for LlvmArchiveBuilderBuilder {
200200
_ => panic!("unsupported arch {}", sess.target.arch),
201201
};
202202
let mut dlltool_cmd = std::process::Command::new(&dlltool);
203-
dlltool_cmd.args([
204-
"-d",
205-
def_file_path.to_str().unwrap(),
206-
"-D",
207-
lib_name,
208-
"-l",
209-
output_path.to_str().unwrap(),
210-
"-m",
211-
dlltool_target_arch,
212-
"-f",
213-
dlltool_target_bitness,
214-
"--no-leading-underscore",
215-
"--temp-prefix",
216-
temp_prefix.to_str().unwrap(),
217-
]);
203+
dlltool_cmd
204+
.arg("-d")
205+
.arg(def_file_path)
206+
.arg("-D")
207+
.arg(lib_name)
208+
.arg("-l")
209+
.arg(&output_path)
210+
.arg("-m")
211+
.arg(dlltool_target_arch)
212+
.arg("-f")
213+
.arg(dlltool_target_bitness)
214+
.arg("--no-leading-underscore")
215+
.arg("--temp-prefix")
216+
.arg(temp_prefix);
218217

219218
match dlltool_cmd.output() {
220219
Err(e) => {

0 commit comments

Comments
 (0)