]> git.lizzy.rs Git - rust.git/blob - tests/ui/packed/packed-struct-borrow-element.stderr
Rollup merge of #106797 - FawazTirmizi:dev/issues/104284, r=bjorn3
[rust.git] / tests / ui / packed / packed-struct-borrow-element.stderr
1 warning: reference to packed field is unaligned
2   --> $DIR/packed-struct-borrow-element.rs:26:15
3    |
4 LL |     let brw = &foo.baz;
5    |               ^^^^^^^^
6    |
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
13    |
14 LL | #[warn(unaligned_references)]
15    |        ^^^^^^^^^^^^^^^^^^^^
16
17 warning: reference to packed field is unaligned
18   --> $DIR/packed-struct-borrow-element.rs:31:15
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)
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)
27
28 warning: 2 warnings emitted
29
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    = 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
43    |
44 LL | #[warn(unaligned_references)]
45    |        ^^^^^^^^^^^^^^^^^^^^
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    = 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
60    |
61 LL | #[warn(unaligned_references)]
62    |        ^^^^^^^^^^^^^^^^^^^^
63