@@ -4,43 +4,47 @@ error[E0507]: cannot move out of a mutable reference
44LL | let a = unsafe { *mut_ref() };
55 | ^^^^^^^^^^ move occurs because value has type `T`, which does not implement the `Copy` trait
66 |
7- help: consider borrowing here
7+ help: consider removing the dereference here
8+ |
9+ LL - let a = unsafe { *mut_ref() };
10+ LL + let a = unsafe { mut_ref() };
811 |
9- LL | let a = unsafe { &*mut_ref() };
10- | +
1112
1213error[E0507]: cannot move out of a shared reference
1314 --> $DIR/issue-20801.rs:29:22
1415 |
1516LL | let b = unsafe { *imm_ref() };
1617 | ^^^^^^^^^^ move occurs because value has type `T`, which does not implement the `Copy` trait
1718 |
18- help: consider borrowing here
19+ help: consider removing the dereference here
20+ |
21+ LL - let b = unsafe { *imm_ref() };
22+ LL + let b = unsafe { imm_ref() };
1923 |
20- LL | let b = unsafe { &*imm_ref() };
21- | +
2224
2325error[E0507]: cannot move out of a raw pointer
2426 --> $DIR/issue-20801.rs:32:22
2527 |
2628LL | let c = unsafe { *mut_ptr() };
2729 | ^^^^^^^^^^ move occurs because value has type `T`, which does not implement the `Copy` trait
2830 |
29- help: consider borrowing here
31+ help: consider removing the dereference here
32+ |
33+ LL - let c = unsafe { *mut_ptr() };
34+ LL + let c = unsafe { mut_ptr() };
3035 |
31- LL | let c = unsafe { &*mut_ptr() };
32- | +
3336
3437error[E0507]: cannot move out of a raw pointer
3538 --> $DIR/issue-20801.rs:35:22
3639 |
3740LL | let d = unsafe { *const_ptr() };
3841 | ^^^^^^^^^^^^ move occurs because value has type `T`, which does not implement the `Copy` trait
3942 |
40- help: consider borrowing here
43+ help: consider removing the dereference here
44+ |
45+ LL - let d = unsafe { *const_ptr() };
46+ LL + let d = unsafe { const_ptr() };
4147 |
42- LL | let d = unsafe { &*const_ptr() };
43- | +
4448
4549error: aborting due to 4 previous errors
4650
0 commit comments