about summary refs log tree commit diff
path: root/tests/ui/union/union-unsafe.stderr
blob: 01f4d95eb649d80612e5574bedadd7eeea6656e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
error[E0133]: access to union field is unsafe and requires unsafe function or block
  --> $DIR/union-unsafe.rs:36:6
   |
LL |     *(u.p) = 13;
   |      ^^^^^ access to union field
   |
   = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior

error[E0133]: access to union field is unsafe and requires unsafe function or block
  --> $DIR/union-unsafe.rs:50:26
   |
LL |     let _p = &raw const *(u.p);
   |                          ^^^^^ access to union field
   |
   = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior

error[E0133]: access to union field is unsafe and requires unsafe function or block
  --> $DIR/union-unsafe.rs:62:6
   |
LL |     *u3.a = T::default();
   |      ^^^^ access to union field
   |
   = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior

error[E0133]: access to union field is unsafe and requires unsafe function or block
  --> $DIR/union-unsafe.rs:68:6
   |
LL |     *u3.a = T::default();
   |      ^^^^ access to union field
   |
   = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior

error[E0133]: access to union field is unsafe and requires unsafe function or block
  --> $DIR/union-unsafe.rs:76:13
   |
LL |     let a = u1.a;
   |             ^^^^ access to union field
   |
   = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior

error[E0133]: access to union field is unsafe and requires unsafe function or block
  --> $DIR/union-unsafe.rs:91:29
   |
LL |     let _a = &raw const vec[u4.a];
   |                             ^^^^ access to union field
   |
   = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior

error[E0133]: access to union field is unsafe and requires unsafe function or block
  --> $DIR/union-unsafe.rs:93:14
   |
LL |     let U1 { a } = u1;
   |              ^ access to union field
   |
   = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior

error[E0133]: access to union field is unsafe and requires unsafe function or block
  --> $DIR/union-unsafe.rs:94:20
   |
LL |     if let U1 { a: 12 } = u1 {}
   |                    ^^ access to union field
   |
   = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior

error[E0133]: access to union field is unsafe and requires unsafe function or block
  --> $DIR/union-unsafe.rs:95:25
   |
LL |     if let Some(U1 { a: 13 }) = Some(u1) {}
   |                         ^^ access to union field
   |
   = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior

error[E0133]: access to union field is unsafe and requires unsafe function or block
  --> $DIR/union-unsafe.rs:100:6
   |
LL |     *u2.a = String::from("new");
   |      ^^^^ access to union field
   |
   = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior

error[E0133]: access to union field is unsafe and requires unsafe function or block
  --> $DIR/union-unsafe.rs:104:6
   |
LL |     *u3.a = 1;
   |      ^^^^ access to union field
   |
   = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior

error[E0133]: access to union field is unsafe and requires unsafe function or block
  --> $DIR/union-unsafe.rs:108:6
   |
LL |     *u3.a = String::from("new");
   |      ^^^^ access to union field
   |
   = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior

error[E0133]: access to union field is unsafe and requires unsafe function or block
  --> $DIR/union-unsafe.rs:117:28
   |
LL |     let _p = &raw const (**a.b).c;
   |                            ^^^ access to union field
   |
   = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior

error[E0133]: access to union field is unsafe and requires unsafe function or block
  --> $DIR/union-unsafe.rs:148:27
   |
LL |     let _p = &raw const (*a.b).c;
   |                           ^^^ access to union field
   |
   = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior

error: aborting due to 14 previous errors

For more information about this error, try `rustc --explain E0133`.