about summary refs log tree commit diff
path: root/src/test/compile-fail/borrowck-vec-pattern-loan-from-mut.rs
blob: 27902100373a96e938a3caeb24e3443a6b84abfe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
fn a() {
    let mut v = ~[1, 2, 3];
    match v {
        [_a, ..tail] => {
            v.push(tail[0] + tail[1]); //~ ERROR conflicts with prior loan
        }
        _ => {}
    };
}

fn main() {}