@@ -459,10 +459,9 @@ pub fn trait_ref_of_method<'tcx>(cx: &LateContext<'tcx>, owner: OwnerId) -> Opti
459459/// This method will return tuple of projection stack and root of the expression,
460460/// used in `can_mut_borrow_both`.
461461///
462- /// For example, if `e` represents the `v[0].a.b[x]`
463- /// this method will return a tuple, composed of a `Vec`
464- /// containing the `Expr`s for `v[0], v[0].a, v[0].a.b, v[0].a.b[x]`
465- /// and an `Expr` for root of them, `v`
462+ /// For example, if `e` represents the `v[0].a.b[x]` this method will return a tuple, composed of:
463+ /// - a `Vec` containing the `Expr`s for `v[0], v[0].a, v[0].a.b, v[0].a.b[x]`
464+ /// - and an `Expr` for root of them, `v`
466465fn projection_stack < ' a , ' hir > ( mut e : & ' a Expr < ' hir > ) -> ( Vec < & ' a Expr < ' hir > > , & ' a Expr < ' hir > ) {
467466 let mut result = vec ! [ ] ;
468467 let root = loop {
@@ -488,7 +487,8 @@ pub fn expr_custom_deref_adjustment(cx: &LateContext<'_>, e: &Expr<'_>) -> Optio
488487 Adjust :: Deref ( None ) => None ,
489488 _ => Some ( None ) ,
490489 } )
491- . and_then ( |x| x)
490+ // if there were no adjustments to begin with, trivially none of them are of the custom-deref kind
491+ . unwrap_or ( None )
492492}
493493
494494/// Checks if two expressions can be mutably borrowed simultaneously
0 commit comments