summary refs log tree commit diff
path: root/src/test/compile-fail/writing-through-read-alias.rs
blob: d4dec3c3f00a945719cce9b97549a273ba667773 (plain)
1
2
3
4
5
6
7
8
9
// -*- rust -*-

// error-pattern:assigning to immutable field

type point = {x: int, y: int, z: int};

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

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