Skip to content

Commit c5d0023

Browse files
committed
Auto merge of rust-lang#91957 - nnethercote:rm-SymbolStr, r=oli-obk
Remove `SymbolStr` This was originally proposed in rust-lang#74554 (comment). As well as removing the icky `SymbolStr` type, it allows the removal of a lot of `&` and `*` occurrences. Best reviewed one commit at a time. r? `@oli-obk`
2 parents f87a8f8 + bba8b97 commit c5d0023

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/common.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
3333
return value;
3434
}
3535

36-
let global = self.global_string(&*symbol.as_str());
36+
let global = self.global_string(symbol.as_str());
3737

3838
self.const_cstr_cache.borrow_mut().insert(symbol, global);
3939
global

src/declare.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
1717
global.set_tls_model(self.tls_model);
1818
}
1919
if let Some(link_section) = link_section {
20-
global.set_link_section(&link_section.as_str());
20+
global.set_link_section(link_section.as_str());
2121
}
2222
global
2323
}
@@ -53,7 +53,7 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
5353
global.set_tls_model(self.tls_model);
5454
}
5555
if let Some(link_section) = link_section {
56-
global.set_link_section(&link_section.as_str());
56+
global.set_link_section(link_section.as_str());
5757
}
5858
let global_address = global.get_address(None);
5959
self.globals.borrow_mut().insert(name.to_string(), global_address);

src/intrinsic/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ impl<'a, 'gcc, 'tcx> IntrinsicCallMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
8888
let arg_tys = sig.inputs();
8989
let ret_ty = sig.output();
9090
let name = tcx.item_name(def_id);
91-
let name_str = &*name.as_str();
91+
let name_str = name.as_str();
9292

9393
let llret_ty = self.layout_of(ret_ty).gcc_type(self, true);
9494
let result = PlaceRef::new_sized(llresult, fn_abi.ret.layout);

src/intrinsic/simd.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(bx: &mut Builder<'a, 'gcc, 'tcx>,
5252
let sig =
5353
tcx.normalize_erasing_late_bound_regions(ty::ParamEnv::reveal_all(), callee_ty.fn_sig(tcx));
5454
let arg_tys = sig.inputs();
55-
let name_str = &*name.as_str();
55+
let name_str = name.as_str();
5656

5757
// every intrinsic below takes a SIMD vector as its first argument
5858
require_simd!(arg_tys[0], "input");

0 commit comments

Comments
 (0)