rust/src/test/compile-fail/writing-to-immutable-rec.rs
Marijn Haverbeke 2d1dec78e7 Move mutability checking into its own pass.
Having it in the alias pass was slightly more efficient (finding
expression roots has to be done in both passes), but further muddled
up the already complex alias checker.

Also factors out some duplication in the mutability-checking code.
2011-09-01 16:32:38 +02:00

3 lines
96 B
Rust

// error-pattern: assigning to immutable field
fn main() { let r: {x: int} = {x: 1}; r.x = 6; }