rust/src/test/run-pass/writealias.rs
Tim Chevalier f96a2a2ca1 Remove by-mutable-ref mode from the compiler
and test cases. Closes #3513
2012-10-05 22:45:50 -07:00

13 lines
201 B
Rust

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