and more
warning: this argument is a mutable reference, but not used mutably --> compiler\rustc_mir_transform\src\coroutine.rs:1229:11 | 1229 | body: &mut Body<'tcx>, | ^^^^^^^^^^^^^^^ help: consider changing to: `&Body<'tcx>` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut warning: this argument is a mutable reference, but not used mutably --> compiler\rustc_mir_transform\src\nrvo.rs:123:11 | 123 | body: &mut mir::Body<'_>, | ^^^^^^^^^^^^^^^^^^ help: consider changing to: `&mir::Body<'_>` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut warning: this argument is a mutable reference, but not used mutably --> compiler\rustc_mir_transform\src\nrvo.rs:87:34 | 87 | fn local_eligible_for_nrvo(body: &mut mir::Body<'_>) -> Option<Local> { | ^^^^^^^^^^^^^^^^^^ help: consider changing to: `&mir::Body<'_>` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut
This commit is contained in:
parent
9a6b3dfc06
commit
8245718503
@ -1595,10 +1595,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
|||||||
/// [`Switch`]: TestKind::Switch
|
/// [`Switch`]: TestKind::Switch
|
||||||
/// [`SwitchInt`]: TestKind::SwitchInt
|
/// [`SwitchInt`]: TestKind::SwitchInt
|
||||||
/// [`Range`]: TestKind::Range
|
/// [`Range`]: TestKind::Range
|
||||||
fn pick_test(
|
fn pick_test(&mut self, candidates: &[&mut Candidate<'_, 'tcx>]) -> (Place<'tcx>, Test<'tcx>) {
|
||||||
&mut self,
|
|
||||||
candidates: &mut [&mut Candidate<'_, 'tcx>],
|
|
||||||
) -> (Place<'tcx>, Test<'tcx>) {
|
|
||||||
// Extract the match-pair from the highest priority candidate
|
// Extract the match-pair from the highest priority candidate
|
||||||
let match_pair = &candidates.first().unwrap().match_pairs[0];
|
let match_pair = &candidates.first().unwrap().match_pairs[0];
|
||||||
let test = self.test(match_pair);
|
let test = self.test(match_pair);
|
||||||
|
@ -1226,7 +1226,7 @@ fn create_coroutine_drop_shim<'tcx>(
|
|||||||
tcx: TyCtxt<'tcx>,
|
tcx: TyCtxt<'tcx>,
|
||||||
transform: &TransformVisitor<'tcx>,
|
transform: &TransformVisitor<'tcx>,
|
||||||
coroutine_ty: Ty<'tcx>,
|
coroutine_ty: Ty<'tcx>,
|
||||||
body: &mut Body<'tcx>,
|
body: &Body<'tcx>,
|
||||||
drop_clean: BasicBlock,
|
drop_clean: BasicBlock,
|
||||||
) -> Body<'tcx> {
|
) -> Body<'tcx> {
|
||||||
let mut body = body.clone();
|
let mut body = body.clone();
|
||||||
|
@ -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
|
/// 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.
|
/// 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) {
|
if IsReturnPlaceRead::run(body) {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
@ -118,10 +118,7 @@ fn local_eligible_for_nrvo(body: &mut mir::Body<'_>) -> Option<Local> {
|
|||||||
copied_to_return_place
|
copied_to_return_place
|
||||||
}
|
}
|
||||||
|
|
||||||
fn find_local_assigned_to_return_place(
|
fn find_local_assigned_to_return_place(start: BasicBlock, body: &mir::Body<'_>) -> Option<Local> {
|
||||||
start: BasicBlock,
|
|
||||||
body: &mut mir::Body<'_>,
|
|
||||||
) -> Option<Local> {
|
|
||||||
let mut block = start;
|
let mut block = start;
|
||||||
let mut seen = BitSet::new_empty(body.basic_blocks.len());
|
let mut seen = BitSet::new_empty(body.basic_blocks.len());
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user