Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temporarily ignore collection_is_never_read on FlattenSkipDeserializing #2794

Merged
merged 1 commit into from
Aug 11, 2024

Conversation

dtolnay
Copy link
Member

@dtolnay dtolnay commented Aug 11, 2024

@Mingun, this lint fires since #2567. Could you take a look at what should be generated for such a struct?

#[derive(Serialize, Deserialize)]
pub struct FlattenSkipDeserializing<T> {
#[serde(flatten, skip_deserializing)]
flat: T,
}

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)

    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)
@dtolnay dtolnay merged commit 84c7419 into serde-rs:master Aug 11, 2024
15 checks passed
@dtolnay dtolnay deleted the neverread branch August 11, 2024 07:05
@Mingun
Copy link
Contributor

Mingun commented Aug 11, 2024

Hm, that lints does not checked on CI? Why didn't it fired when CI ran #2567?

I'm finishing a PR to fix that and will open it soon.

@Mingun Mingun mentioned this pull request Aug 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants