]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/borrowck/borrowck-move-from-unsafe-ptr.nll.stderr
Update output for borrowck=migrate compare mode.
[rust.git] / src / test / ui / borrowck / borrowck-move-from-unsafe-ptr.nll.stderr
index c3a2180b9f082e062f9afab0ede465a7511ac8f3..83c5b82957deaf85738174d3342fb31a68430c59 100644 (file)
@@ -7,6 +7,17 @@ LL |     let y = *x; //~ ERROR cannot move out of dereference of raw pointer
    |             cannot move out of dereference of raw pointer
    |             help: consider removing the `*`: `x`
 
-error: aborting due to previous error
+error[E0507]: cannot move out of `*x` which is behind a `*const` pointer
+  --> $DIR/borrowck-move-from-unsafe-ptr.rs:13:13
+   |
+LL | unsafe fn foo(x: *const Box<isize>) -> Box<isize> {
+   |                  ----------------- help: consider changing this to be a mutable pointer: `*mut std::boxed::Box<isize>`
+LL |     let y = *x; //~ ERROR cannot move out of dereference of raw pointer
+   |             ^^
+   |             |
+   |             cannot move out of `*x` which is behind a `*const` pointer
+   |             `x` is a `*const` pointer, so the data it refers to cannot be moved
+
+error: aborting due to 2 previous errors
 
 For more information about this error, try `rustc --explain E0507`.