This was introduced in rust 1.73. I'm not sure if this is the right spot to report this. I figure it was better here since this isn't a part of standard rust so a clippy issue didn't seem correct. Feel free to close the issue if this isn't the correct spot to handle it.
Having both a Ord and PartialOrd implementation that isn't just delegating to the Ord wrapping in Some will cause this. I assume it's based on how derivative's proc macros implement the traits cause rustc to look at it as if it were hand implemented.
As a user I would assume that using derivative to derive traits should generally function as close to directly using derive() as possible, e.g. to not have this reported when both traits are derived via derivative to match derive()'s behavior here.
As an end user I also couldn't find a place to put [allow(clippy::incorrect_partial_ord_impl_on_ord_type)] locally on the relevant types to suppress it, I imagine due to how derivative + the lint work.
Minimal repro example with rust 1.73 calling cargo clippy
This was introduced in rust 1.73. I'm not sure if this is the right spot to report this. I figure it was better here since this isn't a part of standard rust so a clippy issue didn't seem correct. Feel free to close the issue if this isn't the correct spot to handle it.
Having both a
Ord
andPartialOrd
implementation that isn't just delegating to theOrd
wrapping inSome
will cause this. I assume it's based on howderivative
's proc macros implement the traits cause rustc to look at it as if it were hand implemented.As a user I would assume that using
derivative
to derive traits should generally function as close to directly usingderive()
as possible, e.g. to not have this reported when both traits are derived viaderivative
to matchderive()
's behavior here.As an end user I also couldn't find a place to put
[allow(clippy::incorrect_partial_ord_impl_on_ord_type)]
locally on the relevant types to suppress it, I imagine due to howderivative
+ the lint work.Minimal repro example with rust 1.73 calling
cargo clippy