|
1 | | -error[E0793]: reference to packed field is unaligned |
| 1 | +error[E0793]: reference to field of packed struct is unaligned |
2 | 2 | --> $DIR/issue-53114-safety-checks.rs:23:13 |
3 | 3 | | |
4 | 4 | LL | let _ = &p.b; |
5 | 5 | | ^^^^ |
6 | 6 | | |
7 | | - = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses |
| 7 | + = note: this struct is at most 1-byte aligned, but the type of this field may require higher alignment |
8 | 8 | = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) |
9 | 9 | = 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 | 10 |
|
11 | | -error[E0793]: reference to packed field is unaligned |
| 11 | +error[E0793]: reference to field of packed struct is unaligned |
12 | 12 | --> $DIR/issue-53114-safety-checks.rs:28:17 |
13 | 13 | | |
14 | 14 | LL | let (_,) = (&p.b,); |
15 | 15 | | ^^^^ |
16 | 16 | | |
17 | | - = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses |
| 17 | + = note: this struct is at most 1-byte aligned, but the type of this field may require higher alignment |
18 | 18 | = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) |
19 | 19 | = 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) |
20 | 20 |
|
@@ -50,23 +50,23 @@ LL | let (_,) = (&u2.a,); |
50 | 50 | | |
51 | 51 | = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior |
52 | 52 |
|
53 | | -error[E0793]: reference to packed field is unaligned |
| 53 | +error[E0793]: reference to field of packed struct is unaligned |
54 | 54 | --> $DIR/issue-53114-safety-checks.rs:37:16 |
55 | 55 | | |
56 | 56 | LL | let _: _ = &p.b; |
57 | 57 | | ^^^^ |
58 | 58 | | |
59 | | - = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses |
| 59 | + = note: this struct is at most 1-byte aligned, but the type of this field may require higher alignment |
60 | 60 | = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) |
61 | 61 | = 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) |
62 | 62 |
|
63 | | -error[E0793]: reference to packed field is unaligned |
| 63 | +error[E0793]: reference to field of packed struct is unaligned |
64 | 64 | --> $DIR/issue-53114-safety-checks.rs:42:20 |
65 | 65 | | |
66 | 66 | LL | let (_,): _ = (&p.b,); |
67 | 67 | | ^^^^ |
68 | 68 | | |
69 | | - = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses |
| 69 | + = note: this struct is at most 1-byte aligned, but the type of this field may require higher alignment |
70 | 70 | = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) |
71 | 71 | = 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) |
72 | 72 |
|
@@ -102,23 +102,23 @@ LL | let (_,): _ = (&u2.a,); |
102 | 102 | | |
103 | 103 | = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior |
104 | 104 |
|
105 | | -error[E0793]: reference to packed field is unaligned |
| 105 | +error[E0793]: reference to field of packed struct is unaligned |
106 | 106 | --> $DIR/issue-53114-safety-checks.rs:51:11 |
107 | 107 | | |
108 | 108 | LL | match &p.b { _ => { } } |
109 | 109 | | ^^^^ |
110 | 110 | | |
111 | | - = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses |
| 111 | + = note: this struct is at most 1-byte aligned, but the type of this field may require higher alignment |
112 | 112 | = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) |
113 | 113 | = 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) |
114 | 114 |
|
115 | | -error[E0793]: reference to packed field is unaligned |
| 115 | +error[E0793]: reference to field of packed struct is unaligned |
116 | 116 | --> $DIR/issue-53114-safety-checks.rs:56:12 |
117 | 117 | | |
118 | 118 | LL | match (&p.b,) { (_,) => { } } |
119 | 119 | | ^^^^ |
120 | 120 | | |
121 | | - = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses |
| 121 | + = note: this struct is at most 1-byte aligned, but the type of this field may require higher alignment |
122 | 122 | = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) |
123 | 123 | = 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) |
124 | 124 |
|
|
0 commit comments