diff options
Diffstat (limited to 'tests/ui/pin_project/packed.stderr')
-rw-r--r-- | tests/ui/pin_project/packed.stderr | 130 |
1 files changed, 39 insertions, 91 deletions
diff --git a/tests/ui/pin_project/packed.stderr b/tests/ui/pin_project/packed.stderr index 14ffc86..85f84c2 100644 --- a/tests/ui/pin_project/packed.stderr +++ b/tests/ui/pin_project/packed.stderr @@ -1,107 +1,55 @@ error: reference to packed field is unaligned - --> $DIR/packed.rs:3:1 - | -3 | / pin_project! { //~ ERROR reference to packed field is unaligned -4 | | #[repr(packed, C)] -5 | | struct Packed { -6 | | #[pin] -7 | | field: u16, -8 | | } -9 | | } - | |_^ - | -note: the lint level is defined here - --> $DIR/packed.rs:3:1 - | -3 | / pin_project! { //~ ERROR reference to packed field is unaligned -4 | | #[repr(packed, C)] -5 | | struct Packed { -6 | | #[pin] -7 | | field: u16, -8 | | } -9 | | } - | |_^ - = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) - = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) - -error: reference to packed field is unaligned - --> $DIR/packed.rs:11:1 + --> $DIR/packed.rs:5:1 | -11 | / pin_project! { //~ ERROR reference to packed field is unaligned -12 | | #[repr(packed(2))] -13 | | struct PackedN { -14 | | #[pin] -15 | | field: u32, -16 | | } -17 | | } +5 | / pin_project! { //~ ERROR reference to packed field is unaligned +6 | | #[repr(packed, C)] +7 | | struct Packed { +8 | | #[pin] +9 | | field: u16, +10 | | } +11 | | } | |_^ | note: the lint level is defined here - --> $DIR/packed.rs:11:1 + --> $DIR/packed.rs:5:1 | -11 | / pin_project! { //~ ERROR reference to packed field is unaligned -12 | | #[repr(packed(2))] -13 | | struct PackedN { -14 | | #[pin] -15 | | field: u32, -16 | | } -17 | | } +5 | / pin_project! { //~ ERROR reference to packed field is unaligned +6 | | #[repr(packed, C)] +7 | | struct Packed { +8 | | #[pin] +9 | | field: u16, +10 | | } +11 | | } | |_^ + = 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 #82523 <https://github.com/rust-lang/rust/issues/82523> = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) - = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `$crate::__pin_project_internal` (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:3:1 - | -3 | / pin_project! { //~ ERROR reference to packed field is unaligned -4 | | #[repr(packed, C)] -5 | | struct Packed { -6 | | #[pin] -7 | | field: u16, -8 | | } -9 | | } - | |_^ - | -note: the lint level is defined here - --> $DIR/packed.rs:3:1 - | -3 | / pin_project! { //~ ERROR reference to packed field is unaligned -4 | | #[repr(packed, C)] -5 | | struct Packed { -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 +error: reference to packed field is unaligned + --> $DIR/packed.rs:13:1 | -11 | / pin_project! { //~ ERROR reference to packed field is unaligned -12 | | #[repr(packed(2))] -13 | | struct PackedN { -14 | | #[pin] -15 | | field: u32, -16 | | } -17 | | } +13 | / pin_project! { //~ ERROR reference to packed field is unaligned +14 | | #[repr(packed(2))] +15 | | struct PackedN { +16 | | #[pin] +17 | | field: u32, +18 | | } +19 | | } | |_^ | note: the lint level is defined here - --> $DIR/packed.rs:11:1 + --> $DIR/packed.rs:13:1 | -11 | / pin_project! { //~ ERROR reference to packed field is unaligned -12 | | #[repr(packed(2))] -13 | | struct PackedN { -14 | | #[pin] -15 | | field: u32, -16 | | } -17 | | } +13 | / pin_project! { //~ ERROR reference to packed field is unaligned +14 | | #[repr(packed(2))] +15 | | struct PackedN { +16 | | #[pin] +17 | | field: u32, +18 | | } +19 | | } | |_^ = 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) + = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523> + = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) + = note: this error originates in the macro `$crate::__pin_project_internal` (in Nightly builds, run with -Z macro-backtrace for more info) |