Skip to main content

expr_children

Function expr_children 

Source
pub fn expr_children(e: &Expr) -> Vec<&Expr>
Expand description

Every directly-nested sub-expression of e — the total child iterator. The match is exhaustive (no _ arm), so adding an ExprKind variant is a compile error here rather than a silently incomplete walk — the trap the checker’s three hand-rolled partial walkers each fell into (block statements and match-arm bodies were skipped, so e.g. the := self-reference rule was bypassable through a match arm).

Descends one level: block statements and the tail, match-arm bodies, lambda bodies, interpolation holes, record-field values, and observation predicates are all children. Callers recurse for a deep walk.