about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRyan1729 <Ryan1729@gmail.com>2020-07-26 20:54:04 -0600
committerRyan1729 <Ryan1729@gmail.com>2020-07-26 20:54:04 -0600
commitfc20ee63a105c0df78113126e8749f5958d7dc47 (patch)
tree912801238eee58a067c10991f644b433c1ca6de2
parent5a644964fc05752a1283dab238b81de7583f7d03 (diff)
downloadrust-fc20ee63a105c0df78113126e8749f5958d7dc47.tar.gz
rust-fc20ee63a105c0df78113126e8749f5958d7dc47.zip
move derive_ord_xor_partial_ord into derive mod so we can reuse derive_hash_xor_partial_eq code later
-rw-r--r--clippy_lints/src/derive.rs23
-rw-r--r--clippy_lints/src/derive_ord_xor_partial_ord.rs28
-rw-r--r--clippy_lints/src/lib.rs7
-rw-r--r--src/lintlist/mod.rs2
4 files changed, 26 insertions, 34 deletions
diff --git a/clippy_lints/src/derive.rs b/clippy_lints/src/derive.rs
index 59c62f1ae94..627475ee1d9 100644
--- a/clippy_lints/src/derive.rs
+++ b/clippy_lints/src/derive.rs
@@ -44,6 +44,27 @@ declare_clippy_lint! {
 }
 
 declare_clippy_lint! {
+    /// **What it does:**
+    ///
+    /// **Why is this bad?**
+    ///
+    /// **Known problems:** None.
+    ///
+    /// **Example:**
+    ///
+    /// ```rust
+    /// // example code where clippy issues a warning
+    /// ```
+    /// Use instead:
+    /// ```rust
+    /// // example code which does not raise clippy warning
+    /// ```
+    pub DERIVE_ORD_XOR_PARTIAL_ORD,
+    correctness,
+    "default lint description"
+}
+
+declare_clippy_lint! {
     /// **What it does:** Checks for explicit `Clone` implementations for `Copy`
     /// types.
     ///
@@ -103,7 +124,7 @@ declare_clippy_lint! {
     "deriving `serde::Deserialize` on a type that has methods using `unsafe`"
 }
 
-declare_lint_pass!(Derive => [EXPL_IMPL_CLONE_ON_COPY, DERIVE_HASH_XOR_EQ, UNSAFE_DERIVE_DESERIALIZE]);
+declare_lint_pass!(Derive => [EXPL_IMPL_CLONE_ON_COPY, DERIVE_HASH_XOR_EQ, DERIVE_ORD_XOR_PARTIAL_ORD, UNSAFE_DERIVE_DESERIALIZE]);
 
 impl<'tcx> LateLintPass<'tcx> for Derive {
     fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'_>) {
diff --git a/clippy_lints/src/derive_ord_xor_partial_ord.rs b/clippy_lints/src/derive_ord_xor_partial_ord.rs
deleted file mode 100644
index 7913aab6f24..00000000000
--- a/clippy_lints/src/derive_ord_xor_partial_ord.rs
+++ /dev/null
@@ -1,28 +0,0 @@
-use rustc_lint::{LateLintPass, LateContext};
-use rustc_session::{declare_lint_pass, declare_tool_lint};
-use rustc_hir::*;
-
-declare_clippy_lint! {
-    /// **What it does:**
-    ///
-    /// **Why is this bad?**
-    ///
-    /// **Known problems:** None.
-    ///
-    /// **Example:**
-    ///
-    /// ```rust
-    /// // example code where clippy issues a warning
-    /// ```
-    /// Use instead:
-    /// ```rust
-    /// // example code which does not raise clippy warning
-    /// ```
-    pub DERIVE_ORD_XOR_PARTIAL_ORD,
-    correctness,
-    "default lint description"
-}
-
-declare_lint_pass!(DeriveOrdXorPartialOrd => [DERIVE_ORD_XOR_PARTIAL_ORD]);
-
-impl LateLintPass<'_, '_> for DeriveOrdXorPartialOrd {}
diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs
index 6d6dd06cc21..996aad31d3e 100644
--- a/clippy_lints/src/lib.rs
+++ b/clippy_lints/src/lib.rs
@@ -173,7 +173,6 @@ mod dbg_macro;
 mod default_trait_access;
 mod dereference;
 mod derive;
-mod derive_ord_xor_partial_ord;
 mod doc;
 mod double_comparison;
 mod double_parens;
@@ -514,9 +513,9 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
         &default_trait_access::DEFAULT_TRAIT_ACCESS,
         &dereference::EXPLICIT_DEREF_METHODS,
         &derive::DERIVE_HASH_XOR_EQ,
+        &derive::DERIVE_ORD_XOR_PARTIAL_ORD,
         &derive::EXPL_IMPL_CLONE_ON_COPY,
         &derive::UNSAFE_DERIVE_DESERIALIZE,
-        &derive_ord_xor_partial_ord::DERIVE_ORD_XOR_PARTIAL_ORD,
         &doc::DOC_MARKDOWN,
         &doc::MISSING_ERRORS_DOC,
         &doc::MISSING_SAFETY_DOC,
@@ -1232,7 +1231,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
         LintId::of(&copies::IFS_SAME_COND),
         LintId::of(&copies::IF_SAME_THEN_ELSE),
         LintId::of(&derive::DERIVE_HASH_XOR_EQ),
-        LintId::of(&derive_ord_xor_partial_ord::DERIVE_ORD_XOR_PARTIAL_ORD),
+        LintId::of(&derive::DERIVE_ORD_XOR_PARTIAL_ORD),
         LintId::of(&doc::MISSING_SAFETY_DOC),
         LintId::of(&doc::NEEDLESS_DOCTEST_MAIN),
         LintId::of(&double_comparison::DOUBLE_COMPARISONS),
@@ -1651,7 +1650,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
         LintId::of(&copies::IFS_SAME_COND),
         LintId::of(&copies::IF_SAME_THEN_ELSE),
         LintId::of(&derive::DERIVE_HASH_XOR_EQ),
-        LintId::of(&derive_ord_xor_partial_ord::DERIVE_ORD_XOR_PARTIAL_ORD),
+        LintId::of(&derive::DERIVE_ORD_XOR_PARTIAL_ORD),
         LintId::of(&drop_bounds::DROP_BOUNDS),
         LintId::of(&drop_forget_ref::DROP_COPY),
         LintId::of(&drop_forget_ref::DROP_REF),
diff --git a/src/lintlist/mod.rs b/src/lintlist/mod.rs
index 00d3df8f94f..011504710e1 100644
--- a/src/lintlist/mod.rs
+++ b/src/lintlist/mod.rs
@@ -365,7 +365,7 @@ pub static ref ALL_LINTS: Vec<Lint> = vec![
         group: "correctness",
         desc: "default lint description",
         deprecation: None,
-        module: "derive_ord_xor_partial_ord",
+        module: "derive",
     },
     Lint {
         name: "diverging_sub_expression",