// expect: run // result: 42 // grant: heap=mem.alloc:128 // phase: 6 // spec: docs/spec/15-source-language.md §5/§10 module test.store_modes struct Pair { a: u64 } struct Box { pair: Pair, data: [u64; 2] } fn main(heap: cap) -> u64 effects [mem.alloc] { let x = own.array(2usize, 0u64, heap) or trap; x[0] = 42u64; let n = x[0]; own.free(move x); return n; }