// 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.new(0u64, heap) or trap; { mut p = x; *p = 42u64; } return own.take(move x); }