If the lambda captures some value, and also outlives the current scope, then that captured value has to necessarily be heap allocated.
If you do want it, you have the option to, say, heap allocate.
If you return a pointer to a local variable that outlives the scope, the pointer would be dangling. Does that mean we should ban pointers?
If you close over a pointer to a local variable that outlives the scope, the closure would be dangling. Does that mean we should ban closures?