summary refs log tree commit diff
path: root/src/test/run-pass/writealias.rs
blob: 9dba2e2adfdcbe6a183415e9e7f72303e8a905ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13



// -*- 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);
}