rust/src/test/compile-fail/unsafe-alias-2.rs

9 lines
200 B
Rust
Raw Normal View History

// error-pattern:invalidate reference x
fn whoknows(x: @mutable {mutable x: int}) { x.x = 10; }
fn main() {
let box = @mutable {mutable x: 1};
2011-07-27 07:19:39 -05:00
alt *box { x { whoknows(box); log_err x; } }
}