Skip to content

Commit

Permalink
Temporarily ignore collection_is_never_read on FlattenSkipDeserializing
Browse files Browse the repository at this point in the history
    error: collection is never read
       --> test_suite/tests/test_gen.rs:723:25
        |
    723 |     #[derive(Serialize, Deserialize)]
        |                         ^^^^^^^^^^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collection_is_never_read
    note: the lint level is defined here
       --> test_suite/tests/test_gen.rs:23:9
        |
    23  | #![deny(clippy::collection_is_never_read)]
        |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        = note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)
  • Loading branch information
dtolnay committed Aug 11, 2024
1 parent fc55ac7 commit 536221b
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions test_suite/tests/test_gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -720,11 +720,14 @@ fn test_gen() {
flat: StdOption<T>,
}

#[derive(Serialize, Deserialize)]
pub struct FlattenSkipDeserializing<T> {
#[serde(flatten, skip_deserializing)]
flat: T,
}
#[allow(clippy::collection_is_never_read)] // FIXME
const _: () = {
#[derive(Serialize, Deserialize)]
pub struct FlattenSkipDeserializing<T> {
#[serde(flatten, skip_deserializing)]
flat: T,
}
};

#[derive(Serialize, Deserialize)]
#[serde(untagged)]
Expand Down

0 comments on commit 536221b

Please sign in to comment.