// channel.send consumes the value: using it afterwards is E2001 from the verifier. // expect: reject E2001 // phase: 6 // spec: docs/spec/15-source-language.md module demo.use_after_send fn main(heap: cap) -> u64 effects [mem.alloc, task.wait] { match channel.make>(1, heap) { ok(tx, rx) => { let o = own.new(1u64, heap) or trap; channel.send(tx, move o) or trap; var v: u64 = 0; { ref q = o; v = *q; } channel.close_sender(move tx); let w = channel.recv(rx) or trap; own.free(move w); channel.close_receiver(move rx) or trap; v } err(e) => { trap; } } }