rust/src/test/compile-fail/unsafe-alias-2.rs
2012-03-26 18:35:18 -07:00

9 lines
188 B
Rust

// error-pattern:invalidate reference x
fn whoknows(x: @mut {mut x: int}) { x.x = 10; }
fn main() {
let box = @mut {mut x: 1};
alt *box { x { whoknows(box); log(error, x); } }
}