rust/src/test/compile-fail/writing-through-read-alias.rs
2010-07-23 15:29:17 -07:00

15 lines
195 B
Rust

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