Update needed for Rust v1.73.0
error: incorrect implementation of `partial_cmp` on an `Ord` type
--> frameworks/native/libs/binder/rust/src/binder.rs:437:1
|
437 | / impl<I: FromIBinder + ?Sized> PartialOrd for Strong<I> {
438 | | fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
| | _____________________________________________________________-
439 | || self.0.as_binder().partial_cmp(&other.0.as_binder())
440 | || }
| ||_____- help: change this to: `{ Some(self.cmp(other)) }`
441 | | }
| |__^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#incorrect_partial_ord_impl_on_ord_type
= note: `#[deny(clippy::incorrect_partial_ord_impl_on_ord_type)]` on by default
Bug: 303252546
Test: ./test_compiler.py --prebuilt-path dist/rust-dev.tar.xz --target aosp_cf_x86_64_phone --image
Change-Id: Ied87ef07475b0ed8e430b622be68b211d58ef89f
diff --git a/libs/binder/rust/src/binder.rs b/libs/binder/rust/src/binder.rs
index 463c210..a08cb7a 100644
--- a/libs/binder/rust/src/binder.rs
+++ b/libs/binder/rust/src/binder.rs
@@ -436,7 +436,7 @@
impl<I: FromIBinder + ?Sized> PartialOrd for Strong<I> {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
- self.0.as_binder().partial_cmp(&other.0.as_binder())
+ Some(self.cmp(other))
}
}
@@ -483,7 +483,7 @@
impl<I: FromIBinder + ?Sized> PartialOrd for Weak<I> {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
- self.weak_binder.partial_cmp(&other.weak_binder)
+ Some(self.cmp(other))
}
}