Fix clippy::needless_borrow in the compiler

`x clippy compiler -Aclippy::all -Wclippy::needless_borrow --fix`.

Then I had to remove a few unnecessary parens and muts that were exposed
now.
This commit is contained in:
Nilstrieb 2023-11-21 20:07:32 +01:00
parent 0ff8610964
commit 21a870515b
304 changed files with 1101 additions and 1174 deletions

View file

@ -95,7 +95,7 @@ impl<'tcx> MirPass<'tcx> for JumpThreading {
let cost = CostChecker::new(tcx, param_env, None, body);
let mut state = State::new(ConditionSet::default(), &finder.map);
let mut state = State::new(ConditionSet::default(), finder.map);
let conds = if let Some((value, then, else_)) = targets.as_static_if() {
let Some(value) = ScalarInt::try_from_uint(value, discr_layout.size) else {
@ -112,7 +112,7 @@ impl<'tcx> MirPass<'tcx> for JumpThreading {
}))
};
let conds = ConditionSet(conds);
state.insert_value_idx(discr, conds, &finder.map);
state.insert_value_idx(discr, conds, finder.map);
finder.find_opportunity(bb, state, cost, 0);
}