From 09d4d49299c6614a0ae956980e709a234d21a9ef Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Thu, 21 Jan 2021 13:36:18 -0800 Subject: [PATCH] ExhaustiveEnums -> ExhaustiveItems --- .../src/{exhaustive_enums.rs => exhaustive_items.rs} | 4 ++-- clippy_lints/src/lib.rs | 8 ++++---- .../ui/{exhaustive_enums.fixed => exhaustive_items.fixed} | 0 tests/ui/{exhaustive_enums.rs => exhaustive_items.rs} | 0 .../{exhaustive_enums.stderr => exhaustive_items.stderr} | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) rename clippy_lints/src/{exhaustive_enums.rs => exhaustive_items.rs} (95%) rename tests/ui/{exhaustive_enums.fixed => exhaustive_items.fixed} (100%) rename tests/ui/{exhaustive_enums.rs => exhaustive_items.rs} (100%) rename tests/ui/{exhaustive_enums.stderr => exhaustive_items.stderr} (87%) diff --git a/clippy_lints/src/exhaustive_enums.rs b/clippy_lints/src/exhaustive_items.rs similarity index 95% rename from clippy_lints/src/exhaustive_enums.rs rename to clippy_lints/src/exhaustive_items.rs index 2e1c0728d..0fa6c4b58 100644 --- a/clippy_lints/src/exhaustive_enums.rs +++ b/clippy_lints/src/exhaustive_items.rs @@ -34,9 +34,9 @@ declare_clippy_lint! { "default lint description" } -declare_lint_pass!(ExhaustiveEnums => [EXHAUSTIVE_ENUMS]); +declare_lint_pass!(ExhaustiveItems => [EXHAUSTIVE_ENUMS]); -impl LateLintPass<'_> for ExhaustiveEnums { +impl LateLintPass<'_> for ExhaustiveItems { fn check_item(&mut self, cx: &LateContext<'_>, item: &Item<'_>) { if_chain! { if let ItemKind::Enum(..) = item.kind; diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index becd9f333..a5deebf7d 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -200,7 +200,7 @@ mod escape; mod eta_reduction; mod eval_order_dependence; mod excessive_bools; -mod exhaustive_enums; +mod exhaustive_items; mod exit; mod explicit_write; mod fallible_impl_from; @@ -612,7 +612,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf: &eval_order_dependence::EVAL_ORDER_DEPENDENCE, &excessive_bools::FN_PARAMS_EXCESSIVE_BOOLS, &excessive_bools::STRUCT_EXCESSIVE_BOOLS, - &exhaustive_enums::EXHAUSTIVE_ENUMS, + &exhaustive_items::EXHAUSTIVE_ENUMS, &exit::EXIT, &explicit_write::EXPLICIT_WRITE, &fallible_impl_from::FALLIBLE_IMPL_FROM, @@ -1098,7 +1098,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf: store.register_late_pass(|| box eval_order_dependence::EvalOrderDependence); store.register_late_pass(|| box missing_doc::MissingDoc::new()); store.register_late_pass(|| box missing_inline::MissingInline); - store.register_late_pass(move || box exhaustive_enums::ExhaustiveEnums); + store.register_late_pass(move || box exhaustive_items::ExhaustiveItems); store.register_late_pass(|| box if_let_some_result::OkIfLet); store.register_late_pass(|| box partialeq_ne_impl::PartialEqNeImpl); store.register_late_pass(|| box unused_io_amount::UnusedIoAmount); @@ -1249,7 +1249,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf: LintId::of(&create_dir::CREATE_DIR), LintId::of(&dbg_macro::DBG_MACRO), LintId::of(&else_if_without_else::ELSE_IF_WITHOUT_ELSE), - LintId::of(&exhaustive_enums::EXHAUSTIVE_ENUMS), + LintId::of(&exhaustive_items::EXHAUSTIVE_ENUMS), LintId::of(&exit::EXIT), LintId::of(&float_literal::LOSSY_FLOAT_LITERAL), LintId::of(&implicit_return::IMPLICIT_RETURN), diff --git a/tests/ui/exhaustive_enums.fixed b/tests/ui/exhaustive_items.fixed similarity index 100% rename from tests/ui/exhaustive_enums.fixed rename to tests/ui/exhaustive_items.fixed diff --git a/tests/ui/exhaustive_enums.rs b/tests/ui/exhaustive_items.rs similarity index 100% rename from tests/ui/exhaustive_enums.rs rename to tests/ui/exhaustive_items.rs diff --git a/tests/ui/exhaustive_enums.stderr b/tests/ui/exhaustive_items.stderr similarity index 87% rename from tests/ui/exhaustive_enums.stderr rename to tests/ui/exhaustive_items.stderr index 280c40b00..d00d950ef 100644 --- a/tests/ui/exhaustive_enums.stderr +++ b/tests/ui/exhaustive_items.stderr @@ -1,5 +1,5 @@ error: enums should not be exhaustive - --> $DIR/exhaustive_enums.rs:10:1 + --> $DIR/exhaustive_items.rs:10:1 | LL | / pub enum Exhaustive { LL | | Foo, @@ -10,7 +10,7 @@ LL | | } | |_^ | note: the lint level is defined here - --> $DIR/exhaustive_enums.rs:3:9 + --> $DIR/exhaustive_items.rs:3:9 | LL | #![deny(clippy::exhaustive_enums)] | ^^^^^^^^^^^^^^^^^^^^^^^^