blob: 1853377dec0ca23690ac1172ebda5db57d7f8761 [file] [log] [blame]
error: borrow of packed field is unsafe and requires unsafe function or block (error E0133)
--> $DIR/packed.rs:3:1
|
3 | / pin_project! { //~ ERROR borrow of packed field is unsafe and requires unsafe function or block
4 | | #[repr(packed, C)]
5 | | struct A {
6 | | #[pin]
7 | | field: u16,
8 | | }
9 | | }
| |_^
|
note: lint level defined here
--> $DIR/packed.rs:3:1
|
3 | / pin_project! { //~ ERROR borrow of packed field is unsafe and requires unsafe function or block
4 | | #[repr(packed, C)]
5 | | struct A {
6 | | #[pin]
7 | | field: u16,
8 | | }
9 | | }
| |_^
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #46043 <https://github.com/rust-lang/rust/issues/46043>
= note: fields of packed structs might be misaligned: dereferencing a misaligned pointer or even just creating a misaligned reference is undefined behavior
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
error: borrow of packed field is unsafe and requires unsafe function or block (error E0133)
--> $DIR/packed.rs:11:1
|
11 | / pin_project! { //~ ERROR borrow of packed field is unsafe and requires unsafe function or block
12 | | #[repr(packed(2))]
13 | | struct C {
14 | | #[pin]
15 | | field: u32,
16 | | }
17 | | }
| |_^
|
note: lint level defined here
--> $DIR/packed.rs:11:1
|
11 | / pin_project! { //~ ERROR borrow of packed field is unsafe and requires unsafe function or block
12 | | #[repr(packed(2))]
13 | | struct C {
14 | | #[pin]
15 | | field: u32,
16 | | }
17 | | }
| |_^
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #46043 <https://github.com/rust-lang/rust/issues/46043>
= note: fields of packed structs might be misaligned: dereferencing a misaligned pointer or even just creating a misaligned reference is undefined behavior
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)