/src/test/compile-fail/writing-through-read-alias.rs
http://github.com/jruderman/rust · Rust · 9 lines · 3 code · 4 blank · 2 comment · 0 complexity · f9f9d4c450d740ef4ee8c56c81339df1 MD5 · raw file
- // -*- 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); }