Skip to content

Commit b6f339c

Browse files
committed
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
1 parent 2a5caea commit b6f339c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test_suite/tests/test_gen.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ fn test_gen() {
769769
}
770770

771771
#[derive(Serialize)]
772-
#[repr(packed)]
772+
#[repr(C, packed)]
773773
#[allow(dead_code)]
774774
struct Packed {
775775
x: u8,
@@ -915,14 +915,14 @@ where
915915

916916
//////////////////////////////////////////////////////////////////////////
917917

918-
#[repr(packed)]
918+
#[repr(C, packed)]
919919
pub struct RemotePacked {
920920
pub a: u16,
921921
pub b: u32,
922922
}
923923

924924
#[derive(Serialize)]
925-
#[repr(packed)]
925+
#[repr(C, packed)]
926926
#[serde(remote = "RemotePacked")]
927927
pub struct RemotePackedDef {
928928
a: u16,
@@ -933,14 +933,14 @@ impl Drop for RemotePackedDef {
933933
fn drop(&mut self) {}
934934
}
935935

936-
#[repr(packed)]
936+
#[repr(C, packed)]
937937
pub struct RemotePackedNonCopy {
938938
pub a: u16,
939939
pub b: String,
940940
}
941941

942942
#[derive(Deserialize)]
943-
#[repr(packed)]
943+
#[repr(C, packed)]
944944
#[serde(remote = "RemotePackedNonCopy")]
945945
pub struct RemotePackedNonCopyDef {
946946
a: u16,

0 commit comments

Comments
 (0)