From bba8b97b8318f4e6c3323f56fec341946ed68644 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Wed, 15 Dec 2021 14:39:23 +1100 Subject: [PATCH] Remove unnecessary sigils around `Symbol::as_str()` calls. --- src/common.rs | 2 +- src/declare.rs | 4 ++-- src/intrinsic/mod.rs | 2 +- src/intrinsic/simd.rs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/common.rs b/src/common.rs index bda08b653f0..ec542e55681 100644 --- a/src/common.rs +++ b/src/common.rs @@ -33,7 +33,7 @@ fn const_cstr(&self, symbol: Symbol, _null_terminated: bool) -> LValue<'gcc> { return value; } - let global = self.global_string(&*symbol.as_str()); + let global = self.global_string(symbol.as_str()); self.const_cstr_cache.borrow_mut().insert(symbol, global); global diff --git a/src/declare.rs b/src/declare.rs index b79a50d1eee..dbee505a497 100644 --- a/src/declare.rs +++ b/src/declare.rs @@ -17,7 +17,7 @@ pub fn get_or_insert_global(&self, name: &str, ty: Type<'gcc>, is_tls: bool, lin global.set_tls_model(self.tls_model); } if let Some(link_section) = link_section { - global.set_link_section(&link_section.as_str()); + global.set_link_section(link_section.as_str()); } global } @@ -53,7 +53,7 @@ pub fn declare_global(&self, name: &str, ty: Type<'gcc>, is_tls: bool, link_sect global.set_tls_model(self.tls_model); } if let Some(link_section) = link_section { - global.set_link_section(&link_section.as_str()); + global.set_link_section(link_section.as_str()); } let global_address = global.get_address(None); self.globals.borrow_mut().insert(name.to_string(), global_address); diff --git a/src/intrinsic/mod.rs b/src/intrinsic/mod.rs index f3a2382ef32..0782adeb6a1 100644 --- a/src/intrinsic/mod.rs +++ b/src/intrinsic/mod.rs @@ -88,7 +88,7 @@ fn codegen_intrinsic_call(&mut self, instance: Instance<'tcx>, fn_abi: &FnAbi<'t let arg_tys = sig.inputs(); let ret_ty = sig.output(); let name = tcx.item_name(def_id); - let name_str = &*name.as_str(); + let name_str = name.as_str(); let llret_ty = self.layout_of(ret_ty).gcc_type(self, true); let result = PlaceRef::new_sized(llresult, fn_abi.ret.layout); diff --git a/src/intrinsic/simd.rs b/src/intrinsic/simd.rs index 26a42217e4c..aff27f71d91 100644 --- a/src/intrinsic/simd.rs +++ b/src/intrinsic/simd.rs @@ -52,7 +52,7 @@ macro_rules! require_simd { let sig = tcx.normalize_erasing_late_bound_regions(ty::ParamEnv::reveal_all(), callee_ty.fn_sig(tcx)); let arg_tys = sig.inputs(); - let name_str = &*name.as_str(); + let name_str = name.as_str(); // every intrinsic below takes a SIMD vector as its first argument require_simd!(arg_tys[0], "input");