clippy_utils

Function projection_stack

source
pub(crate) fn projection_stack<'a, 'hir>(
    e: &'a Expr<'hir>,
) -> (Vec<&'a Expr<'hir>>, &'a Expr<'hir>)
Expand description

This method will return tuple of projection stack and root of the expression, used in can_mut_borrow_both.

For example, if e represents the v[0].a.b[x] this method will return a tuple, composed of a Vec containing the Exprs for v[0], v[0].a, v[0].a.b, v[0].a.b[x] and an Expr for root of them, v