| 1 |
error[E0793]: reference to field of packed struct is unaligned |
| 2 |
--> tests/ui/pin_project/packed.rs:5:1 |
| 3 |
| |
| 4 |
5 | / pin_project! { //~ ERROR reference to packed field is unaligned |
| 5 |
6 | | #[repr(packed, C)] |
| 6 |
7 | | struct Packed { |
| 7 |
8 | | #[pin] |
| 8 |
... | |
| 9 |
11 | | } |
| 10 |
| |_^ |
| 11 |
| |
| 12 |
= note: this struct is 1-byte aligned, but the type of this field may require higher alignment |
| 13 |
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) |
| 14 |
= 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) |
| 15 |
= note: this error originates in the macro `$crate::__pin_project_struct_make_proj_method` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 16 |
|
| 17 |
error[E0793]: reference to field of packed struct is unaligned |
| 18 |
--> tests/ui/pin_project/packed.rs:5:1 |
| 19 |
| |
| 20 |
5 | / pin_project! { //~ ERROR reference to packed field is unaligned |
| 21 |
6 | | #[repr(packed, C)] |
| 22 |
7 | | struct Packed { |
| 23 |
8 | | #[pin] |
| 24 |
... | |
| 25 |
11 | | } |
| 26 |
| |_^ |
| 27 |
| |
| 28 |
= note: this struct is 1-byte aligned, but the type of this field may require higher alignment |
| 29 |
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) |
| 30 |
= 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) |
| 31 |
= note: this error originates in the macro `$crate::__pin_project_struct_make_proj_method` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 32 |
|
| 33 |
error[E0793]: reference to field of packed struct is unaligned |
| 34 |
--> tests/ui/pin_project/packed.rs:5:1 |
| 35 |
| |
| 36 |
5 | / pin_project! { //~ ERROR reference to packed field is unaligned |
| 37 |
6 | | #[repr(packed, C)] |
| 38 |
7 | | struct Packed { |
| 39 |
8 | | #[pin] |
| 40 |
... | |
| 41 |
11 | | } |
| 42 |
| |_^ |
| 43 |
| |
| 44 |
= note: this struct is 1-byte aligned, but the type of this field may require higher alignment |
| 45 |
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) |
| 46 |
= 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) |
| 47 |
= note: this error originates in the macro `$crate::__pin_project_constant` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 48 |
|
| 49 |
error[E0793]: reference to field of packed struct is unaligned |
| 50 |
--> tests/ui/pin_project/packed.rs:13:1 |
| 51 |
| |
| 52 |
13 | / pin_project! { //~ ERROR reference to packed field is unaligned |
| 53 |
14 | | #[repr(packed(2))] |
| 54 |
15 | | struct PackedN { |
| 55 |
16 | | #[pin] |
| 56 |
... | |
| 57 |
19 | | } |
| 58 |
| |_^ |
| 59 |
| |
| 60 |
= note: this struct is at most 2-byte aligned, but the type of this field may require higher alignment |
| 61 |
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) |
| 62 |
= 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) |
| 63 |
= note: this error originates in the macro `$crate::__pin_project_struct_make_proj_method` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 64 |
|
| 65 |
error[E0793]: reference to field of packed struct is unaligned |
| 66 |
--> tests/ui/pin_project/packed.rs:13:1 |
| 67 |
| |
| 68 |
13 | / pin_project! { //~ ERROR reference to packed field is unaligned |
| 69 |
14 | | #[repr(packed(2))] |
| 70 |
15 | | struct PackedN { |
| 71 |
16 | | #[pin] |
| 72 |
... | |
| 73 |
19 | | } |
| 74 |
| |_^ |
| 75 |
| |
| 76 |
= note: this struct is at most 2-byte aligned, but the type of this field may require higher alignment |
| 77 |
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) |
| 78 |
= 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) |
| 79 |
= note: this error originates in the macro `$crate::__pin_project_struct_make_proj_method` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 80 |
|
| 81 |
error[E0793]: reference to field of packed struct is unaligned |
| 82 |
--> tests/ui/pin_project/packed.rs:13:1 |
| 83 |
| |
| 84 |
13 | / pin_project! { //~ ERROR reference to packed field is unaligned |
| 85 |
14 | | #[repr(packed(2))] |
| 86 |
15 | | struct PackedN { |
| 87 |
16 | | #[pin] |
| 88 |
... | |
| 89 |
19 | | } |
| 90 |
| |_^ |
| 91 |
| |
| 92 |
= note: this struct is at most 2-byte aligned, but the type of this field may require higher alignment |
| 93 |
= note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) |
| 94 |
= 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) |
| 95 |
= note: this error originates in the macro `$crate::__pin_project_constant` which comes from the expansion of the macro `pin_project` (in Nightly builds, run with -Z macro-backtrace for more info) |