rust/tests/ui/borrowck/issue-20801.stderr

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

52 lines
1.6 KiB
Plaintext
Raw Normal View History

error[E0507]: cannot move out of a mutable reference
2018-12-25 15:56:47 +00:00
--> $DIR/issue-20801.rs:26:22
2018-07-15 21:11:54 +00:00
|
LL | let a = unsafe { *mut_ref() };
| ^^^^^^^^^^ move occurs because value has type `T`, which does not implement the `Copy` trait
|
2022-12-09 21:01:41 +00:00
help: consider removing the dereference here
|
LL - let a = unsafe { *mut_ref() };
LL + let a = unsafe { mut_ref() };
|
2018-07-15 21:11:54 +00:00
error[E0507]: cannot move out of a shared reference
2018-12-25 15:56:47 +00:00
--> $DIR/issue-20801.rs:29:22
2018-07-15 21:11:54 +00:00
|
LL | let b = unsafe { *imm_ref() };
| ^^^^^^^^^^ move occurs because value has type `T`, which does not implement the `Copy` trait
|
2022-12-09 21:01:41 +00:00
help: consider removing the dereference here
|
LL - let b = unsafe { *imm_ref() };
LL + let b = unsafe { imm_ref() };
|
2018-07-15 21:11:54 +00:00
error[E0507]: cannot move out of a raw pointer
2018-12-25 15:56:47 +00:00
--> $DIR/issue-20801.rs:32:22
2018-07-15 21:11:54 +00:00
|
LL | let c = unsafe { *mut_ptr() };
| ^^^^^^^^^^ move occurs because value has type `T`, which does not implement the `Copy` trait
|
2022-12-09 21:01:41 +00:00
help: consider removing the dereference here
|
LL - let c = unsafe { *mut_ptr() };
LL + let c = unsafe { mut_ptr() };
|
2018-07-15 21:11:54 +00:00
error[E0507]: cannot move out of a raw pointer
2018-12-25 15:56:47 +00:00
--> $DIR/issue-20801.rs:35:22
2018-07-15 21:11:54 +00:00
|
LL | let d = unsafe { *const_ptr() };
| ^^^^^^^^^^^^ move occurs because value has type `T`, which does not implement the `Copy` trait
|
2022-12-09 21:01:41 +00:00
help: consider removing the dereference here
|
LL - let d = unsafe { *const_ptr() };
LL + let d = unsafe { const_ptr() };
|
2018-07-15 21:11:54 +00:00
error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0507`.