Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obk
Remove `SymbolStr` This was originally proposed in https://github.com/rust-lang/rust/pull/74554#discussion_r466203544. 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`
This commit is contained in:
commit
c5d0023afb
@ -33,7 +33,7 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
|
||||
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
|
||||
|
@ -17,7 +17,7 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
|
||||
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 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
|
||||
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);
|
||||
|
@ -88,7 +88,7 @@ impl<'a, 'gcc, 'tcx> IntrinsicCallMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
|
||||
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);
|
||||
|
@ -52,7 +52,7 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(bx: &mut Builder<'a, 'gcc, 'tcx>,
|
||||
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");
|
||||
|
Loading…
x
Reference in New Issue
Block a user