1 warning: reference to packed field is unaligned
2 --> $DIR/packed-struct-borrow-element.rs:26:15
4 LL | let brw = &foo.baz;
7 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
8 = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
9 = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
10 = 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)
11 note: the lint level is defined here
12 --> $DIR/packed-struct-borrow-element.rs:23:8
14 LL | #[warn(unaligned_references)]
15 | ^^^^^^^^^^^^^^^^^^^^
17 warning: reference to packed field is unaligned
18 --> $DIR/packed-struct-borrow-element.rs:31:15
20 LL | let brw = &foo.baz;
23 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
24 = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
25 = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
26 = 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)
28 warning: 2 warnings emitted
30 Future incompatibility report: Future breakage diagnostic:
31 warning: reference to packed field is unaligned
32 --> $DIR/packed-struct-borrow-element.rs:26:15
34 LL | let brw = &foo.baz;
37 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
38 = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
39 = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
40 = 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)
41 note: the lint level is defined here
42 --> $DIR/packed-struct-borrow-element.rs:23:8
44 LL | #[warn(unaligned_references)]
45 | ^^^^^^^^^^^^^^^^^^^^
47 Future breakage diagnostic:
48 warning: reference to packed field is unaligned
49 --> $DIR/packed-struct-borrow-element.rs:31:15
51 LL | let brw = &foo.baz;
54 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
55 = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
56 = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
57 = 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)
58 note: the lint level is defined here
59 --> $DIR/packed-struct-borrow-element.rs:23:8
61 LL | #[warn(unaligned_references)]
62 | ^^^^^^^^^^^^^^^^^^^^