1 // http://rust-lang.org/COPYRIGHT.
5 //[cmp]compile-flags: -Z borrowck=compare
7 #![feature(slice_patterns)]
10 let mut a = [1, 2, 3, 4];
12 [1, 2, ref tail..] => tail,
15 println!("t[0]: {}", t[0]);
16 a[2] = 0; //[ast]~ ERROR cannot assign to `a[..]` because it is borrowed
17 //[cmp]~^ ERROR cannot assign to `a[..]` because it is borrowed (Ast)
18 //[cmp]~| ERROR cannot assign to `a[_]` because it is borrowed (Mir)
19 println!("t[0]: {}", t[0]);