1
Fork 0

Rollup merge of #123188 - klensy:clippy-me2, r=Nilstrieb

compiler: fix few unused_peekable and needless_pass_by_ref_mut clippy lints

This fixes few instances of `unused_peekable` and `needless_pass_by_ref_mut`. While i expected to fix more warnings, `needless_pass_by_ref_mut` produced too much for one PR, so i stopped here.

Better reviewed commit by commit, as fixes splitted by chunks.
This commit is contained in:
Matthias Krüger 2024-03-29 15:17:11 +01:00 committed by GitHub
commit 8d820c0c47
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
40 changed files with 111 additions and 120 deletions

View file

@ -1226,7 +1226,7 @@ fn create_coroutine_drop_shim<'tcx>(
tcx: TyCtxt<'tcx>,
transform: &TransformVisitor<'tcx>,
coroutine_ty: Ty<'tcx>,
body: &mut Body<'tcx>,
body: &Body<'tcx>,
drop_clean: BasicBlock,
) -> Body<'tcx> {
let mut body = body.clone();

View file

@ -84,7 +84,7 @@ impl<'tcx> MirPass<'tcx> for RenameReturnPlace {
///
/// If the MIR fulfills both these conditions, this function returns the `Local` that is assigned
/// to the return place along all possible paths through the control-flow graph.
fn local_eligible_for_nrvo(body: &mut mir::Body<'_>) -> Option<Local> {
fn local_eligible_for_nrvo(body: &mir::Body<'_>) -> Option<Local> {
if IsReturnPlaceRead::run(body) {
return None;
}
@ -118,10 +118,7 @@ fn local_eligible_for_nrvo(body: &mut mir::Body<'_>) -> Option<Local> {
copied_to_return_place
}
fn find_local_assigned_to_return_place(
start: BasicBlock,
body: &mut mir::Body<'_>,
) -> Option<Local> {
fn find_local_assigned_to_return_place(start: BasicBlock, body: &mir::Body<'_>) -> Option<Local> {
let mut block = start;
let mut seen = BitSet::new_empty(body.basic_blocks.len());