]>
Commit | Line | Data |
---|---|---|
6a06907d XL |
1 | error: reference to packed field is unaligned |
2 | --> $DIR/unaligned_references_external_macro.rs:7:1 | |
3 | | | |
4 | LL | / unaligned_references_external_crate::mac! { | |
5 | LL | | #[repr(packed)] | |
6 | LL | | pub struct X { | |
7 | LL | | pub field: u16 | |
8 | LL | | } | |
9 | LL | | } | |
10 | | |_^ | |
11 | | | |
12 | note: the lint level is defined here | |
13 | --> $DIR/unaligned_references_external_macro.rs:7:1 | |
14 | | | |
15 | LL | / unaligned_references_external_crate::mac! { | |
16 | LL | | #[repr(packed)] | |
17 | LL | | pub struct X { | |
18 | LL | | pub field: u16 | |
19 | LL | | } | |
20 | LL | | } | |
21 | | |_^ | |
22 | = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) | |
23 | = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) | |
24 | ||
25 | error: aborting due to previous error | |
26 |