blob: a9761635125d1e3f7659972835041529e67db713 [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: the lint level is 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 (in Nightly builds, run with -Z 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: the lint level is 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 (in Nightly builds, run with -Z macro-backtrace for more info)