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