Skip to content

Commit

Permalink
chore/easy: ord clippy lint (MystenLabs#14356)
Browse files Browse the repository at this point in the history
## Description 

This is the last cleanup for the outstanding lints from
MystenLabs#14167
In order to preserve existing behavior, it was easier to selectively
ignore the lints on specific files.

## Test Plan 

Existing
---
If your changes are not user-facing and not a breaking change, you can
skip the following section. Otherwise, please indicate what changed, and
then add to the Release Notes section as highlighted during the release
process.

### Type of Change (Check all that apply)

- [ ] protocol change
- [ ] user-visible impact
- [ ] breaking change for a client SDKs
- [ ] breaking change for FNs (FN binary must upgrade)
- [ ] breaking change for validators or node operators (must upgrade
binaries)
- [ ] breaking change for on-chain data layout
- [ ] necessitate either a data wipe or data migration

### Release notes
  • Loading branch information
oxade authored and jonas-lj committed Nov 2, 2023
1 parent 4c250ff commit 674ba3b
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 2 deletions.
1 change: 0 additions & 1 deletion .cargo/config
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ move-clippy = [
"-Aclippy::new_without_default",
"-Aclippy::box_default",
"-Aclippy::manual_slice_size_calculation",
"-Aclippy::incorrect_partial_ord_impl_on_ord_type",
]

[build]
Expand Down
3 changes: 3 additions & 0 deletions external-crates/move/move-analyzer/src/symbols.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
//! definitions, the symbolicator builds a scope stack, entering encountered definitions and
//! matching uses to a definition in the innermost scope.
#![allow(clippy::incorrect_partial_ord_impl_on_ord_type)]

use crate::{
context::Context,
diagnostics::{lsp_diagnostics, lsp_empty_diagnostics},
Expand Down Expand Up @@ -167,6 +169,7 @@ struct StructDef {
field_defs: Vec<FieldDef>,
}

#[allow(clippy::incorrect_partial_ord_impl_on_ord_type)]
#[derive(Derivative, Debug, Clone, PartialEq, Eq)]
#[derivative(PartialOrd, Ord)]
pub struct FunctionDef {
Expand Down
1 change: 1 addition & 0 deletions external-crates/move/move-borrow-graph/src/references.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ impl<Loc: Copy, Lbl: Clone + Ord> PartialEq for BorrowEdge<Loc, Lbl> {

impl<Loc: Copy, Lbl: Clone + Ord> Eq for BorrowEdge<Loc, Lbl> {}

#[allow(clippy::incorrect_partial_ord_impl_on_ord_type)]
impl<Loc: Copy, Lbl: Clone + Ord> PartialOrd for BorrowEdge<Loc, Lbl> {
fn partial_cmp(&self, other: &BorrowEdge<Loc, Lbl>) -> Option<Ordering> {
BorrowEdgeNoLoc::new(self).partial_cmp(&BorrowEdgeNoLoc::new(other))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ impl<T: TName> PartialEq for UniqueSet<T> {
}
impl<T: TName> Eq for UniqueSet<T> {}

#[allow(clippy::incorrect_partial_ord_impl_on_ord_type)]
impl<T: TName> PartialOrd for UniqueSet<T> {
fn partial_cmp(&self, other: &UniqueSet<T>) -> Option<Ordering> {
(self.0).0.keys().partial_cmp((other.0).0.keys())
Expand Down
2 changes: 1 addition & 1 deletion external-crates/move/move-core/types/src/gas_algebra.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ impl<U> Eq for GasQuantity<U> {}

impl<U> PartialOrd for GasQuantity<U> {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
Some(self.cmp_impl(other))
Some(std::cmp::Ord::cmp(self, other))
}
}

Expand Down

0 comments on commit 674ba3b

Please sign in to comment.