• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1error[E0793]: reference to packed field is unaligned
2 --> tests/ui/pin_project/packed.rs:3:1
3  |
43 | / pin_project! { //~ ERROR reference to packed field is unaligned
54 | |     #[repr(packed, C)]
65 | |     struct Packed {
76 | |         #[pin]
87 | |         field: u16,
98 | |     }
109 | | }
11  | |_^
12  |
13  = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
14  = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
15  = 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)
16  = 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)
17
18error[E0793]: reference to packed field is unaligned
19 --> tests/ui/pin_project/packed.rs:3:1
20  |
213 | / pin_project! { //~ ERROR reference to packed field is unaligned
224 | |     #[repr(packed, C)]
235 | |     struct Packed {
246 | |         #[pin]
257 | |         field: u16,
268 | |     }
279 | | }
28  | |_^
29  |
30  = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
31  = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
32  = 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)
33  = 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)
34
35error[E0793]: reference to packed field is unaligned
36 --> tests/ui/pin_project/packed.rs:3:1
37  |
383 | / pin_project! { //~ ERROR reference to packed field is unaligned
394 | |     #[repr(packed, C)]
405 | |     struct Packed {
416 | |         #[pin]
427 | |         field: u16,
438 | |     }
449 | | }
45  | |_^
46  |
47  = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
48  = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
49  = 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)
50  = 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)
51
52error[E0793]: reference to packed field is unaligned
53  --> tests/ui/pin_project/packed.rs:11:1
54   |
5511 | / pin_project! { //~ ERROR reference to packed field is unaligned
5612 | |     #[repr(packed(2))]
5713 | |     struct PackedN {
5814 | |         #[pin]
5915 | |         field: u32,
6016 | |     }
6117 | | }
62   | |_^
63   |
64   = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
65   = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
66   = 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)
67   = 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)
68
69error[E0793]: reference to packed field is unaligned
70  --> tests/ui/pin_project/packed.rs:11:1
71   |
7211 | / pin_project! { //~ ERROR reference to packed field is unaligned
7312 | |     #[repr(packed(2))]
7413 | |     struct PackedN {
7514 | |         #[pin]
7615 | |         field: u32,
7716 | |     }
7817 | | }
79   | |_^
80   |
81   = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
82   = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
83   = 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)
84   = 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)
85
86error[E0793]: reference to packed field is unaligned
87  --> tests/ui/pin_project/packed.rs:11:1
88   |
8911 | / pin_project! { //~ ERROR reference to packed field is unaligned
9012 | |     #[repr(packed(2))]
9113 | |     struct PackedN {
9214 | |         #[pin]
9315 | |         field: u32,
9416 | |     }
9517 | | }
96   | |_^
97   |
98   = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
99   = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
100   = 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)
101   = 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)
102