rust/src/test/run-pass/writealias.rs
2011-07-27 15:54:33 +02:00

13 lines
No EOL
203 B
Rust

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