fn link_pattern<'t, 'a, 'tcx>(rcx: &Rcx<'a, 'tcx>,
                          mc: mc::MemCategorizationContext<'t, 'a, 'tcx>,
                          discr_cmt: mc::cmt<'tcx>,
                          root_pat: &hir::Pat) {
    debug!("link_pattern(discr_cmt={:?}, root_pat={:?})",
           discr_cmt,
           root_pat);
    let _ = mc.cat_pattern(discr_cmt, root_pat, |mc, sub_cmt, sub_pat| {
            match sub_pat.node {
                // `ref x` pattern
                hir::PatIdent(hir::BindByRef(mutbl), _, _) => {
                    link_region_from_node_type(
                        rcx, sub_pat.span, sub_pat.id,
                        mutbl, sub_cmt);
                }

                // `[_, ..slice, _]` pattern
                hir::PatVec(_, Some(ref slice_pat), _) => {
                    match mc.cat_slice_pattern(sub_cmt, &**slice_pat) {
                        Ok((slice_cmt, slice_mutbl, slice_r)) => {
                            link_region(rcx, sub_pat.span, &slice_r,
                                        ty::BorrowKind::from_mutbl(slice_mutbl),
                                        slice_cmt);
                        }
                        Err(()) => {}
                    }
                }
                _ => {}
            }
        });
}
/// Link lifetimes of any ref bindings in `root_pat` to the pointers found in the discriminant, if
/// needed.
Link lifetimes of any ref bindings in `root_pat` to the pointers found in the discriminant, if
needed.
Link lifetimes of any ref bindings in ` root_pat ` to the pointers found in the discriminant if needed .
fn link_pattern<'t, 'a, 'tcx>(rcx: &Rcx<'a, 'tcx>,
                          mc: mc::MemCategorizationContext<'t, 'a, 'tcx>,
                          discr_cmt: mc::cmt<'tcx>,
                          root_pat: &hir::Pat) {
    debug!("link_pattern(discr_cmt={:?}, root_pat={:?})",
           discr_cmt,
           root_pat);
    let _ = mc.cat_pattern(discr_cmt, root_pat, |mc, sub_cmt, sub_pat| {
            match sub_pat.node {
                // `ref x` pattern
                hir::PatIdent(hir::BindByRef(mutbl), _, _) => {
                    link_region_from_node_type(
                        rcx, sub_pat.span, sub_pat.id,
                        mutbl, sub_cmt);
                }
                // `[_, ..slice, _]` pattern
                hir::PatVec(_, Some(ref slice_pat), _) => {
                    match mc.cat_slice_pattern(sub_cmt, &**slice_pat) {
                        Ok((slice_cmt, slice_mutbl, slice_r)) => {
                            link_region(rcx, sub_pat.span, &slice_r,
                                        ty::BorrowKind::from_mutbl(slice_mutbl),
                                        slice_cmt);
                        }
                        Err(()) => {}
                    }
                }
                _ => {}
            }
        });
}
fn link_pattern < ' t , ' a , ' tcx > ( rcx : & Rcx < ' a , ' tcx > , mc : mc :: MemCategorizationContext < ' t , ' a , ' tcx > , discr_cmt : mc :: cmt < ' tcx > , root_pat : & hir :: Pat ) { debug ! ( " " discr_cmt root_pat ) ; let _ = mc . cat_pattern ( discr_cmt , root_pat , | mc , sub_cmt , sub_pat | { match sub_pat . node { // `ref x` pattern hir :: PatIdent ( hir :: BindByRef ( mutbl ) , _ , _ ) => { link_region_from_node_type ( rcx , sub_pat . span , sub_pat . id , mutbl , sub_cmt ) ; } // `[_, ..slice, _]` pattern hir :: PatVec ( _ , Some ( ref slice_pat ) , _ ) => { match mc . cat_slice_pattern ( sub_cmt , & * * slice_pat ) { Ok ( ( slice_cmt , slice_mutbl , slice_r ) ) => { link_region ( rcx , sub_pat . span , & slice_r , ty :: BorrowKind :: from_mutbl ( slice_mutbl ) , slice_cmt ) ; } Err ( ( ) ) => { } } } _ => { } } } ) ; }
Link lifetimes of any ref bindings in `root_pat` to the pointers found in the discriminant, if
needed.
Link lifetimes of any ref bindings in ` root_pat ` to the pointers found in the discriminant if needed .
rcx
&Rcx<'a, 'tcx>
mc
mc::MemCategorizationContext<'t, 'a, 'tcx>
discr_cmt
mc::cmt<'tcx>
root_pat
&hir::Pat
rcx
&Rcx<'a, 'tcx>
mc
mc::MemCategorizationContext<'t, 'a, 'tcx>
discr_cmt
mc::cmt<'tcx>
root_pat
&hir::Pat