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

9 lines
206 B
Rust
Raw Normal View History

// error-pattern:invalidate reference i
2012-01-19 16:01:47 -08:00
enum foo { left({mutable x: int}); right(bool); }
fn main() {
let x = left({mutable x: 10});
alt x { left(i) { x = right(false); log(debug, i); } _ { } }
}