aboutsummaryrefslogtreecommitdiff
path: root/src/test/compile-fail/writing-through-read-alias.rs
blob: 2a8ec11eaf3a78d16f8e7b0f2bf292f86224d998 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// -*- 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);
}