rust/src/test/compile-fail/writing-to-immutable-vec.rs
Marijn Haverbeke 0ddade3d7a Extend alias analysis to check assignments
This is a somewhat odd place to put these checks, but the data tracked
by that pass, and the available functions, make it trivial to do such
a check there.
2011-06-15 14:10:07 +02:00

7 lines
126 B
Rust

// xfail-stage0
// error-pattern:assignment to immutable vec content
fn main() {
let vec[int] v = [1, 2, 3];
v.(1) = 4;
}