/src/test/compile-fail/writing-through-read-alias.rs
Rust | 9 lines | 3 code | 4 blank | 2 comment | 0 complexity | f9f9d4c450d740ef4ee8c56c81339df1 MD5 | raw file
1// -*- rust -*- 2 3// error-pattern:assigning to immutable field 4 5type point = {x: int, y: int, z: int}; 6 7fn f(p: point) { p.x = 13; } 8 9fn main() { let x: point = {x: 10, y: 11, z: 12}; f(x); }