1 error[E0133]: access to union field is unsafe and requires unsafe function or block
2 --> $DIR/union-unsafe.rs:34:5
5 | ^^^^^^^^^^^ access to union field
7 = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
9 error[E0133]: assignment to union field that might need dropping is unsafe and requires unsafe function or block
10 --> $DIR/union-unsafe.rs:39:5
12 LL | u.a = (RefCell::new(0), 1);
13 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ assignment to union field that might need dropping
15 = note: the previous content of the field will be dropped, which causes undefined behavior if the field was not properly initialized
17 error[E0133]: assignment to union field that might need dropping is unsafe and requires unsafe function or block
18 --> $DIR/union-unsafe.rs:40:5
20 LL | u.a.0 = RefCell::new(0);
21 | ^^^^^^^^^^^^^^^^^^^^^^^ assignment to union field that might need dropping
23 = note: the previous content of the field will be dropped, which causes undefined behavior if the field was not properly initialized
25 error[E0133]: access to union field is unsafe and requires unsafe function or block
26 --> $DIR/union-unsafe.rs:47:6
28 LL | *u3.a = T::default();
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:53:6
36 LL | *u3.a = T::default();
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:61:13
45 | ^^^^ access to union field
47 = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
49 error[E0133]: access to union field is unsafe and requires unsafe function or block
50 --> $DIR/union-unsafe.rs:64:14
52 LL | let U1 { a } = u1;
53 | ^ access to union field
55 = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
57 error[E0133]: access to union field is unsafe and requires unsafe function or block
58 --> $DIR/union-unsafe.rs:65:12
60 LL | if let U1 { a: 12 } = u1 {}
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:70:6
68 LL | *u2.a = String::from("new");
69 | ^^^^ access to union field
71 = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
73 error[E0133]: access to union field is unsafe and requires unsafe function or block
74 --> $DIR/union-unsafe.rs:74:6
77 | ^^^^ access to union field
79 = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
81 error[E0133]: access to union field is unsafe and requires unsafe function or block
82 --> $DIR/union-unsafe.rs:78: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`.