Fix clippy::needless_borrow
in the compiler
`x clippy compiler -Aclippy::all -Wclippy::needless_borrow --fix`. Then I had to remove a few unnecessary parens and muts that were exposed now.
This commit is contained in:
parent
0ff8610964
commit
21a870515b
304 changed files with 1101 additions and 1174 deletions
|
@ -436,12 +436,12 @@ fn merge_codegen_units<'tcx>(
|
|||
for cgu in codegen_units.iter_mut() {
|
||||
if let Some(new_cgu_name) = new_cgu_names.get(&cgu.name()) {
|
||||
if cx.tcx.sess.opts.unstable_opts.human_readable_cgu_names {
|
||||
cgu.set_name(Symbol::intern(&new_cgu_name));
|
||||
cgu.set_name(Symbol::intern(new_cgu_name));
|
||||
} else {
|
||||
// If we don't require CGU names to be human-readable,
|
||||
// we use a fixed length hash of the composite CGU name
|
||||
// instead.
|
||||
let new_cgu_name = CodegenUnit::mangle_name(&new_cgu_name);
|
||||
let new_cgu_name = CodegenUnit::mangle_name(new_cgu_name);
|
||||
cgu.set_name(Symbol::intern(&new_cgu_name));
|
||||
}
|
||||
}
|
||||
|
@ -1140,7 +1140,7 @@ fn collect_and_partition_mono_items(tcx: TyCtxt<'_>, (): ()) -> (&DefIdSet, &[Co
|
|||
// Output monomorphization stats per def_id
|
||||
if let SwitchWithOptPath::Enabled(ref path) = tcx.sess.opts.unstable_opts.dump_mono_stats {
|
||||
if let Err(err) =
|
||||
dump_mono_items_stats(tcx, &codegen_units, path, tcx.crate_name(LOCAL_CRATE))
|
||||
dump_mono_items_stats(tcx, codegen_units, path, tcx.crate_name(LOCAL_CRATE))
|
||||
{
|
||||
tcx.sess.emit_fatal(CouldntDumpMonoStats { error: err.to_string() });
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue