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

9 lines
215 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};
alt *box { x { whoknows(box); log_full(core::error, x); } }
}