mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-15 01:55:03 +00:00
13 lines
240 B
Rust
13 lines
240 B
Rust
fn a() {
|
|
let mut v = vec![1, 2, 3];
|
|
let vb: &mut [isize] = &mut v;
|
|
match vb {
|
|
&mut [_a, ref tail @ ..] => {
|
|
v.push(tail[0] + tail[1]); //~ ERROR cannot borrow
|
|
}
|
|
_ => {}
|
|
};
|
|
}
|
|
|
|
fn main() {}
|