]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/issue-20801.stderr
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / ui / borrowck / issue-20801.stderr
1 error[E0507]: cannot move out of a mutable reference
2   --> $DIR/issue-20801.rs:26:22
3    |
4 LL |     let a = unsafe { *mut_ref() };
5    |                      ^^^^^^^^^^ move occurs because value has type `T`, which does not implement the `Copy` trait
6    |
7 help: consider removing the dereference here
8    |
9 LL -     let a = unsafe { *mut_ref() };
10 LL +     let a = unsafe { mut_ref() };
11    |
12
13 error[E0507]: cannot move out of a shared reference
14   --> $DIR/issue-20801.rs:29:22
15    |
16 LL |     let b = unsafe { *imm_ref() };
17    |                      ^^^^^^^^^^ move occurs because value has type `T`, which does not implement the `Copy` trait
18    |
19 help: consider removing the dereference here
20    |
21 LL -     let b = unsafe { *imm_ref() };
22 LL +     let b = unsafe { imm_ref() };
23    |
24
25 error[E0507]: cannot move out of a raw pointer
26   --> $DIR/issue-20801.rs:32:22
27    |
28 LL |     let c = unsafe { *mut_ptr() };
29    |                      ^^^^^^^^^^ move occurs because value has type `T`, which does not implement the `Copy` trait
30    |
31 help: consider removing the dereference here
32    |
33 LL -     let c = unsafe { *mut_ptr() };
34 LL +     let c = unsafe { mut_ptr() };
35    |
36
37 error[E0507]: cannot move out of a raw pointer
38   --> $DIR/issue-20801.rs:35:22
39    |
40 LL |     let d = unsafe { *const_ptr() };
41    |                      ^^^^^^^^^^^^ move occurs because value has type `T`, which does not implement the `Copy` trait
42    |
43 help: consider removing the dereference here
44    |
45 LL -     let d = unsafe { *const_ptr() };
46 LL +     let d = unsafe { const_ptr() };
47    |
48
49 error: aborting due to 4 previous errors
50
51 For more information about this error, try `rustc --explain E0507`.