summary refs log tree commit diff
path: root/src/test/compile-fail/borrowck-vec-pattern-move-tail.rs
blob: 16b48aedb0c7fedc3d4d9949ed4a26b7890563f4 (plain)
1
2
3
4
5
6
7
8
fn main() {
    let mut a = [1, 2, 3, 4];
    let _ = match a {
        [1, 2, ..tail] => tail,
        _ => core::util::unreachable()
    };
    a[0] = 0; //~ ERROR: assigning to mutable vec content prohibited due to outstanding loan
}