// The only task waits on a channel whose sender it still holds: no future event can // wake it, so the run ends blocked (an environment outcome, not an error or a trap). // expect: run // blocked: no_future_event // grant: heap=mem.alloc:64 // phase: 6 // spec: docs/spec/15-source-language.md module demo.blocked fn main(heap: cap) -> u64 effects [mem.alloc, task.wait] { match channel.make(1, heap) { ok(tx, rx) => { let v = channel.recv(rx) or trap; channel.close_sender(move tx); channel.close_receiver(move rx) or trap; v } err(e) => { trap; } } }