rust/tests/ui/moves/move-out-of-slice-1.rs
2023-01-11 09:32:08 +00:00

12 lines
206 B
Rust

#![feature(box_patterns)]
struct A;
fn main() {
let a: Box<[A]> = Box::new([A]);
match a { //~ ERROR cannot move out of type `[A]`, a non-copy slice
box [a] => {},
_ => {}
}
}