]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-27060.stderr
Rollup merge of #53274 - bjorn3:remove_statics_field, r=nagisa
[rust.git] / src / test / ui / issues / issue-27060.stderr
1 error: borrow of packed field is unsafe and requires unsafe function or block (error E0133)
2   --> $DIR/issue-27060.rs:36:13
3    |
4 LL |     let _ = &good.data; //~ ERROR borrow of packed field is unsafe
5    |             ^^^^^^^^^^
6    |
7 note: lint level defined here
8   --> $DIR/issue-27060.rs:23:8
9    |
10 LL | #[deny(safe_packed_borrows)]
11    |        ^^^^^^^^^^^^^^^^^^^
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 #46043 <https://github.com/rust-lang/rust/issues/46043>
14    = note: fields of packed structs might be misaligned: dereferencing a misaligned pointer or even just creating a misaligned reference is undefined behavior
15
16 error: borrow of packed field is unsafe and requires unsafe function or block (error E0133)
17   --> $DIR/issue-27060.rs:38:13
18    |
19 LL |     let _ = &good.data2[0]; //~ ERROR borrow of packed field is unsafe
20    |             ^^^^^^^^^^^^^^
21    |
22    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
23    = note: for more information, see issue #46043 <https://github.com/rust-lang/rust/issues/46043>
24    = note: fields of packed structs might be misaligned: dereferencing a misaligned pointer or even just creating a misaligned reference is undefined behavior
25
26 error: aborting due to 2 previous errors
27