diff options
Diffstat (limited to 'third_party/rust/pin-project-lite/tests/ui/packed.stderr')
-rw-r--r-- | third_party/rust/pin-project-lite/tests/ui/packed.stderr | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/third_party/rust/pin-project-lite/tests/ui/packed.stderr b/third_party/rust/pin-project-lite/tests/ui/packed.stderr new file mode 100644 index 0000000000..1853377dec --- /dev/null +++ b/third_party/rust/pin-project-lite/tests/ui/packed.stderr @@ -0,0 +1,55 @@ +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) |