// After an island is sent, the sender holds nothing that reaches it. // expect: reject E2001 // phase: 6 // spec: docs/spec/03-memory-model.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 isl = island.create(1u64, heap) or trap; channel.send(tx, move isl) or trap; { ref g = isl; let r = island.root(g); } channel.close_sender(move tx); let back = channel.recv(rx) or trap; island.destroy(move back); channel.close_receiver(move rx) or trap; 0 } err(e) => { trap; } } }