Auto merge of #87449 - matthiaskrgr:clippyy_v2, r=nagisa
more clippy::complexity fixes (also a couple of clippy::perf fixes)
This commit is contained in:
@@ -255,7 +255,7 @@ impl NonConstOp for CellBorrow {
|
||||
);
|
||||
err.span_label(
|
||||
span,
|
||||
format!("this borrow of an interior mutable value may end up in the final value"),
|
||||
"this borrow of an interior mutable value may end up in the final value",
|
||||
);
|
||||
if let hir::ConstContext::Static(_) = ccx.const_kind() {
|
||||
err.help(
|
||||
|
||||
@@ -344,7 +344,7 @@ impl DebugCounters {
|
||||
return if counter_format.id {
|
||||
format!("{}#{}", block_label, id.index())
|
||||
} else {
|
||||
format!("{}", block_label)
|
||||
block_label.to_string()
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -369,7 +369,7 @@ impl DebugCounters {
|
||||
}
|
||||
return format!("({})", self.format_counter_kind(counter_kind));
|
||||
}
|
||||
return format!("{}", self.format_counter_kind(counter_kind));
|
||||
return self.format_counter_kind(counter_kind).to_string();
|
||||
}
|
||||
}
|
||||
format!("#{}", operand.index().to_string())
|
||||
|
||||
@@ -526,8 +526,8 @@ impl TraverseCoverageGraphWithLoops {
|
||||
pub fn new(basic_coverage_blocks: &CoverageGraph) -> Self {
|
||||
let start_bcb = basic_coverage_blocks.start_node();
|
||||
let backedges = find_loop_backedges(basic_coverage_blocks);
|
||||
let mut context_stack = Vec::new();
|
||||
context_stack.push(TraversalContext { loop_backedges: None, worklist: vec![start_bcb] });
|
||||
let context_stack =
|
||||
vec![TraversalContext { loop_backedges: None, worklist: vec![start_bcb] }];
|
||||
// `context_stack` starts with a `TraversalContext` for the main function context (beginning
|
||||
// with the `start` BasicCoverageBlock of the function). New worklists are pushed to the top
|
||||
// of the stack as loops are entered, and popped off of the stack when a loop's worklist is
|
||||
|
||||
@@ -614,8 +614,8 @@ impl Inliner<'tcx> {
|
||||
.vars_and_temps_iter()
|
||||
.map(|local| callee_body.local_decls[local].clone()),
|
||||
);
|
||||
caller_body.source_scopes.extend(callee_body.source_scopes.drain(..));
|
||||
caller_body.var_debug_info.extend(callee_body.var_debug_info.drain(..));
|
||||
caller_body.source_scopes.extend(&mut callee_body.source_scopes.drain(..));
|
||||
caller_body.var_debug_info.append(&mut callee_body.var_debug_info);
|
||||
caller_body.basic_blocks_mut().extend(callee_body.basic_blocks_mut().drain(..));
|
||||
|
||||
caller_body[callsite.block].terminator = Some(Terminator {
|
||||
|
||||
@@ -147,8 +147,8 @@ fn validate_simd_shuffle(tcx: TyCtxt<'tcx>, args: &[Operand<'tcx>], span: Span)
|
||||
match &args[2] {
|
||||
Operand::Constant(_) => {} // all good
|
||||
_ => {
|
||||
let msg = format!("last argument of `simd_shuffle` is required to be a `const` item");
|
||||
tcx.sess.span_err(span, &msg);
|
||||
let msg = "last argument of `simd_shuffle` is required to be a `const` item";
|
||||
tcx.sess.span_err(span, msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user