diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-03-29 15:17:11 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-29 15:17:11 +0100 |
| commit | 8d820c0c47ed2be6897859c4eeb7679e4c083ac4 (patch) | |
| tree | 7e52fe5b849c58e8cd3b02feb3586f25097fec77 /compiler/rustc_mir_transform/src | |
| parent | a18da0088e8f1dbefd55e8974d8eae45c8bce80d (diff) | |
| parent | 8245718503f24a0a316c6603195b94be23f4fda4 (diff) | |
| download | rust-8d820c0c47ed2be6897859c4eeb7679e4c083ac4.tar.gz rust-8d820c0c47ed2be6897859c4eeb7679e4c083ac4.zip | |
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.
Diffstat (limited to 'compiler/rustc_mir_transform/src')
| -rw-r--r-- | compiler/rustc_mir_transform/src/coroutine.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_mir_transform/src/nrvo.rs | 7 |
2 files changed, 3 insertions, 6 deletions
diff --git a/compiler/rustc_mir_transform/src/coroutine.rs b/compiler/rustc_mir_transform/src/coroutine.rs index f0a13f66555..c3f175f150d 100644 --- a/compiler/rustc_mir_transform/src/coroutine.rs +++ b/compiler/rustc_mir_transform/src/coroutine.rs @@ -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(); diff --git a/compiler/rustc_mir_transform/src/nrvo.rs b/compiler/rustc_mir_transform/src/nrvo.rs index c3a92911bbf..232c290e0fb 100644 --- a/compiler/rustc_mir_transform/src/nrvo.rs +++ b/compiler/rustc_mir_transform/src/nrvo.rs @@ -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()); |
