mirror of
https://github.com/rust-lang/rust-clippy
synced 2025-03-02 14:27:19 +00:00
Add derive_ord_xor_partial_ord lint
Fix #1621
Some remarks:
This PR follows the example of the analogous derive_hash_xor_partial_eq lint where possible.
I initially tried using the `match_path` function to identify `Ord` implementation like the derive_hash_xor_partial_eq lint currently does, for `Hash` implementations but that didn't work.
Specifically, the structs at the top level were getting paths that matched `&["$crate", "cmp", "Ord"]` instead of `&["std", "cmp", "Ord"]`. While trying to figure out what to do instead I saw the comment at the top of [clippy_lints/src/utils/paths.rs](
|
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
README.md |