rust/src/test/compile-fail/unsafe-for.rs
2011-09-13 13:05:59 +02:00

7 lines
170 B
Rust

// error-pattern:invalidate reference x
fn main() {
let v: [mutable {mutable x: int}] = [mutable {mutable x: 1}];
for x in v { v[0] = {mutable x: 2}; log x; }
}