1 error[E0793]: reference to packed field is unaligned
2 --> $DIR/issue-53114-safety-checks.rs:23:13
7 = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
8 = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
10 error[E0793]: reference to packed field is unaligned
11 --> $DIR/issue-53114-safety-checks.rs:28:17
13 LL | let (_,) = (&p.b,);
16 = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
17 = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
19 error[E0793]: reference to packed field is unaligned
20 --> $DIR/issue-53114-safety-checks.rs:37:11
22 LL | match &p.b { _ => { } }
25 = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
26 = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
28 error[E0793]: reference to packed field is unaligned
29 --> $DIR/issue-53114-safety-checks.rs:42:12
31 LL | match (&p.b,) { (_,) => { } }
34 = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
35 = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
37 error[E0133]: access to union field is unsafe and requires unsafe function or block
38 --> $DIR/issue-53114-safety-checks.rs:25:13
41 | ^^^^^ access to union field
43 = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
45 error[E0133]: access to union field is unsafe and requires unsafe function or block
46 --> $DIR/issue-53114-safety-checks.rs:29:17
48 LL | let (_,) = (u1.a,);
49 | ^^^^ access to union field
51 = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
53 error[E0133]: access to union field is unsafe and requires unsafe function or block
54 --> $DIR/issue-53114-safety-checks.rs:30:17
56 LL | let (_,) = (&u2.a,);
57 | ^^^^^ access to union field
59 = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
61 error[E0133]: access to union field is unsafe and requires unsafe function or block
62 --> $DIR/issue-53114-safety-checks.rs:38:11
64 LL | match u1.a { _ => { } }
65 | ^^^^ access to union field
67 = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
69 error[E0133]: access to union field is unsafe and requires unsafe function or block
70 --> $DIR/issue-53114-safety-checks.rs:39:11
72 LL | match &u2.a { _ => { } }
73 | ^^^^^ access to union field
75 = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
77 error[E0133]: access to union field is unsafe and requires unsafe function or block
78 --> $DIR/issue-53114-safety-checks.rs:43:12
80 LL | match (u1.a,) { (_,) => { } }
81 | ^^^^ access to union field
83 = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
85 error[E0133]: access to union field is unsafe and requires unsafe function or block
86 --> $DIR/issue-53114-safety-checks.rs:44:12
88 LL | match (&u2.a,) { (_,) => { } }
89 | ^^^^^ access to union field
91 = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior
93 error: aborting due to 11 previous errors
95 Some errors have detailed explanations: E0133, E0793.
96 For more information about an error, try `rustc --explain E0133`.