incompatible_msrv
false positive: Trait methods of the same name
#12280
Labels
C-bug
Category: Clippy is not doing the correct thing
I-false-positive
Issue: The lint was triggered on code it shouldn't have
Summary
The
incompatible_msrv
lint fires when a method was stabilized more recently than the MSRV, but there is also a trait in scope with a method of the same name. In this case, on toolchains prior to stabilization, the trait's method will be chosen instead, and so compilation will still succeed. This technique is sometimes used to implement polyfills.To repro, run
cargo +nightly-2024-02-12 clippy -p zerocopy-derive
at this commit:The following code also exists in the same module:
Lint Name
incompatible_msrv
Version
nightly-2024-02-12
The text was updated successfully, but these errors were encountered: