summary refs log tree commit diff
path: root/src/test/compile-fail/borrowck-vec-pattern-move-tail.rs
blob: 7246b6688fdb259d2a1c327276a6405370f3729d (plain)
1
2
3
4
5
6
7
8
9
fn main() {
    let mut a = [1, 2, 3, 4];
    let t = match a {
        [1, 2, ..tail] => tail,
        _ => unreachable!()
    };
    a[0] = 0; //~ ERROR cannot assign to `a[]` because it is borrowed
    t[0];
}