#14477·rust-clippy

feature request: `#[feature]` awareness in MSRV-gated lints

Author: tamirdCreated Mar 26, 2025Updated Sep 17, 2026
LabelsG-Rust-for-Linux

Some lints, such as borrow_as_ptr have conditional behavior based on MSRV: https://github.com/rust-lang/rust-clippy/blob/fe4dd5b92e603555594b9abef58405fc9f4f260e/clippy_lints/src/casts/borrow_as_ptr.rs#L31

In Rust-for-Linux, this is not sufficient because we enable a number of unstable features when we are reasonably confident their behavior won't change before stabilization, or because we know they have been stabilized without API change in a version that exceeds our configured MSRV.

It would be extremely helpful if these MSRV checks could be taught to also respect #[feature] attributes that enable unstable features ahead of the MSRV having been met. This is especially tricky when API has actually changed between the configured MSRV and the feature's actual stabilization.