Skip to content

Commit

Permalink
Rollup merge of rust-lang#125346 - tbu-:pr_rm_path_to_str, r=wesleywiser
Browse files Browse the repository at this point in the history
Remove some `Path::to_str` from `rustc_codegen_llvm`

Unnecessary panic paths when there's a better option.
  • Loading branch information
matthiaskrgr authored May 20, 2024
2 parents 73bb47e + fa1b7f2 commit 63fa01e
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions compiler/rustc_codegen_llvm/src/back/archive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 63fa01e

Please sign in to comment.