173. A recursive local closure is passed itself, not a std::function (2026-11-21)
Implements §127 for nested fns. A local closure or nested fn that
calls itself, bound once and not hoisted, emits
auto go = cpl::rec([...](auto& go_2, ll u) { ... go_2(...) }): the
lambda takes itself as its first parameter instead of capturing its own
std::function, so every call is a direct, inlinable call of one
closure type. cpl::Rec passes *this first, so go(1), go passed on
as a value and the body's own calls all keep the source's argument list.
cpl explain reports it static: auto. Why: the indirect call through
std::function blocked inlining on every recursive step; on a 2e6-node
subtree-size DFS run 20 times, 1.09 s -> 0.97 s against 0.83 s for the
hand-written self-passing lambda (the rest is the checked adj[u] and
the reading loop). Corpus: programs emitting std::function 61 -> 37;
the 24 programs that lost it grow +143 to +201 B (+4,366 B in total),
the price of Rec over #include <functional>. Reverse: drop the
local_rec arm of Stmt::Let in crates/cpl-codegen/src/stmt.rs.