Skip to content

Commit 84577c8

Browse files
committed
Don't pass &mut where immutable reference (&) is sufficient (clippy::unnecessary_mut_passed)
1 parent 8ba92d9 commit 84577c8

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/librustc_infer/traits/auto_trait.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ impl<'tcx> AutoTraitFinder<'tcx> {
150150
// SelectionContext to return it back to us.
151151

152152
let (new_env, user_env) = match self.evaluate_predicates(
153-
&mut infcx,
153+
&infcx,
154154
trait_did,
155155
ty,
156156
orig_env,

src/librustc_mir/dataflow/generic/visitor.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,20 @@ pub fn visit_results<F>(
2222
let loc = Location { block, statement_index };
2323

2424
results.reconstruct_before_statement_effect(&mut state, stmt, loc);
25-
vis.visit_statement(&mut state, stmt, loc);
25+
vis.visit_statement(&state, stmt, loc);
2626

2727
results.reconstruct_statement_effect(&mut state, stmt, loc);
28-
vis.visit_statement_exit(&mut state, stmt, loc);
28+
vis.visit_statement_exit(&state, stmt, loc);
2929
}
3030

3131
let loc = body.terminator_loc(block);
3232
let term = block_data.terminator();
3333

3434
results.reconstruct_before_terminator_effect(&mut state, term, loc);
35-
vis.visit_terminator(&mut state, term, loc);
35+
vis.visit_terminator(&state, term, loc);
3636

3737
results.reconstruct_terminator_effect(&mut state, term, loc);
38-
vis.visit_terminator_exit(&mut state, term, loc);
38+
vis.visit_terminator_exit(&state, term, loc);
3939
}
4040
}
4141

src/librustc_typeck/check/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -737,8 +737,8 @@ impl ItemLikeVisitor<'tcx> for CheckItemTypesVisitor<'tcx> {
737737
}
738738

739739
pub fn check_wf_new(tcx: TyCtxt<'_>) {
740-
let mut visit = wfcheck::CheckTypeWellFormedVisitor::new(tcx);
741-
tcx.hir().krate().par_visit_all_item_likes(&mut visit);
740+
let visit = wfcheck::CheckTypeWellFormedVisitor::new(tcx);
741+
tcx.hir().krate().par_visit_all_item_likes(&visit);
742742
}
743743

744744
fn check_mod_item_types(tcx: TyCtxt<'_>, module_def_id: DefId) {

0 commit comments

Comments
 (0)