From b6f339ca3676584e1c26028b4040c337b0105e34 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Thu, 26 Dec 2024 18:33:27 -0800 Subject: [PATCH] Resolve repr_packed_without_abi clippy lint in tests warning: item uses `packed` representation without ABI-qualification --> test_suite/tests/test_gen.rs:774:5 | 772 | #[repr(packed)] | ------ `packed` representation set here 773 | #[allow(dead_code)] 774 | / struct Packed { 775 | | x: u8, 776 | | y: u16, 777 | | } | |_____^ | = warning: unqualified `#[repr(packed)]` defaults to `#[repr(Rust, packed)]`, which has no stable ABI = help: qualify the desired ABI explicity via `#[repr(C, packed)]` or `#[repr(Rust, packed)]` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#repr_packed_without_abi note: the lint level is defined here --> test_suite/tests/test_gen.rs:5:9 | 5 | #![deny(warnings)] | ^^^^^^^^ = note: `#[warn(clippy::repr_packed_without_abi)]` implied by `#[warn(warnings)]` warning: item uses `packed` representation without ABI-qualification --> test_suite/tests/test_gen.rs:919:1 | 918 | #[repr(packed)] | ------ `packed` representation set here 919 | / pub struct RemotePacked { 920 | | pub a: u16, 921 | | pub b: u32, 922 | | } | |_^ | = warning: unqualified `#[repr(packed)]` defaults to `#[repr(Rust, packed)]`, which has no stable ABI = help: qualify the desired ABI explicity via `#[repr(C, packed)]` or `#[repr(Rust, packed)]` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#repr_packed_without_abi warning: item uses `packed` representation without ABI-qualification --> test_suite/tests/test_gen.rs:927:1 | 925 | #[repr(packed)] | ------ `packed` representation set here 926 | #[serde(remote = "RemotePacked")] 927 | / pub struct RemotePackedDef { 928 | | a: u16, 929 | | b: u32, 930 | | } | |_^ | = warning: unqualified `#[repr(packed)]` defaults to `#[repr(Rust, packed)]`, which has no stable ABI = help: qualify the desired ABI explicity via `#[repr(C, packed)]` or `#[repr(Rust, packed)]` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#repr_packed_without_abi warning: item uses `packed` representation without ABI-qualification --> test_suite/tests/test_gen.rs:937:1 | 936 | #[repr(packed)] | ------ `packed` representation set here 937 | / pub struct RemotePackedNonCopy { 938 | | pub a: u16, 939 | | pub b: String, 940 | | } | |_^ | = warning: unqualified `#[repr(packed)]` defaults to `#[repr(Rust, packed)]`, which has no stable ABI = help: qualify the desired ABI explicity via `#[repr(C, packed)]` or `#[repr(Rust, packed)]` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#repr_packed_without_abi warning: item uses `packed` representation without ABI-qualification --> test_suite/tests/test_gen.rs:945:1 | 943 | #[repr(packed)] | ------ `packed` representation set here 944 | #[serde(remote = "RemotePackedNonCopy")] 945 | / pub struct RemotePackedNonCopyDef { 946 | | a: u16, 947 | | b: String, 948 | | } | |_^ | = warning: unqualified `#[repr(packed)]` defaults to `#[repr(Rust, packed)]`, which has no stable ABI = help: qualify the desired ABI explicity via `#[repr(C, packed)]` or `#[repr(Rust, packed)]` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#repr_packed_without_abi --- test_suite/tests/test_gen.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test_suite/tests/test_gen.rs b/test_suite/tests/test_gen.rs index ed9dc725..e7338e35 100644 --- a/test_suite/tests/test_gen.rs +++ b/test_suite/tests/test_gen.rs @@ -769,7 +769,7 @@ fn test_gen() { } #[derive(Serialize)] - #[repr(packed)] + #[repr(C, packed)] #[allow(dead_code)] struct Packed { x: u8, @@ -915,14 +915,14 @@ where ////////////////////////////////////////////////////////////////////////// -#[repr(packed)] +#[repr(C, packed)] pub struct RemotePacked { pub a: u16, pub b: u32, } #[derive(Serialize)] -#[repr(packed)] +#[repr(C, packed)] #[serde(remote = "RemotePacked")] pub struct RemotePackedDef { a: u16, @@ -933,14 +933,14 @@ impl Drop for RemotePackedDef { fn drop(&mut self) {} } -#[repr(packed)] +#[repr(C, packed)] pub struct RemotePackedNonCopy { pub a: u16, pub b: String, } #[derive(Deserialize)] -#[repr(packed)] +#[repr(C, packed)] #[serde(remote = "RemotePackedNonCopy")] pub struct RemotePackedNonCopyDef { a: u16,