Summary
Currently, when running clippy on a code with MSRV of 1.96,
with a rust beta version, clippy's missing_trait_methods
notes that pin_drop is not implemented.
Of course, this diagnostic can be silenced with allow(),
but expect() is recommended, and then clippy will complain
when run on the rust stable version...
As per rust-lang/rust#158406, this is something that clippy should be smarter about.
It is possible that some other currently-MSRV-aware lints should also ignore unstable features.
Lint Name
missing_trait_methods
Reproducer
I tried this code:
struct S {}
#[warn(clippy::missing_trait_methods)]
impl Drop for S {
fn drop(&mut self) {
}
}
I saw this happen:
warning: missing trait method provided by default: `pin_drop`
--> <source>:4:1
|
4 | impl Drop for S {
| ^^^^^^^^^^^^^^^
|
= help: implement the missing `pin_drop` method of the `Drop` trait
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#missing_trait_methods
note: the lint level is defined here
--> <source>:3:8
|
3 | #[warn(clippy::missing_trait_methods)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
I expected to see this happen:
no-warning
Version
rustc 1.96.0 (ac68faa20 2026-05-25)
binary: rustc
commit-hash: ac68faa20c58cbccd01ee7208bf3b6e93a7d7f96
commit-date: 2026-05-25
host: x86_64-unknown-linux-gnu
release: 1.96.0
LLVM version: 22.1.2
Additional Labels
No response
Summary
Currently, when running clippy on a code with MSRV of
1.96,with a rust beta version, clippy's
missing_trait_methodsnotes that
pin_dropis not implemented.Of course, this diagnostic can be silenced with
allow(),but
expect()is recommended, and then clippy will complainwhen run on the rust stable version...
As per rust-lang/rust#158406, this is something that clippy should be smarter about.
It is possible that some other currently-MSRV-aware lints should also ignore unstable features.
Lint Name
missing_trait_methods
Reproducer
I tried this code:
I saw this happen:
I expected to see this happen:
no-warning
Version
Additional Labels
No response