rust/tests/ui/borrowck/borrowck-consume-unsize-vec.rs
2023-01-11 09:32:08 +00:00

13 lines
202 B
Rust

// Check that we report an error if an upcast box is moved twice.
fn consume(_: Box<[i32]>) {
}
fn foo(b: Box<[i32;5]>) {
consume(b);
consume(b); //~ ERROR use of moved value
}
fn main() {
}