Skip to content

Clippy is incompatible with serde 1.0.107 #8378

Closed
@kornelski

Description

@kornelski

Summary

Re #7606

The version of serde specified in Cargo.toml is too low, and incompatible with this crate.

test compile_test ... FAILED

failures:

---- compile_test stdout ----
diff of stderr:

 error[E0412]: cannot find type `PhantomData` in this scope
   --> $DIR/ice-6252.rs:8:9
    |
 LL |     _n: PhantomData,
    |         ^^^^^^^^^^^ not found in this scope
    |
 help: consider importing one of these items
    |
 LL | use core::marker::PhantomData;
    |
-LL | use serde::__private::PhantomData;
+LL | use serde::export::PhantomData;
    |
 LL | use std::marker::PhantomData;
    |

 error[E0412]: cannot find type `VAL` in this scope
   --> $DIR/ice-6252.rs:10:63

Reproducer

Clippy asks for serde 1.0.0, which is even lower, but currently the lowest possible version is 1.0.107, because that's what cargo_metadata crate specifies, and this forces this version for the whole project (Cargo doesn't duplicate dependencies with the same semver-major version).

cargo update -p serde --precise 1.0.107
cargo test --all

The same tests pass if you do:

cargo update -p serde

to bump serde to 1.0.136. Somewhere between 107 and 136 serde has changed its behavior, and the tests rely on the later serde version.

Version

rustc 1.60.0-nightly (6abb6385b 2022-01-26)
binary: rustc
commit-hash: 6abb6385b2cb7249f67b9b3ce7522527767dd907
commit-date: 2022-01-26
host: aarch64-apple-darwin
release: 1.60.0-nightly
LLVM version: 13.0.0

Additional Labels

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-infraArea: CI issues and issues that require full access for GitHub/CIE-help-wantedCall for participation: Help is requested to fix this issue.good first issueThese issues are a good way to get started with Clippy

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions