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:
bors 2021-12-19 09:31:37 +00:00
commit c5d0023afb
4 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -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);

View File

@ -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);

View File

@ -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");