Skip to content

Commit 00aa3e6

Browse files
authored
Rollup merge of #82214 - est31:no_to_string, r=oli-obk
Remove redundant to_string calls
2 parents 199095a + 0036707 commit 00aa3e6

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

compiler/rustc_codegen_llvm/src/allocator.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ pub(crate) unsafe fn codegen(
9393
let args = [usize, usize]; // size, align
9494

9595
let ty = llvm::LLVMFunctionType(void, args.as_ptr(), args.len() as c_uint, False);
96-
let name = "__rust_alloc_error_handler".to_string();
96+
let name = "__rust_alloc_error_handler";
9797
let llfn = llvm::LLVMRustGetOrInsertFunction(llmod, name.as_ptr().cast(), name.len(), ty);
9898
// -> ! DIFlagNoReturn
9999
llvm::Attribute::NoReturn.apply_llfn(llvm::AttributePlace::Function, llfn);

compiler/rustc_codegen_ssa/src/back/link.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -181,16 +181,16 @@ fn get_linker(
181181
let original_path = tool.path();
182182
if let Some(ref root_lib_path) = original_path.ancestors().nth(4) {
183183
let arch = match t.arch.as_str() {
184-
"x86_64" => Some("x64".to_string()),
185-
"x86" => Some("x86".to_string()),
186-
"aarch64" => Some("arm64".to_string()),
187-
"arm" => Some("arm".to_string()),
184+
"x86_64" => Some("x64"),
185+
"x86" => Some("x86"),
186+
"aarch64" => Some("arm64"),
187+
"arm" => Some("arm"),
188188
_ => None,
189189
};
190190
if let Some(ref a) = arch {
191191
// FIXME: Move this to `fn linker_with_args`.
192192
let mut arg = OsString::from("/LIBPATH:");
193-
arg.push(format!("{}\\lib\\{}\\store", root_lib_path.display(), a.to_string()));
193+
arg.push(format!("{}\\lib\\{}\\store", root_lib_path.display(), a));
194194
cmd.arg(&arg);
195195
} else {
196196
warn!("arch is not supported");

0 commit comments

Comments
 (0)