// An iref of one island used with another traps T0010; equality across islands is false. // expect: run // grant: heap=mem.alloc:256 // trap: T0010 // phase: 6 // spec: docs/spec/03-memory-model.md module demo.foreigniref fn main(heap: cap) -> u64 effects [mem.alloc] { let a = island.create(1u64, heap) or trap; let b = island.create(2u64, heap) or trap; var out: u64 = 0; { ref ga = a; ref gb = b; let ra = island.root(ga); let rb = island.root(gb); if ra != rb { ref wrong = island.at(gb, ra); out = *wrong; } } island.destroy(move a); island.destroy(move b); out }