error: reference to packed field is unaligned --> $DIR/unaligned_references.rs:15:17 | LL | let _ = &good.ptr; | ^^^^^^^^^ | note: the lint level is defined here --> $DIR/unaligned_references.rs:1:9 | LL | #![deny(unaligned_references)] | ^^^^^^^^^^^^^^^^^^^^ = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) error: reference to packed field is unaligned --> $DIR/unaligned_references.rs:16:17 | LL | let _ = &good.data; | ^^^^^^^^^^ | = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) error: reference to packed field is unaligned --> $DIR/unaligned_references.rs:18:17 | LL | let _ = &good.data as *const _; | ^^^^^^^^^^ | = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) error: reference to packed field is unaligned --> $DIR/unaligned_references.rs:19:27 | LL | let _: *const _ = &good.data; | ^^^^^^^^^^ | = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) error: reference to packed field is unaligned --> $DIR/unaligned_references.rs:21:17 | LL | let _ = good.data.clone(); | ^^^^^^^^^ | = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) error: reference to packed field is unaligned --> $DIR/unaligned_references.rs:23:17 | LL | let _ = &good.data2[0]; | ^^^^^^^^^^^^^^ | = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) error: aborting due to 6 previous errors