Open
Description
The incompatible_msrv
lint doesn't recognize that code is gated by #[cfg(version(...))]
, and complains about the usage anyways.
Take this code:
#![feature(cfg_version)]
pub fn maybe_pipe() {
#[cfg(version("1.87"))]
let _ = std::io::pipe(); // stabilized in 1.87.0
}
With this toml:
[package]
name = "cfg-version-test"
version = "0.1.0"
edition = "2024"
rust-version = "1.85.0"
[dependencies]
It will lint, even though the code is fine:
warning: current MSRV (Minimum Supported Rust Version) is `1.85.0` but this item is stable since `1.87.0`
--> src/lib.rs:5:13
|
5 | let _ = std::io::pipe();
| ^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#incompatible_msrv
= note: `#[warn(clippy::incompatible_msrv)]` on by default
cc rust-lang/rust#64796 #[cfg(version(...))]
tracking issue
Metadata
Metadata
Assignees
Labels
No labels