about summary refs log tree commit diff
path: root/tests/ui/borrowck/borrowck-move-from-unsafe-ptr.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/borrowck/borrowck-move-from-unsafe-ptr.rs')
-rw-r--r--tests/ui/borrowck/borrowck-move-from-unsafe-ptr.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/ui/borrowck/borrowck-move-from-unsafe-ptr.rs b/tests/ui/borrowck/borrowck-move-from-unsafe-ptr.rs
new file mode 100644
index 00000000000..824da5ceb07
--- /dev/null
+++ b/tests/ui/borrowck/borrowck-move-from-unsafe-ptr.rs
@@ -0,0 +1,7 @@
+unsafe fn foo(x: *const Box<isize>) -> Box<isize> {
+    let y = *x; //~ ERROR cannot move out of `*x` which is behind a raw pointer
+    return y;
+}
+
+fn main() {
+}