Skip to content

Commit fc20ee6

Browse files
committed
move derive_ord_xor_partial_ord into derive mod so we can reuse derive_hash_xor_partial_eq code later
1 parent 5a64496 commit fc20ee6

File tree

4 files changed

+26
-34
lines changed

4 files changed

+26
-34
lines changed

clippy_lints/src/derive.rs

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,27 @@ declare_clippy_lint! {
4343
"deriving `Hash` but implementing `PartialEq` explicitly"
4444
}
4545

46+
declare_clippy_lint! {
47+
/// **What it does:**
48+
///
49+
/// **Why is this bad?**
50+
///
51+
/// **Known problems:** None.
52+
///
53+
/// **Example:**
54+
///
55+
/// ```rust
56+
/// // example code where clippy issues a warning
57+
/// ```
58+
/// Use instead:
59+
/// ```rust
60+
/// // example code which does not raise clippy warning
61+
/// ```
62+
pub DERIVE_ORD_XOR_PARTIAL_ORD,
63+
correctness,
64+
"default lint description"
65+
}
66+
4667
declare_clippy_lint! {
4768
/// **What it does:** Checks for explicit `Clone` implementations for `Copy`
4869
/// types.
@@ -103,7 +124,7 @@ declare_clippy_lint! {
103124
"deriving `serde::Deserialize` on a type that has methods using `unsafe`"
104125
}
105126

106-
declare_lint_pass!(Derive => [EXPL_IMPL_CLONE_ON_COPY, DERIVE_HASH_XOR_EQ, UNSAFE_DERIVE_DESERIALIZE]);
127+
declare_lint_pass!(Derive => [EXPL_IMPL_CLONE_ON_COPY, DERIVE_HASH_XOR_EQ, DERIVE_ORD_XOR_PARTIAL_ORD, UNSAFE_DERIVE_DESERIALIZE]);
107128

108129
impl<'tcx> LateLintPass<'tcx> for Derive {
109130
fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'_>) {

clippy_lints/src/derive_ord_xor_partial_ord.rs

Lines changed: 0 additions & 28 deletions
This file was deleted.

clippy_lints/src/lib.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ mod dbg_macro;
173173
mod default_trait_access;
174174
mod dereference;
175175
mod derive;
176-
mod derive_ord_xor_partial_ord;
177176
mod doc;
178177
mod double_comparison;
179178
mod double_parens;
@@ -514,9 +513,9 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
514513
&default_trait_access::DEFAULT_TRAIT_ACCESS,
515514
&dereference::EXPLICIT_DEREF_METHODS,
516515
&derive::DERIVE_HASH_XOR_EQ,
516+
&derive::DERIVE_ORD_XOR_PARTIAL_ORD,
517517
&derive::EXPL_IMPL_CLONE_ON_COPY,
518518
&derive::UNSAFE_DERIVE_DESERIALIZE,
519-
&derive_ord_xor_partial_ord::DERIVE_ORD_XOR_PARTIAL_ORD,
520519
&doc::DOC_MARKDOWN,
521520
&doc::MISSING_ERRORS_DOC,
522521
&doc::MISSING_SAFETY_DOC,
@@ -1232,7 +1231,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
12321231
LintId::of(&copies::IFS_SAME_COND),
12331232
LintId::of(&copies::IF_SAME_THEN_ELSE),
12341233
LintId::of(&derive::DERIVE_HASH_XOR_EQ),
1235-
LintId::of(&derive_ord_xor_partial_ord::DERIVE_ORD_XOR_PARTIAL_ORD),
1234+
LintId::of(&derive::DERIVE_ORD_XOR_PARTIAL_ORD),
12361235
LintId::of(&doc::MISSING_SAFETY_DOC),
12371236
LintId::of(&doc::NEEDLESS_DOCTEST_MAIN),
12381237
LintId::of(&double_comparison::DOUBLE_COMPARISONS),
@@ -1651,7 +1650,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
16511650
LintId::of(&copies::IFS_SAME_COND),
16521651
LintId::of(&copies::IF_SAME_THEN_ELSE),
16531652
LintId::of(&derive::DERIVE_HASH_XOR_EQ),
1654-
LintId::of(&derive_ord_xor_partial_ord::DERIVE_ORD_XOR_PARTIAL_ORD),
1653+
LintId::of(&derive::DERIVE_ORD_XOR_PARTIAL_ORD),
16551654
LintId::of(&drop_bounds::DROP_BOUNDS),
16561655
LintId::of(&drop_forget_ref::DROP_COPY),
16571656
LintId::of(&drop_forget_ref::DROP_REF),

src/lintlist/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ pub static ref ALL_LINTS: Vec<Lint> = vec![
365365
group: "correctness",
366366
desc: "default lint description",
367367
deprecation: None,
368-
module: "derive_ord_xor_partial_ord",
368+
module: "derive",
369369
},
370370
Lint {
371371
name: "diverging_sub_expression",

0 commit comments

Comments
 (0)