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:
@@ -48,9 +48,7 @@ pub fn trivial_dropck_outlives<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) -> bool {
|
||||
// (T1..Tn) and closures have same properties as T1..Tn --
|
||||
// check if *all* of them are trivial.
|
||||
ty::Tuple(tys) => tys.iter().all(|t| trivial_dropck_outlives(tcx, t)),
|
||||
ty::Closure(_, ref args) => {
|
||||
trivial_dropck_outlives(tcx, args.as_closure().tupled_upvars_ty())
|
||||
}
|
||||
ty::Closure(_, args) => trivial_dropck_outlives(tcx, args.as_closure().tupled_upvars_ty()),
|
||||
|
||||
ty::Adt(def, _) => {
|
||||
if Some(def.did()) == tcx.lang_items().manually_drop() {
|
||||
|
||||
@@ -108,7 +108,7 @@ impl<'tcx> InferCtxtExt<'tcx> for InferCtxt<'tcx> {
|
||||
match self.evaluate_obligation(obligation) {
|
||||
Ok(result) => result,
|
||||
Err(OverflowError::Canonical) => {
|
||||
let mut selcx = SelectionContext::new(&self);
|
||||
let mut selcx = SelectionContext::new(self);
|
||||
selcx.evaluate_root_obligation(obligation).unwrap_or_else(|r| match r {
|
||||
OverflowError::Canonical => {
|
||||
span_bug!(
|
||||
|
||||
Reference in New Issue
Block a user