rust/src/test/run-pass/writealias.rs
2011-09-12 12:49:00 +02:00

14 lines
196 B
Rust

// -*- rust -*-
type point = {x: int, y: int, mutable z: int};
fn f(&p: point) { p.z = 13; }
fn main() {
let x: point = {x: 10, y: 11, mutable z: 12};
f(x);
assert (x.z == 13);
}