]> git.lizzy.rs Git - rust.git/blob - src/test/ui/lint/unaligned_references_external_macro.stderr
Rollup merge of #87180 - notriddle:notriddle/sidebar-keyboard-mobile, r=GuillaumeGomez
[rust.git] / src / test / ui / lint / unaligned_references_external_macro.stderr
1 error: reference to packed field is unaligned
2   --> $DIR/unaligned_references_external_macro.rs:5:1
3    |
4 LL | / unaligned_references_external_crate::mac! {
5 LL | |
6 LL | |     #[repr(packed)]
7 LL | |     pub struct X {
8 LL | |         pub field: u16
9 LL | |     }
10 LL | | }
11    | |_^
12    |
13 note: the lint level is defined here
14   --> $DIR/unaligned_references_external_macro.rs:5:1
15    |
16 LL | / unaligned_references_external_crate::mac! {
17 LL | |
18 LL | |     #[repr(packed)]
19 LL | |     pub struct X {
20 LL | |         pub field: u16
21 LL | |     }
22 LL | | }
23    | |_^
24    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
25    = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
26    = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
27    = note: this error originates in the macro `unaligned_references_external_crate::mac` (in Nightly builds, run with -Z macro-backtrace for more info)
28
29 error: aborting due to previous error
30