aboutsummaryrefslogtreecommitdiff
path: root/src/test/compile-fail/writing-through-read-alias.rs
blob: e88a8399b7610dad014ef49b0dbf42214a2e2bef (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// xfail-boot
// xfail-stage0
// xfail-stage1
// xfail-stage2
// -*- rust -*-

// error-pattern: writing to immutable type

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

fn f(&point p) {
  p.x = 13;
}

fn main() {
  let point x = rec(x=10, y=11, z=12);
  f(x);
}