fn has_nested_returns(tcx: TyCtxt, cfg: &cfg::CFG, blk_id: ast::NodeId) -> bool {
    for index in cfg.graph.depth_traverse(cfg.entry, OUTGOING) {
        let n = cfg.graph.node_data(index);
        match tcx.map.find(n.id()) {
            Some(hir_map::NodeExpr(ex)) => {
                if let hir::ExprRet(Some(ref ret_expr)) = ex.node {
                    let mut visitor = FindNestedReturn::new();
                    intravisit::walk_expr(&mut visitor, &ret_expr);
                    if visitor.found {
                        return true;
                    }
                }
            }
            Some(hir_map::NodeBlock(blk)) if blk.id == blk_id => {
                let mut visitor = FindNestedReturn::new();
                walk_list!(&mut visitor, visit_expr, &blk.expr);
                if visitor.found {
                    return true;
                }
            }
            _ => {}
        }
    }

    return false;
}
// Checks for the presence of "nested returns" in a function.
// Nested returns are when the inner expression of a return expression
// (the 'expr' in 'return expr') contains a return expression. Only cases
// where the outer return is actually reachable are considered. Implicit
// returns from the end of blocks are considered as well.
//
// This check is needed to handle the case where the inner expression is
// part of a larger expression that may have already partially-filled the
// return slot alloca. This can cause errors related to clean-up due to
// the clobbering of the existing value in the return slot.
Checks for the presence of "nested returns" in a function.
Nested returns are when the inner expression of a return expression
(the 'expr' in 'return expr') contains a return expression. Only cases
where the outer return is actually reachable are considered. Implicit
returns from the end of blocks are considered as well.

This check is needed to handle the case where the inner expression is
part of a larger expression that may have already partially-filled the
return slot alloca. This can cause errors related to clean-up due to
the clobbering of the existing value in the return slot.
Checks for the presence of " nested returns " in a function . Nested returns are when the inner expression of a return expression ( the ' expr ' in ' return expr ' ) contains a return expression . Only cases where the outer return is actually reachable are considered . Implicit returns from the end of blocks are considered as well . This check is needed to handle the case where the inner expression is part of a larger expression that may have already partially - filled the return slot alloca . This can cause errors related to clean - up due to the clobbering of the existing value in the return slot .
fn has_nested_returns(tcx: TyCtxt, cfg: &cfg::CFG, blk_id: ast::NodeId) -> bool {
    for index in cfg.graph.depth_traverse(cfg.entry, OUTGOING) {
        let n = cfg.graph.node_data(index);
        match tcx.map.find(n.id()) {
            Some(hir_map::NodeExpr(ex)) => {
                if let hir::ExprRet(Some(ref ret_expr)) = ex.node {
                    let mut visitor = FindNestedReturn::new();
                    intravisit::walk_expr(&mut visitor, &ret_expr);
                    if visitor.found {
                        return true;
                    }
                }
            }
            Some(hir_map::NodeBlock(blk)) if blk.id == blk_id => {
                let mut visitor = FindNestedReturn::new();
                walk_list!(&mut visitor, visit_expr, &blk.expr);
                if visitor.found {
                    return true;
                }
            }
            _ => {}
        }
    }
    return false;
}
fn has_nested_returns ( tcx : TyCtxt , cfg : & cfg :: CFG , blk_id : ast :: NodeId ) -> bool { for index in cfg . graph . depth_traverse ( cfg . entry , OUTGOING ) { let n = cfg . graph . node_data ( index ) ; match tcx . map . find ( n . id ( ) ) { Some ( hir_map :: NodeExpr ( ex ) ) => { if let hir :: ExprRet ( Some ( ref ret_expr ) ) = ex . node { let mut visitor = FindNestedReturn :: new ( ) ; intravisit :: walk_expr ( & mut visitor , & ret_expr ) ; if visitor . found { return true ; } } } Some ( hir_map :: NodeBlock ( blk ) ) if blk . id == blk_id => { let mut visitor = FindNestedReturn :: new ( ) ; walk_list ! ( mut visitor visit_expr blk expr ) ; if visitor . found { return true ; } } _ => { } } } return false ; }
Checks for the presence of "nested returns" in a function.
Checks for the presence of " nested returns " in a function .
tcx
TyCtxt
cfg
&cfg::CFG
blk_id
ast::NodeId
tcx
TyCtxt
cfg
&cfg::CFG
blk_id
ast::NodeId