]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/borrowck-vec-pattern-move-tail.rs
Sync core::simd up to rust-lang/portable-simd@2e081db92aa3ee0a4563bc28ce01bdad5b1b2efd
[rust.git] / src / test / ui / borrowck / borrowck-vec-pattern-move-tail.rs
1 fn main() {
2     let mut a = [1, 2, 3, 4];
3     let t = match a {
4         [1, 2, ref tail @ ..] => tail,
5         _ => unreachable!()
6     };
7     println!("t[0]: {}", t[0]);
8     a[2] = 0; //~ ERROR cannot assign to `a[_]` because it is borrowed
9     println!("t[0]: {}", t[0]);
10     t[0];
11 }