|
1 | 1 | error[E0133]: access to union field is unsafe and requires unsafe function or block
|
2 |
| - --> $DIR/union-unsafe.rs:31:6 |
| 2 | + --> $DIR/union-unsafe.rs:36:6 |
3 | 3 | |
|
4 | 4 | LL | *(u.p) = 13;
|
5 | 5 | | ^^^^^ access to union field
|
6 | 6 | |
|
7 | 7 | = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
|
8 | 8 |
|
9 | 9 | error[E0133]: access to union field is unsafe and requires unsafe function or block
|
10 |
| - --> $DIR/union-unsafe.rs:43:6 |
| 10 | + --> $DIR/union-unsafe.rs:50:26 |
| 11 | + | |
| 12 | +LL | let _p = &raw const *(u.p); |
| 13 | + | ^^^^^ access to union field |
| 14 | + | |
| 15 | + = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior |
| 16 | + |
| 17 | +error[E0133]: access to union field is unsafe and requires unsafe function or block |
| 18 | + --> $DIR/union-unsafe.rs:62:6 |
11 | 19 | |
|
12 | 20 | LL | *u3.a = T::default();
|
13 | 21 | | ^^^^ access to union field
|
14 | 22 | |
|
15 | 23 | = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
|
16 | 24 |
|
17 | 25 | error[E0133]: access to union field is unsafe and requires unsafe function or block
|
18 |
| - --> $DIR/union-unsafe.rs:49:6 |
| 26 | + --> $DIR/union-unsafe.rs:68:6 |
19 | 27 | |
|
20 | 28 | LL | *u3.a = T::default();
|
21 | 29 | | ^^^^ access to union field
|
22 | 30 | |
|
23 | 31 | = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
|
24 | 32 |
|
25 | 33 | error[E0133]: access to union field is unsafe and requires unsafe function or block
|
26 |
| - --> $DIR/union-unsafe.rs:57:13 |
| 34 | + --> $DIR/union-unsafe.rs:76:13 |
27 | 35 | |
|
28 | 36 | LL | let a = u1.a;
|
29 | 37 | | ^^^^ access to union field
|
30 | 38 | |
|
31 | 39 | = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
|
32 | 40 |
|
33 | 41 | error[E0133]: access to union field is unsafe and requires unsafe function or block
|
34 |
| - --> $DIR/union-unsafe.rs:60:14 |
| 42 | + --> $DIR/union-unsafe.rs:91:29 |
| 43 | + | |
| 44 | +LL | let _a = &raw const vec[u4.a]; |
| 45 | + | ^^^^ access to union field |
| 46 | + | |
| 47 | + = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior |
| 48 | + |
| 49 | +error[E0133]: access to union field is unsafe and requires unsafe function or block |
| 50 | + --> $DIR/union-unsafe.rs:93:14 |
35 | 51 | |
|
36 | 52 | LL | let U1 { a } = u1;
|
37 | 53 | | ^ access to union field
|
38 | 54 | |
|
39 | 55 | = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
|
40 | 56 |
|
41 | 57 | error[E0133]: access to union field is unsafe and requires unsafe function or block
|
42 |
| - --> $DIR/union-unsafe.rs:61:20 |
| 58 | + --> $DIR/union-unsafe.rs:94:20 |
43 | 59 | |
|
44 | 60 | LL | if let U1 { a: 12 } = u1 {}
|
45 | 61 | | ^^ access to union field
|
46 | 62 | |
|
47 | 63 | = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
|
48 | 64 |
|
49 | 65 | error[E0133]: access to union field is unsafe and requires unsafe function or block
|
50 |
| - --> $DIR/union-unsafe.rs:62:25 |
| 66 | + --> $DIR/union-unsafe.rs:95:25 |
51 | 67 | |
|
52 | 68 | LL | if let Some(U1 { a: 13 }) = Some(u1) {}
|
53 | 69 | | ^^ access to union field
|
54 | 70 | |
|
55 | 71 | = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
|
56 | 72 |
|
57 | 73 | error[E0133]: access to union field is unsafe and requires unsafe function or block
|
58 |
| - --> $DIR/union-unsafe.rs:67:6 |
| 74 | + --> $DIR/union-unsafe.rs:100:6 |
59 | 75 | |
|
60 | 76 | LL | *u2.a = String::from("new");
|
61 | 77 | | ^^^^ access to union field
|
62 | 78 | |
|
63 | 79 | = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
|
64 | 80 |
|
65 | 81 | error[E0133]: access to union field is unsafe and requires unsafe function or block
|
66 |
| - --> $DIR/union-unsafe.rs:71:6 |
| 82 | + --> $DIR/union-unsafe.rs:104:6 |
67 | 83 | |
|
68 | 84 | LL | *u3.a = 1;
|
69 | 85 | | ^^^^ access to union field
|
70 | 86 | |
|
71 | 87 | = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
|
72 | 88 |
|
73 | 89 | error[E0133]: access to union field is unsafe and requires unsafe function or block
|
74 |
| - --> $DIR/union-unsafe.rs:75:6 |
| 90 | + --> $DIR/union-unsafe.rs:108:6 |
75 | 91 | |
|
76 | 92 | LL | *u3.a = String::from("new");
|
77 | 93 | | ^^^^ access to union field
|
78 | 94 | |
|
79 | 95 | = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
|
80 | 96 |
|
81 |
| -error: aborting due to 10 previous errors |
| 97 | +error[E0133]: access to union field is unsafe and requires unsafe function or block |
| 98 | + --> $DIR/union-unsafe.rs:117:28 |
| 99 | + | |
| 100 | +LL | let _p = &raw const (**a.b).c; |
| 101 | + | ^^^ access to union field |
| 102 | + | |
| 103 | + = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior |
| 104 | + |
| 105 | +error[E0133]: access to union field is unsafe and requires unsafe function or block |
| 106 | + --> $DIR/union-unsafe.rs:148:27 |
| 107 | + | |
| 108 | +LL | let _p = &raw const (*a.b).c; |
| 109 | + | ^^^ access to union field |
| 110 | + | |
| 111 | + = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior |
| 112 | + |
| 113 | +error: aborting due to 14 previous errors |
82 | 114 |
|
83 | 115 | For more information about this error, try `rustc --explain E0133`.
|
0 commit comments