Skip to main content

expr_mutates_var

Function expr_mutates_var 

Source
fn expr_mutates_var<'hir>(
    hir: &'hir Hir<'hir>,
    expr: &'hir Expr<'hir>,
    var: VariableId,
) -> bool
Expand description

mutates_var over an expression, for the condition of an if, which the If arm reaches before the statement arm ever sees it: if ((tokenId = x) > 0) {} reassigns as surely as a bare statement, and the condition runs whichever branch is taken.