aboutsummaryrefslogtreecommitdiff
path: root/src/test/compile-fail/writing-through-read-alias.rs
blob: b3d21521abf4923e7c23f982d79cdbfa5bb7ada0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// -*- rust -*-

// error-pattern: writing to non-mutable slot

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