diff options
Diffstat (limited to 'tests/ui/borrowck/borrowck-unary-move.rs')
-rw-r--r-- | tests/ui/borrowck/borrowck-unary-move.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/borrowck/borrowck-unary-move.rs b/tests/ui/borrowck/borrowck-unary-move.rs new file mode 100644 index 000000000..3b4c0731f --- /dev/null +++ b/tests/ui/borrowck/borrowck-unary-move.rs @@ -0,0 +1,11 @@ +fn foo(x: Box<isize>) -> isize { + let y = &*x; + free(x); //~ ERROR cannot move out of `x` because it is borrowed + *y +} + +fn free(_x: Box<isize>) { +} + +fn main() { +} |