func _task_spawn<A, T>(consume arg: A, consume worker: (consume A) -> T) -> IntThe worker takes its state as an argument rather than a capture: the transfer is explicit at the boundary, and the closure itself stays environment-free.
View Source
pub func _task_spawn<A, T>(consume arg: A, consume worker: (consume A) -> T) -> Int {
#_ir(arg, worker) { %? = task_spawn $0 $1 }
}