rust/src/test/compile-fail/borrowck-pat-enum-in-box.rs

22 lines
348 B
Rust
Raw Normal View History

// compile-flags:--borrowck=err
fn match_imm_box(v: &const @option<int>) -> int {
alt *v {
@some(i) {i}
@none {0}
}
}
fn match_const_box(v: &const @const option<int>) -> int {
alt *v {
@some(i) {
//!^ ERROR enum variant in aliasable, mutable location
i
}
@none {0}
}
}
fn main() {
}