rust/tests/ui/borrowck/borrowck-unary-move.rs

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

12 lines
172 B
Rust
Raw Normal View History

fn foo(x: Box<isize>) -> isize {
2013-03-15 19:24:24 +00:00
let y = &*x;
free(x); //~ ERROR cannot move out of `x` because it is borrowed
*y
}
fn free(_x: Box<isize>) {
}
fn main() {
}