@@ -4,43 +4,47 @@ error[E0507]: cannot move out of a mutable reference
4
4
LL | let a = unsafe { *mut_ref() };
5
5
| ^^^^^^^^^^ move occurs because value has type `T`, which does not implement the `Copy` trait
6
6
|
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() };
8
11
|
9
- LL | let a = unsafe { &*mut_ref() };
10
- | +
11
12
12
13
error[E0507]: cannot move out of a shared reference
13
14
--> $DIR/issue-20801.rs:29:22
14
15
|
15
16
LL | let b = unsafe { *imm_ref() };
16
17
| ^^^^^^^^^^ move occurs because value has type `T`, which does not implement the `Copy` trait
17
18
|
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() };
19
23
|
20
- LL | let b = unsafe { &*imm_ref() };
21
- | +
22
24
23
25
error[E0507]: cannot move out of a raw pointer
24
26
--> $DIR/issue-20801.rs:32:22
25
27
|
26
28
LL | let c = unsafe { *mut_ptr() };
27
29
| ^^^^^^^^^^ move occurs because value has type `T`, which does not implement the `Copy` trait
28
30
|
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() };
30
35
|
31
- LL | let c = unsafe { &*mut_ptr() };
32
- | +
33
36
34
37
error[E0507]: cannot move out of a raw pointer
35
38
--> $DIR/issue-20801.rs:35:22
36
39
|
37
40
LL | let d = unsafe { *const_ptr() };
38
41
| ^^^^^^^^^^^^ move occurs because value has type `T`, which does not implement the `Copy` trait
39
42
|
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() };
41
47
|
42
- LL | let d = unsafe { &*const_ptr() };
43
- | +
44
48
45
49
error: aborting due to 4 previous errors
46
50
0 commit comments