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:
@@ -97,7 +97,7 @@ pub(super) trait GoalKind<'tcx>:
|
||||
bug!("expected object type in `consider_object_bound_candidate`");
|
||||
};
|
||||
ecx.add_goals(structural_traits::predicates_for_object_candidate(
|
||||
&ecx,
|
||||
ecx,
|
||||
goal.param_env,
|
||||
goal.predicate.trait_ref(tcx),
|
||||
bounds,
|
||||
|
||||
@@ -50,14 +50,14 @@ pub(in crate::solve) fn instantiate_constituent_tys_for_auto_trait<'tcx>(
|
||||
|
||||
ty::Array(element_ty, _) | ty::Slice(element_ty) => Ok(vec![element_ty]),
|
||||
|
||||
ty::Tuple(ref tys) => {
|
||||
ty::Tuple(tys) => {
|
||||
// (T1, ..., Tn) -- meets any bound that all of T1...Tn meet
|
||||
Ok(tys.iter().collect())
|
||||
}
|
||||
|
||||
ty::Closure(_, ref args) => Ok(vec![args.as_closure().tupled_upvars_ty()]),
|
||||
ty::Closure(_, args) => Ok(vec![args.as_closure().tupled_upvars_ty()]),
|
||||
|
||||
ty::Coroutine(_, ref args, _) => {
|
||||
ty::Coroutine(_, args, _) => {
|
||||
let coroutine_args = args.as_coroutine();
|
||||
Ok(vec![coroutine_args.tupled_upvars_ty(), coroutine_args.witness()])
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ impl<'a, 'tcx> InspectGoal<'a, 'tcx> {
|
||||
warn!("unexpected root evaluation: {:?}", self.evaluation);
|
||||
return vec![];
|
||||
}
|
||||
inspect::CanonicalGoalEvaluationKind::Evaluation { ref revisions } => {
|
||||
inspect::CanonicalGoalEvaluationKind::Evaluation { revisions } => {
|
||||
if let Some(last) = revisions.last() {
|
||||
last
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user