; The only task waits on a channel whose sender it still holds: no future ; event can wake it, so the run ends blocked (not an error, not a trap). ; expect: run ; blocked: no_future_event ; grant: heap=mem.alloc:64 ; phase: 3 ; spec: docs/spec/04-concurrency-and-atomics.md module test.channels_blocked air 0 lang 0.1 features [cancellation, capabilities, channels, effects, heap, ownership, resources, tasks] fn @main(%heap: cap) -> u64 effects [mem.alloc, task.wait] entry: %one = const.usize 1 channel.make u64, %one, %heap, ok -> @made, err -> @oom made(%tx: sender, %rx: receiver): %rb = borrow.mut %rx channel.recv %rb, ok -> @got, closed -> @end, cancelled -> @end got(%v: u64): borrow.end %rb channel.close_sender %tx channel.close_receiver %rx, ok -> @fin, pending -> @stuck end: trap fin: ret %v stuck(%p: receiver): trap oom(%e: alloc_error): trap