]> git.proxmox.com Git - rustc.git/blob - tests/ui/union/union-unsafe.thir.stderr
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / union / union-unsafe.thir.stderr
1 error[E0133]: access to union field is unsafe and requires unsafe function or block
2 --> $DIR/union-unsafe.rs:33:6
3 |
4 LL | *(u.p) = 13;
5 | ^^^^^ access to union field
6 |
7 = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
8
9 error[E0133]: access to union field is unsafe and requires unsafe function or block
10 --> $DIR/union-unsafe.rs:46:6
11 |
12 LL | *u3.a = T::default();
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:52:6
19 |
20 LL | *u3.a = T::default();
21 | ^^^^ access to union field
22 |
23 = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
24
25 error[E0133]: access to union field is unsafe and requires unsafe function or block
26 --> $DIR/union-unsafe.rs:60:13
27 |
28 LL | let a = u1.a;
29 | ^^^^ access to union field
30 |
31 = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
32
33 error[E0133]: access to union field is unsafe and requires unsafe function or block
34 --> $DIR/union-unsafe.rs:63:14
35 |
36 LL | let U1 { a } = u1;
37 | ^ access to union field
38 |
39 = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
40
41 error[E0133]: access to union field is unsafe and requires unsafe function or block
42 --> $DIR/union-unsafe.rs:64:8
43 |
44 LL | if let U1 { a: 12 } = u1 {}
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:69:6
51 |
52 LL | *u2.a = String::from("new");
53 | ^^^^ access to union field
54 |
55 = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
56
57 error[E0133]: access to union field is unsafe and requires unsafe function or block
58 --> $DIR/union-unsafe.rs:73:6
59 |
60 LL | *u3.a = 1;
61 | ^^^^ access to union field
62 |
63 = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
64
65 error[E0133]: access to union field is unsafe and requires unsafe function or block
66 --> $DIR/union-unsafe.rs:77:6
67 |
68 LL | *u3.a = String::from("new");
69 | ^^^^ access to union field
70 |
71 = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
72
73 error: aborting due to 9 previous errors
74
75 For more information about this error, try `rustc --explain E0133`.