rust/src/test/compile-fail/unsafe-alt.rs

9 lines
197 B
Rust
Raw Normal View History

// error-pattern:invalidate reference i
tag foo { left({mutable x: int}); right(bool); }
fn main() {
let x = left({mutable x: 10});
2011-07-27 14:19:39 +02:00
alt x { left(i) { x = right(false); log i; } _ { } }
}