PageRenderTime 7ms CodeModel.GetById 1ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 1ms

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