mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 15:01:51 +00:00
14 lines
286 B
Rust
14 lines
286 B
Rust
// regression test for #109298
|
|
//@ edition: 2021
|
|
|
|
pub fn subslice_array(x: [u8; 3]) {
|
|
let f = || {
|
|
let [_x @ ..] = x;
|
|
let [ref y, ref mut z @ ..] = x; //~ ERROR cannot borrow `x[..]` as mutable
|
|
};
|
|
|
|
f(); //~ ERROR cannot borrow `f` as mutable
|
|
}
|
|
|
|
fn main() {}
|