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

9 lines
188 B
Rust
Raw Normal View History

// error-pattern:invalidate reference x
2012-03-26 20:35:18 -05:00
fn whoknows(x: @mut {mut x: int}) { x.x = 10; }
fn main() {
2012-03-26 20:35:18 -05:00
let box = @mut {mut x: 1};
alt *box { x { whoknows(box); log(error, x); } }
}