Skip to content

Rustc does not take version requirements into account with deprecation warnings #15907

@rom1v

Description

@rom1v

Problem

My project uses quinn with version =0.11.8, and calls the method with_platform_verifier() which has been deprecated in 0.11.9.

Yet, cargo clippy reports an error, and suggests to call try_with_platform_verifier() which does not exist in quinn 0.11.8:

warning: use of deprecated associated function `quinn::ClientConfig::with_platform_verifier`: use `try_with_platform_verifier()` instead
 --> src/main.rs:2:34
  |
2 |     let _ = quinn::ClientConfig::with_platform_verifier();
  |                                  ^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(deprecated)]` on by default

warning: `clippybug` (bin "clippybug") generated 1 warning
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.04s

Steps

Create a new project clippybug, with:

Cargo.toml:

[package]
name = "clippybug"
version = "0.1.0"
edition = "2024"

[dependencies]
quinn = "=0.11.8"

src/main.rs:

fn main() {
    let _ = quinn::ClientConfig::with_platform_verifier();
}

And run cargo clippy.

Possible Solution(s)

No response

Notes

No response

Version

cargo 1.88.0 (873a06493 2025-05-10)
release: 1.88.0
commit-hash: 873a0649350c486caf67be772828a4f36bb4734c
commit-date: 2025-05-10
host: x86_64-unknown-linux-gnu
libgit2: 1.9.0 (sys:0.20.0 vendored)
libcurl: 8.12.1-DEV (sys:0.4.80+curl-8.12.1 vendored ssl:OpenSSL/3.4.1)
ssl: OpenSSL 3.4.1 11 Feb 2025
os: Debian n/a (forky) [64-bit]

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-build-executionArea: anything dealing with executing the compilerA-crate-dependenciesArea: [dependencies] of any kindC-bugCategory: bugS-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions