fn walk_adjustment(&mut self, expr: &hir::Expr<'_>) {
        let adjustments = self.mc.tables.expr_adjustments(expr);
        let mut place_with_id = return_if_err!(self.mc.cat_expr_unadjusted(expr));
        for adjustment in adjustments {
            debug!("walk_adjustment expr={:?} adj={:?}", expr, adjustment);
            match adjustment.kind {
                adjustment::Adjust::NeverToAny | adjustment::Adjust::Pointer(_) => {
                    // Creating a closure/fn-pointer or unsizing consumes
                    // the input and stores it into the resulting rvalue.
                    self.delegate_consume(&place_with_id);
                }

                adjustment::Adjust::Deref(None) => {}

                // Autoderefs for overloaded Deref calls in fact reference
                // their receiver. That is, if we have `(*x)` where `x`
                // is of type `Rc<T>`, then this in fact is equivalent to
                // `x.deref()`. Since `deref()` is declared with `&self`,
                // this is an autoref of `x`.
                adjustment::Adjust::Deref(Some(ref deref)) => {
                    let bk = ty::BorrowKind::from_mutbl(deref.mutbl);
                    self.delegate.borrow(&place_with_id, bk);
                }

                adjustment::Adjust::Borrow(ref autoref) => {
                    self.walk_autoref(expr, &place_with_id, autoref);
                }
            }
            place_with_id =
                return_if_err!(self.mc.cat_expr_adjusted(expr, place_with_id, &adjustment));
        }
    }
// Invoke the appropriate delegate calls for anything that gets
// consumed or borrowed as part of the automatic adjustment
// process.
Invoke the appropriate delegate calls for anything that gets
consumed or borrowed as part of the automatic adjustment
process.
Invoke the appropriate delegate calls for anything that gets consumed or borrowed as part of the automatic adjustment process .
fn walk_adjustment(&mut self, expr: &hir::Expr<'_>) {
        let adjustments = self.mc.tables.expr_adjustments(expr);
        let mut place_with_id = return_if_err!(self.mc.cat_expr_unadjusted(expr));
        for adjustment in adjustments {
            debug!("walk_adjustment expr={:?} adj={:?}", expr, adjustment);
            match adjustment.kind {
                adjustment::Adjust::NeverToAny | adjustment::Adjust::Pointer(_) => {
                    // Creating a closure/fn-pointer or unsizing consumes
                    // the input and stores it into the resulting rvalue.
                    self.delegate_consume(&place_with_id);
                }
                adjustment::Adjust::Deref(None) => {}
                // Autoderefs for overloaded Deref calls in fact reference
                // their receiver. That is, if we have `(*x)` where `x`
                // is of type `Rc<T>`, then this in fact is equivalent to
                // `x.deref()`. Since `deref()` is declared with `&self`,
                // this is an autoref of `x`.
                adjustment::Adjust::Deref(Some(ref deref)) => {
                    let bk = ty::BorrowKind::from_mutbl(deref.mutbl);
                    self.delegate.borrow(&place_with_id, bk);
                }
                adjustment::Adjust::Borrow(ref autoref) => {
                    self.walk_autoref(expr, &place_with_id, autoref);
                }
            }
            place_with_id =
                return_if_err!(self.mc.cat_expr_adjusted(expr, place_with_id, &adjustment));
        }
    }
fn walk_adjustment ( & mut self , expr : & hir :: Expr < ' _ > ) { let adjustments = self . mc . tables . expr_adjustments ( expr ) ; let mut place_with_id = return_if_err ! ( self mc cat_expr_unadjusted ( expr ) ) ; for adjustment in adjustments { debug ! ( " " expr adjustment ) ; match adjustment . kind { adjustment :: Adjust :: NeverToAny | adjustment :: Adjust :: Pointer ( _ ) => { // Creating a closure/fn-pointer or unsizing consumes // the input and stores it into the resulting rvalue. self . delegate_consume ( & place_with_id ) ; } adjustment :: Adjust :: Deref ( None ) => { } // Autoderefs for overloaded Deref calls in fact reference // their receiver. That is, if we have `(*x)` where `x` // is of type `Rc<T>`, then this in fact is equivalent to // `x.deref()`. Since `deref()` is declared with `&self`, // this is an autoref of `x`. adjustment :: Adjust :: Deref ( Some ( ref deref ) ) => { let bk = ty :: BorrowKind :: from_mutbl ( deref . mutbl ) ; self . delegate . borrow ( & place_with_id , bk ) ; } adjustment :: Adjust :: Borrow ( ref autoref ) => { self . walk_autoref ( expr , & place_with_id , autoref ) ; } } place_with_id = return_if_err ! ( self mc cat_expr_adjusted ( expr place_with_id adjustment ) ) ; } }
Invoke the appropriate delegate calls for anything that gets
consumed or borrowed as part of the automatic adjustment
process.
Invoke the appropriate delegate calls for anything that gets consumed or borrowed as part of the automatic adjustment process .
&mut self
expr
&hir::Expr<'_>
&mut self
expr
&hir::Expr<'_>