]> git.proxmox.com Git - rustc.git/blame - src/test/ui/packed/packed-struct-borrow-element-64bit.stderr
New upstream version 1.66.0+dfsg1
[rustc.git] / src / test / ui / packed / packed-struct-borrow-element-64bit.stderr
CommitLineData
cdc7bbd5 1warning: reference to packed field is unaligned
04454e1e 2 --> $DIR/packed-struct-borrow-element-64bit.rs:15:15
cdc7bbd5
XL
3 |
4LL | let brw = &foo.baz;
5 | ^^^^^^^^
6 |
2b03887a
FG
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)
04454e1e
FG
11note: the lint level is defined here
12 --> $DIR/packed-struct-borrow-element-64bit.rs:12:8
13 |
14LL | #[warn(unaligned_references)]
15 | ^^^^^^^^^^^^^^^^^^^^
cdc7bbd5
XL
16
17warning: 1 warning emitted
18
04454e1e
FG
19Future incompatibility report: Future breakage diagnostic:
20warning: reference to packed field is unaligned
21 --> $DIR/packed-struct-borrow-element-64bit.rs:15:15
22 |
23LL | let brw = &foo.baz;
24 | ^^^^^^^^
25 |
2b03887a
FG
26 = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
27 = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
28 = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
29 = 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)
04454e1e
FG
30note: the lint level is defined here
31 --> $DIR/packed-struct-borrow-element-64bit.rs:12:8
32 |
33LL | #[warn(unaligned_references)]
34 | ^^^^^^^^^^^^^^^^^^^^
04454e1e 35