1 error[E0133]: assignment to non-`Copy` union field is unsafe and requires unsafe function or block
2 --> $DIR/union-unsafe.rs:21:5
4 LL | u3.a = ManuallyDrop::new(T::default());
5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ assignment to non-`Copy` union field
7 = note: the previous content of the field will be dropped, which causes undefined behavior if the field was not properly initialized
9 error[E0133]: access to union field is unsafe and requires unsafe function or block
10 --> $DIR/union-unsafe.rs:22:6
12 LL | *u3.a = T::default();
13 | ^^^^ access to union field
15 = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
17 error[E0133]: access to union field is unsafe and requires unsafe function or block
18 --> $DIR/union-unsafe.rs:28:6
20 LL | *u3.a = T::default();
21 | ^^^^ access to union field
23 = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
25 error[E0133]: access to union field is unsafe and requires unsafe function or block
26 --> $DIR/union-unsafe.rs:36:13
29 | ^^^^ access to union field
31 = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
33 error[E0133]: access to union field is unsafe and requires unsafe function or block
34 --> $DIR/union-unsafe.rs:39:14
36 LL | let U1 { a } = u1;
37 | ^ access to union field
39 = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
41 error[E0133]: access to union field is unsafe and requires unsafe function or block
42 --> $DIR/union-unsafe.rs:40:20
44 LL | if let U1 { a: 12 } = u1 {}
45 | ^^ access to union field
47 = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
49 error[E0133]: assignment to non-`Copy` union field is unsafe and requires unsafe function or block
50 --> $DIR/union-unsafe.rs:44:5
52 LL | u2.a = ManuallyDrop::new(String::from("new"));
53 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ assignment to non-`Copy` union field
55 = note: the previous content of the field will be dropped, which causes undefined behavior if the field was not properly initialized
57 error[E0133]: access to union field is unsafe and requires unsafe function or block
58 --> $DIR/union-unsafe.rs:45:6
60 LL | *u2.a = String::from("new");
61 | ^^^^ access to union field
63 = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
65 error[E0133]: access to union field is unsafe and requires unsafe function or block
66 --> $DIR/union-unsafe.rs:49:6
69 | ^^^^ access to union field
71 = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
73 error[E0133]: assignment to non-`Copy` union field is unsafe and requires unsafe function or block
74 --> $DIR/union-unsafe.rs:52:5
76 LL | u3.a = ManuallyDrop::new(String::from("new"));
77 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ assignment to non-`Copy` union field
79 = note: the previous content of the field will be dropped, which causes undefined behavior if the field was not properly initialized
81 error[E0133]: access to union field is unsafe and requires unsafe function or block
82 --> $DIR/union-unsafe.rs:53:6
84 LL | *u3.a = String::from("new");
85 | ^^^^ access to union field
87 = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
89 error: aborting due to 11 previous errors
91 For more information about this error, try `rustc --explain E0133`.