rust/tests/ui/moves/move-out-of-slice-1.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

12 lines
206 B
Rust
Raw Normal View History

#![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] => {},
_ => {}
}
}