9 lines
402 B
Rust
9 lines
402 B
Rust
// expect: reject E7005
|
|
// phase: 6
|
|
// spec: docs/reference/grammar.ebnf place/unary/postfix
|
|
// Postfix binds first: *p[0] dereferences the loaded scalar, not the array.
|
|
module test.deref_arguments
|
|
fn read(p: ref<u64>) -> u64 effects [] { return *p; }
|
|
fn forward(p: ref<[u64; 2]>) -> u64 effects [] { return read(ref *p[0]); }
|
|
fn main() -> u64 effects [] { let a = [42u64; 2]; return forward(ref a); }
|