From 6bd4c56249ff8778b0fcfd6067ad927b8f6a3850 Mon Sep 17 00:00:00 2001
From: Vincent Lafeychine <vincent.lafeychine@proton.me>
Date: Mon, 15 Apr 2024 20:28:45 +0200
Subject: [PATCH] clippy: Fix derive_partial_eq_without_eq

---
 rr_frontend/.cargo/config.toml                |  1 -
 rr_frontend/radium/src/code.rs                | 10 ++++----
 rr_frontend/radium/src/coq.rs                 |  6 ++---
 rr_frontend/radium/src/specs.rs               | 24 +++++++++----------
 .../src/environment/polonius_info.rs          |  2 +-
 rr_frontend/translation/src/traits.rs         |  2 +-
 6 files changed, 22 insertions(+), 23 deletions(-)

diff --git a/rr_frontend/.cargo/config.toml b/rr_frontend/.cargo/config.toml
index 4b7bf0b4..3f0e0e87 100644
--- a/rr_frontend/.cargo/config.toml
+++ b/rr_frontend/.cargo/config.toml
@@ -27,7 +27,6 @@ rustflags = [
     "-Aclippy::unused_io_amount",
 
     # clippy::nursery
-    "-Aclippy::derive_partial_eq_without_eq",
     "-Aclippy::empty_line_after_doc_comments",
     "-Aclippy::equatable_if_let",
     "-Aclippy::iter_on_single_items",
diff --git a/rr_frontend/radium/src/code.rs b/rr_frontend/radium/src/code.rs
index 53a5059f..aad611ac 100644
--- a/rr_frontend/radium/src/code.rs
+++ b/rr_frontend/radium/src/code.rs
@@ -180,7 +180,7 @@ impl RustType {
  * This is much more constrained than the Coq version of values, as we do not need to represent
  * runtime values.
  */
-#[derive(Clone, PartialEq, Debug)]
+#[derive(Clone, Eq, PartialEq, Debug)]
 pub enum Literal {
     LitI8(i8),
     LitI16(i16),
@@ -415,7 +415,7 @@ impl Display for Expr {
 }
 
 /// for unique/shared pointers
-#[derive(Clone, PartialEq, Debug)]
+#[derive(Clone, Eq, PartialEq, Debug)]
 pub enum Mutability {
     Mut,
     Shared,
@@ -432,7 +432,7 @@ impl Mutability {
 /**
  * Borrows allowed in Caesium
  */
-#[derive(Clone, PartialEq, Debug)]
+#[derive(Clone, Eq, PartialEq, Debug)]
 pub enum BorKind {
     Mutable,
     Shared,
@@ -668,7 +668,7 @@ impl Stmt {
     }
 }
 
-#[derive(Clone, PartialEq, Debug)]
+#[derive(Clone, Eq, PartialEq, Debug)]
 pub enum Unop {
     NegOp,
     NotBoolOp,
@@ -684,7 +684,7 @@ impl Display for Unop {
     }
 }
 
-#[derive(Clone, PartialEq, Debug)]
+#[derive(Clone, Eq, PartialEq, Debug)]
 pub enum Binop {
     //arithmetic
     AddOp,
diff --git a/rr_frontend/radium/src/coq.rs b/rr_frontend/radium/src/coq.rs
index 52cb79b5..e6675321 100644
--- a/rr_frontend/radium/src/coq.rs
+++ b/rr_frontend/radium/src/coq.rs
@@ -260,7 +260,7 @@ impl CoqType {
     }
 }
 
-#[derive(Clone, PartialEq, Debug)]
+#[derive(Clone, Eq, PartialEq, Debug)]
 pub struct CoqParamList(pub Vec<(CoqName, CoqType)>);
 
 impl CoqParamList {
@@ -283,7 +283,7 @@ impl Display for CoqParamList {
     }
 }
 
-#[derive(Clone, PartialEq, Debug)]
+#[derive(Clone, Eq, PartialEq, Debug)]
 pub struct CoqVariant {
     pub name: String,
     pub params: CoqParamList,
@@ -295,7 +295,7 @@ impl Display for CoqVariant {
     }
 }
 
-#[derive(Clone, PartialEq, Debug)]
+#[derive(Clone, Eq, PartialEq, Debug)]
 pub struct CoqInductive {
     pub name: String,
     pub parameters: CoqParamList,
diff --git a/rr_frontend/radium/src/specs.rs b/rr_frontend/radium/src/specs.rs
index db289e1e..23240ee8 100644
--- a/rr_frontend/radium/src/specs.rs
+++ b/rr_frontend/radium/src/specs.rs
@@ -329,14 +329,14 @@ impl SynType {
     }
 }
 
-#[derive(Copy, Clone, PartialEq, Debug)]
+#[derive(Copy, Clone, Eq, PartialEq, Debug)]
 pub enum TypeIsRaw {
     Yes,
     No,
 }
 
 /// Meta information from parsing type annotations
-#[derive(Clone, PartialEq, Debug)]
+#[derive(Clone, Eq, PartialEq, Debug)]
 pub struct TypeAnnotMeta {
     /// Used lifetime variables
     escaped_lfts: HashSet<Lft>,
@@ -372,7 +372,7 @@ impl TypeAnnotMeta {
     }
 }
 
-#[derive(Clone, PartialEq, Debug)]
+#[derive(Clone, Eq, PartialEq, Debug)]
 pub struct LiteralType {
     /// Rust name
     pub rust_name: Option<String>,
@@ -748,7 +748,7 @@ impl<'def> Type<'def> {
 }
 
 /// Specification for location ownership of a type.
-#[derive(Clone, PartialEq, Debug)]
+#[derive(Clone, Eq, PartialEq, Debug)]
 pub struct TyOwnSpec {
     loc: String,
     with_later: bool,
@@ -779,7 +779,7 @@ impl TyOwnSpec {
     }
 }
 
-#[derive(Clone, PartialEq, Debug)]
+#[derive(Clone, Eq, PartialEq, Debug)]
 pub enum InvariantSpecFlags {
     /// fully persistent and timeless invariant
     Persistent,
@@ -789,7 +789,7 @@ pub enum InvariantSpecFlags {
     Atomic,
 }
 
-#[derive(Clone, PartialEq, Debug)]
+#[derive(Clone, Eq, PartialEq, Debug)]
 pub enum InvariantMode {
     All,
     OnlyShared,
@@ -1169,7 +1169,7 @@ impl InvariantSpec {
 }
 
 /// Representation options for structs.
-#[derive(Copy, Clone, PartialEq, Debug)]
+#[derive(Copy, Clone, Eq, PartialEq, Debug)]
 /// Struct representation options supported by Radium
 pub enum StructRepr {
     ReprRust,
@@ -1187,7 +1187,7 @@ impl Display for StructRepr {
     }
 }
 
-#[derive(Copy, Clone, PartialEq, Debug)]
+#[derive(Copy, Clone, Eq, PartialEq, Debug)]
 /// Enum representation options supported by Radium
 pub enum EnumRepr {
     ReprRust,
@@ -1205,7 +1205,7 @@ impl Display for EnumRepr {
     }
 }
 
-#[derive(Copy, Clone, PartialEq, Debug)]
+#[derive(Copy, Clone, Eq, PartialEq, Debug)]
 /// Union representation options supported by Radium
 pub enum UnionRepr {
     ReprRust,
@@ -1843,7 +1843,7 @@ impl<'def> AbstractStructUse<'def> {
 }
 
 /// Specification of an enum in terms of a Coq type refining it.
-#[derive(Clone, PartialEq, Debug)]
+#[derive(Clone, Eq, PartialEq, Debug)]
 pub struct EnumSpec {
     /// the refinement type of the enum
     pub rfn_type: CoqType,
@@ -2518,7 +2518,7 @@ impl Layout {
 // - DeBruijn probably not worth it, I don't need subst or anything like that. just try to keep variables
 //   apart when generating them.
 
-#[derive(Clone, PartialEq, Debug)]
+#[derive(Clone, Eq, PartialEq, Debug)]
 pub struct CoqBinder(CoqName, CoqType);
 impl CoqBinder {
     pub fn new(n: CoqName, t: CoqType) -> Self {
@@ -2629,7 +2629,7 @@ pub struct LoopSpec {
     pub func_predicate: IPropPredicate,
 }
 
-#[derive(Clone, PartialEq, Debug)]
+#[derive(Clone, Eq, PartialEq, Debug)]
 pub struct CoqParam {
     /// the name
     pub name: CoqName,
diff --git a/rr_frontend/translation/src/environment/polonius_info.rs b/rr_frontend/translation/src/environment/polonius_info.rs
index 60ad0c9b..1122b584 100644
--- a/rr_frontend/translation/src/environment/polonius_info.rs
+++ b/rr_frontend/translation/src/environment/polonius_info.rs
@@ -93,7 +93,7 @@ impl AtomicRegion {
 }
 
 /// for an overview fo universal regions, see also rustc_borrowck/src/universal_regions.rs
-#[derive(Copy, Clone, PartialEq, Debug)]
+#[derive(Copy, Clone, Eq, PartialEq, Debug)]
 pub enum UniversalRegionKind {
     /// the static region
     Static,
diff --git a/rr_frontend/translation/src/traits.rs b/rr_frontend/translation/src/traits.rs
index 34e160cc..5fb7fe02 100644
--- a/rr_frontend/translation/src/traits.rs
+++ b/rr_frontend/translation/src/traits.rs
@@ -105,7 +105,7 @@ pub fn resolve_trait<'tcx>(
     }
 }
 
-#[derive(Copy, Clone, PartialEq, Debug)]
+#[derive(Copy, Clone, Eq, PartialEq, Debug)]
 pub enum TraitResolutionKind {
     Param,
     UserDefined,
-- 
GitLab