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

16 lines
227 B
Rust
Raw Normal View History

// error-pattern:invalidate alias x
fn whoknows(@mutable int x) {
*x = 10;
}
fn main() {
auto box = @mutable 1;
alt (*box) {
case (?x) {
whoknows(box);
log_err x;
}
}
}