]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/borrowck-vec-pattern-loan-from-mut.rs
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / ui / borrowck / borrowck-vec-pattern-loan-from-mut.rs
1 fn a() {
2     let mut v = vec![1, 2, 3];
3     let vb: &mut [isize] = &mut v;
4     match vb {
5         &mut [_a, ref tail @ ..] => {
6             v.push(tail[0] + tail[1]); //~ ERROR cannot borrow
7         }
8         _ => {}
9     };
10 }
11
12 fn main() {}