/// Indicates that `cmt` is being directly mutated (e.g., assigned
/// to). If cmt contains any by-ref upvars, this implies that
/// those upvars must be borrowed using an `&mut` borrow.
Indicates that `cmt` is being directly mutated . If cmt contains any by-ref upvars, this implies that
those upvars must be borrowed using an `&mut` borrow.
Indicates that ` cmt ` is being directly mutated . If cmt contains any by - ref upvars this implies that those upvars must be borrowed using an ` &mut ` borrow .
fn adjust_upvar_borrow_kind_for_mut(&mut self, cmt: mc::cmt<'tcx>) {
        debug!("adjust_upvar_borrow_kind_for_mut(cmt={:?})",
               cmt);
        match cmt.cat.clone() {
            mc::cat_deref(base, _, mc::Unique) |
            mc::cat_interior(base, _) |
            mc::cat_downcast(base, _) => {
                // Interior or owned data is mutable if base is
                // mutable, so iterate to the base.
                self.adjust_upvar_borrow_kind_for_mut(base);
            }
            mc::cat_deref(base, _, mc::BorrowedPtr(..)) |
            mc::cat_deref(base, _, mc::Implicit(..)) => {
                if !self.try_adjust_upvar_deref(&cmt.note, ty::MutBorrow) {
                    // assignment to deref of an `&mut`
                    // borrowed pointer implies that the
                    // pointer itself must be unique, but not
                    // necessarily *mutable*
                    self.adjust_upvar_borrow_kind_for_unique(base);
                }
            }
            mc::cat_deref(_, _, mc::UnsafePtr(..)) |
            mc::cat_static_item |
            mc::cat_rvalue(_) |
            mc::cat_local(_) |
            mc::cat_upvar(..) => {
                return;
            }
        }
    }
fn adjust_upvar_borrow_kind_for_mut ( & mut self , cmt : mc :: cmt < ' tcx > ) { debug ! ( " " cmt ) ; match cmt . cat . clone ( ) { mc :: cat_deref ( base , _ , mc :: Unique ) | mc :: cat_interior ( base , _ ) | mc :: cat_downcast ( base , _ ) => { // Interior or owned data is mutable if base is // mutable, so iterate to the base. self . adjust_upvar_borrow_kind_for_mut ( base ) ; } mc :: cat_deref ( base , _ , mc :: BorrowedPtr ( .. ) ) | mc :: cat_deref ( base , _ , mc :: Implicit ( .. ) ) => { if ! self . try_adjust_upvar_deref ( & cmt . note , ty :: MutBorrow ) { // assignment to deref of an `&mut` // borrowed pointer implies that the // pointer itself must be unique, but not // necessarily *mutable* self . adjust_upvar_borrow_kind_for_unique ( base ) ; } } mc :: cat_deref ( _ , _ , mc :: UnsafePtr ( .. ) ) | mc :: cat_static_item | mc :: cat_rvalue ( _ ) | mc :: cat_local ( _ ) | mc :: cat_upvar ( .. ) => { return ; } } }
Indicates that `cmt` is being directly mutated (e.g., assigned
to).
Indicates that ` cmt ` is being directly mutated ( e . g . assigned to ) .
&mut self
cmt
mc::cmt<'tcx>