aboutsummaryrefslogtreecommitdiff
path: root/src/test/run-pass/exterior.rs
blob: e131e38db136a8cde49afd8881dee5181dbda5de (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// -*- rust -*-

type point = rec(int x, int y, mutable int z);

impure fn f(@point p) {
  check (p.z == 12);
  p.z = 13;
  check (p.z == 13);
}

impure fn main() {
  let point a = rec(x=10, y=11, mutable z=12);
  let @point b = @a;
  check (b.z == 12);
  f(b);
  check (a.z == 12);
  check (b.z == 13);
}