]> git.lizzy.rs Git - rust.git/blob - src/test/ui/packed/packed-struct-borrow-element.stderr
Rollup merge of #83571 - a1phyr:feature_const_slice_first_last, r=dtolnay
[rust.git] / src / test / ui / packed / packed-struct-borrow-element.stderr
1 warning: reference to packed field is unaligned
2   --> $DIR/packed-struct-borrow-element.rs:25:15
3    |
4 LL |     let brw = &foo.baz;
5    |               ^^^^^^^^
6    |
7    = note: `#[warn(unaligned_references)]` on by default
8    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
9    = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
10    = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
11
12 warning: reference to packed field is unaligned
13   --> $DIR/packed-struct-borrow-element.rs:30:15
14    |
15 LL |     let brw = &foo.baz;
16    |               ^^^^^^^^
17    |
18    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
19    = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
20    = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
21
22 warning: 2 warnings emitted
23