Files
aji/tests/conformance/source/effect_names/allocation.aji
T

11 lines
289 B
Rust

// expect: run
// result: 42
// grant: heap=mem.alloc:8
// phase: 6
// spec: docs/spec/15-source-language.md §8, §9
module test.effects.allocation
fn main(heap: cap<mem.alloc>) -> u64 effects [mem.alloc] {
let value = own.new(42u64, heap) or trap;
return own.take(move value);
}