]>
Commit | Line | Data |
---|---|---|
cdc7bbd5 | 1 | warning: reference to packed field is unaligned |
04454e1e | 2 | --> $DIR/packed-struct-borrow-element-64bit.rs:15:15 |
cdc7bbd5 XL |
3 | | |
4 | LL | 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 |
11 | note: the lint level is defined here |
12 | --> $DIR/packed-struct-borrow-element-64bit.rs:12:8 | |
13 | | | |
14 | LL | #[warn(unaligned_references)] | |
15 | | ^^^^^^^^^^^^^^^^^^^^ | |
cdc7bbd5 XL |
16 | |
17 | warning: 1 warning emitted | |
18 | ||
04454e1e FG |
19 | Future incompatibility report: Future breakage diagnostic: |
20 | warning: reference to packed field is unaligned | |
21 | --> $DIR/packed-struct-borrow-element-64bit.rs:15:15 | |
22 | | | |
23 | LL | 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 |
30 | note: the lint level is defined here |
31 | --> $DIR/packed-struct-borrow-element-64bit.rs:12:8 | |
32 | | | |
33 | LL | #[warn(unaligned_references)] | |
34 | | ^^^^^^^^^^^^^^^^^^^^ | |
04454e1e | 35 |