Remove unnecessary sigils around Symbol::as_str() calls.

This commit is contained in:
Nicholas Nethercote 2021-12-15 14:39:23 +11:00
parent 8cddcd39ba
commit 056d48a2c9
104 changed files with 189 additions and 192 deletions

View file

@ -48,7 +48,7 @@ impl Command {
}
pub fn sym_arg(&mut self, arg: Symbol) -> &mut Command {
self.arg(&*arg.as_str());
self.arg(arg.as_str());
self
}

View file

@ -88,7 +88,7 @@ pub fn link_binary<'a, B: ArchiveBuilder<'a>>(
sess,
crate_type,
outputs,
&codegen_results.crate_info.local_crate_name.as_str(),
codegen_results.crate_info.local_crate_name.as_str(),
);
match crate_type {
CrateType::Rlib => {

View file

@ -672,7 +672,7 @@ pub fn codegen_crate<B: ExtraBackendMethods>(
}
let cgu_reuse = cgu_reuse[i];
tcx.sess.cgu_reuse_tracker.set_actual_reuse(&cgu.name().as_str(), cgu_reuse);
tcx.sess.cgu_reuse_tracker.set_actual_reuse(cgu.name().as_str(), cgu_reuse);
match cgu_reuse {
CguReuse::No => {

View file

@ -516,7 +516,7 @@ fn push_unqualified_item_name(
) {
match disambiguated_data.data {
DefPathData::CrateRoot => {
output.push_str(&tcx.crate_name(def_id.krate).as_str());
output.push_str(tcx.crate_name(def_id.krate).as_str());
}
DefPathData::ClosureExpr if tcx.generator_kind(def_id).is_some() => {
// Generators look like closures, but we want to treat them differently
@ -529,7 +529,7 @@ fn push_unqualified_item_name(
}
_ => match disambiguated_data.data.name() {
DefPathDataName::Named(name) => {
output.push_str(&name.as_str());
output.push_str(name.as_str());
}
DefPathDataName::Anon { namespace } => {
if cpp_like_names(tcx) {

View file

@ -68,7 +68,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
let arg_tys = sig.inputs();
let ret_ty = sig.output();
let name = bx.tcx().item_name(def_id);
let name_str = &*name.as_str();
let name_str = name.as_str();
let llret_ty = bx.backend_type(bx.layout_of(ret_ty));
let result = PlaceRef::new_sized(llresult, fn_abi.ret.layout);
@ -375,7 +375,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
use crate::common::AtomicOrdering::*;
use crate::common::{AtomicRmwBinOp, SynchronizationScope};
let split: Vec<&str> = name_str.split('_').collect();
let split: Vec<_> = name_str.split('_').collect();
let is_cxchg = split[1] == "cxchg" || split[1] == "cxchgweak";
let (order, failorder) = match split.len() {