rust/tests/ui/borrowck/borrowck-consume-unsize-vec.rs

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

13 lines
202 B
Rust
Raw Normal View History

// 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() {
}