10 lines
367 B
Rust
10 lines
367 B
Rust
// expect: run
|
|
// result: 42
|
|
// 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 read(p: mut<Box>) -> u64 effects [] { ref q = p.data; return q[0]; }
|
|
fn main() -> u64 effects [] { var x: Box = Box { pair: Pair { a: 0u64 }, data: [42u64; 2] }; return read(mut x); }
|