Skip to content

Commit

Permalink
Resolve repr_packed_without_abi clippy lint in tests
Browse files Browse the repository at this point in the history
    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
  • Loading branch information
dtolnay committed Dec 27, 2024
1 parent 2a5caea commit b6f339c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test_suite/tests/test_gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ fn test_gen() {
}

#[derive(Serialize)]
#[repr(packed)]
#[repr(C, packed)]
#[allow(dead_code)]
struct Packed {
x: u8,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit b6f339c

Please sign in to comment.