rust/src/test/run-pass/writealias.rs
2012-03-26 18:35:18 -07:00

14 lines
192 B
Rust

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