Skip to main content

eval_expr

Function eval_expr 

Source
pub fn eval_expr(expr: &Expr, env: &Env) -> Result<Value, EvalError>
Expand description

Evaluate an rnix expression in an environment.

Uses stacker::maybe_grow to dynamically extend the call stack when it is close to exhaustion. This prevents stack overflow on deeply nested nixpkgs fixpoints (50+ overlay applications each creating multiple recursive eval_expr / force_value frames).

Fast path: Ident (~32% of all evals), Literal, Paren, and Root expressions don’t recurse and are handled directly, skipping the stacker::maybe_grow overhead for ~40% of all eval_expr calls.