@@ -7,14 +7,50 @@ LL | unsafe { u.f.0 = Vec::new() };
7
7
= help: writing to this reference calls the destructor for the old value
8
8
= help: add an explicit `*` if that is desired, or call `ptr::write` to not run the destructor
9
9
10
+ error: not automatically applying `DerefMut` on `ManuallyDrop` union field
11
+ --> $DIR/union-deref.rs:17:19
12
+ |
13
+ LL | unsafe { &mut u.f.0 };
14
+ | ^^^
15
+ |
16
+ = help: writing to this reference calls the destructor for the old value
17
+ = help: add an explicit `*` if that is desired, or call `ptr::write` to not run the destructor
18
+
10
19
error: not automatically applying `DerefMut` on `ManuallyDrop` union field
11
20
--> $DIR/union-deref.rs:19:14
12
21
|
22
+ LL | unsafe { u.f.0.push(0) };
23
+ | ^^^
24
+ |
25
+ = help: writing to this reference calls the destructor for the old value
26
+ = help: add an explicit `*` if that is desired, or call `ptr::write` to not run the destructor
27
+
28
+ error: not automatically applying `DerefMut` on `ManuallyDrop` union field
29
+ --> $DIR/union-deref.rs:23:14
30
+ |
13
31
LL | unsafe { u.f.0.0 = Vec::new() };
14
32
| ^^^^^^^
15
33
|
16
34
= help: writing to this reference calls the destructor for the old value
17
35
= help: add an explicit `*` if that is desired, or call `ptr::write` to not run the destructor
18
36
19
- error: aborting due to 2 previous errors
37
+ error: not automatically applying `DerefMut` on `ManuallyDrop` union field
38
+ --> $DIR/union-deref.rs:25:19
39
+ |
40
+ LL | unsafe { &mut u.f.0.0 };
41
+ | ^^^^^^^
42
+ |
43
+ = help: writing to this reference calls the destructor for the old value
44
+ = help: add an explicit `*` if that is desired, or call `ptr::write` to not run the destructor
45
+
46
+ error: not automatically applying `DerefMut` on `ManuallyDrop` union field
47
+ --> $DIR/union-deref.rs:27:14
48
+ |
49
+ LL | unsafe { u.f.0.0.push(0) };
50
+ | ^^^^^^^
51
+ |
52
+ = help: writing to this reference calls the destructor for the old value
53
+ = help: add an explicit `*` if that is desired, or call `ptr::write` to not run the destructor
54
+
55
+ error: aborting due to 6 previous errors
20
56
0 commit comments