fn determine_pat_move_mode(&mut self,
                               cmt_discr: mc::cmt<'tcx>,
                               pat: &hir::Pat,
                               mode: &mut TrackMatchMode) {
        debug!("determine_pat_move_mode cmt_discr={:?} pat={:?}", cmt_discr,
               pat);
        return_if_err!(self.mc.cat_pattern(cmt_discr, pat, |_mc, cmt_pat, pat| {
            let tcx = self.tcx();
            let def_map = &self.tcx().def_map;
            if pat_util::pat_is_binding(def_map, pat) {
                match pat.node {
                    hir::PatIdent(hir::BindByRef(_), _, _) =>
                        mode.lub(BorrowingMatch),
                    hir::PatIdent(hir::BindByValue(_), _, _) => {
                        match copy_or_move(self.typer, &cmt_pat, PatBindingMove) {
                            Copy => mode.lub(CopyingMatch),
                            Move(_) => mode.lub(MovingMatch),
                        }
                    }
                    _ => {
                        tcx.sess.span_bug(
                            pat.span,
                            "binding pattern not an identifier");
                    }
                }
            }
        }));
    }
/// Identifies any bindings within `pat` and accumulates within
/// `mode` whether the overall pattern/match structure is a move,
/// copy, or borrow.
Identifies any bindings within `pat` and accumulates within
`mode` whether the overall pattern/match structure is a move,
copy, or borrow.
Identifies any bindings within ` pat ` and accumulates within ` mode ` whether the overall pattern / match structure is a move copy or borrow .
fn determine_pat_move_mode(&mut self,
                               cmt_discr: mc::cmt<'tcx>,
                               pat: &hir::Pat,
                               mode: &mut TrackMatchMode) {
        debug!("determine_pat_move_mode cmt_discr={:?} pat={:?}", cmt_discr,
               pat);
        return_if_err!(self.mc.cat_pattern(cmt_discr, pat, |_mc, cmt_pat, pat| {
            let tcx = self.tcx();
            let def_map = &self.tcx().def_map;
            if pat_util::pat_is_binding(def_map, pat) {
                match pat.node {
                    hir::PatIdent(hir::BindByRef(_), _, _) =>
                        mode.lub(BorrowingMatch),
                    hir::PatIdent(hir::BindByValue(_), _, _) => {
                        match copy_or_move(self.typer, &cmt_pat, PatBindingMove) {
                            Copy => mode.lub(CopyingMatch),
                            Move(_) => mode.lub(MovingMatch),
                        }
                    }
                    _ => {
                        tcx.sess.span_bug(
                            pat.span,
                            "binding pattern not an identifier");
                    }
                }
            }
        }));
    }
fn determine_pat_move_mode ( & mut self , cmt_discr : mc :: cmt < ' tcx > , pat : & hir :: Pat , mode : & mut TrackMatchMode ) { debug ! ( " " cmt_discr pat ) ; return_if_err ! ( self mc cat_pattern ( cmt_discr pat mc cmt_pat pat { let tcx self tcx ( ) let def_map self tcx ( ) def_map if pat_util pat_is_binding ( def_map pat ) { match pat node { hir PatIdent ( hir BindByRef ( ) ) mode lub ( BorrowingMatch ) hir PatIdent ( hir BindByValue ( ) ) { match copy_or_move ( self typer cmt_pat PatBindingMove ) { Copy mode lub ( CopyingMatch ) Move ( ) mode lub ( MovingMatch ) } } { tcx sess span_bug ( pat span " " ) } } } } ) ) ; }
Identifies any bindings within `pat` and accumulates within
`mode` whether the overall pattern/match structure is a move,
copy, or borrow.
Identifies any bindings within ` pat ` and accumulates within ` mode ` whether the overall pattern / match structure is a move copy or borrow .
&mut self
cmt_discr
mc::cmt<'tcx>
pat
&hir::Pat
mode
&mut TrackMatchMode
&mut self
cmt_discr
mc::cmt<'tcx>
pat
&hir::Pat
mode
&mut TrackMatchMode