summary refs log tree commit diff
path: root/src/test/ui/borrowck/borrowck-move-from-unsafe-ptr.nll.stderr
blob: 83c5b82957deaf85738174d3342fb31a68430c59 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
error[E0507]: cannot move out of dereference of raw pointer
  --> $DIR/borrowck-move-from-unsafe-ptr.rs:13:13
   |
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[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`.