Skip to content

Commit 09c3237

Browse files
authored
chore(empty_enum): rename to empty_enums (#15912)
According to the lint naming guidelines[^1], lint names should use the plural form. [^1]: https://rust-lang.github.io/rfcs/0344-conventions-galore.html#lints changelog: [`empty_enum`]: rename to `empty_enums`
2 parents 82d729c + 5578908 commit 09c3237

File tree

11 files changed

+101
-88
lines changed

11 files changed

+101
-88
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6253,6 +6253,7 @@ Released 2018-09-13
62536253
[`empty_drop`]: https://rust-lang.github.io/rust-clippy/master/index.html#empty_drop
62546254
[`empty_enum`]: https://rust-lang.github.io/rust-clippy/master/index.html#empty_enum
62556255
[`empty_enum_variants_with_brackets`]: https://rust-lang.github.io/rust-clippy/master/index.html#empty_enum_variants_with_brackets
6256+
[`empty_enums`]: https://rust-lang.github.io/rust-clippy/master/index.html#empty_enums
62566257
[`empty_line_after_doc_comments`]: https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments
62576258
[`empty_line_after_outer_attr`]: https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_outer_attr
62586259
[`empty_loop`]: https://rust-lang.github.io/rust-clippy/master/index.html#empty_loop

clippy_lints/src/declared_lints.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ pub static LINTS: &[&::declare_clippy_lint::LintInfo] = &[
135135
crate::duplicate_mod::DUPLICATE_MOD_INFO,
136136
crate::else_if_without_else::ELSE_IF_WITHOUT_ELSE_INFO,
137137
crate::empty_drop::EMPTY_DROP_INFO,
138-
crate::empty_enum::EMPTY_ENUM_INFO,
138+
crate::empty_enums::EMPTY_ENUMS_INFO,
139139
crate::empty_line_after::EMPTY_LINE_AFTER_DOC_COMMENTS_INFO,
140140
crate::empty_line_after::EMPTY_LINE_AFTER_OUTER_ATTR_INFO,
141141
crate::empty_with_brackets::EMPTY_ENUM_VARIANTS_WITH_BRACKETS_INFO,

clippy_lints/src/deprecated_lints.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ declare_with_version! { RENAMED(RENAMED_VERSION) = [
8585
("clippy::drop_copy", "dropping_copy_types"),
8686
#[clippy::version = ""]
8787
("clippy::drop_ref", "dropping_references"),
88+
#[clippy::version = "1.92.0"]
89+
("clippy::empty_enum", "clippy::empty_enums"),
8890
#[clippy::version = ""]
8991
("clippy::eval_order_dependence", "clippy::mixed_read_write_in_expression"),
9092
#[clippy::version = "1.53.0"]

clippy_lints/src/empty_enum.rs renamed to clippy_lints/src/empty_enums.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ declare_clippy_lint! {
5050
/// [newtype]: https://doc.rust-lang.org/book/ch19-04-advanced-types.html#using-the-newtype-pattern-for-type-safety-and-abstraction
5151
/// [visibility]: https://doc.rust-lang.org/reference/visibility-and-privacy.html
5252
#[clippy::version = "pre 1.29.0"]
53-
pub EMPTY_ENUM,
53+
pub EMPTY_ENUMS,
5454
pedantic,
5555
"enum with no variants"
5656
}
5757

58-
declare_lint_pass!(EmptyEnum => [EMPTY_ENUM]);
58+
declare_lint_pass!(EmptyEnums => [EMPTY_ENUMS]);
5959

60-
impl LateLintPass<'_> for EmptyEnum {
60+
impl LateLintPass<'_> for EmptyEnums {
6161
fn check_item(&mut self, cx: &LateContext<'_>, item: &Item<'_>) {
6262
if let ItemKind::Enum(.., def) = item.kind
6363
&& def.variants.is_empty()
@@ -67,7 +67,7 @@ impl LateLintPass<'_> for EmptyEnum {
6767
{
6868
span_lint_and_help(
6969
cx,
70-
EMPTY_ENUM,
70+
EMPTY_ENUMS,
7171
item.span,
7272
"enum with no variants",
7373
None,

clippy_lints/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ mod drop_forget_ref;
117117
mod duplicate_mod;
118118
mod else_if_without_else;
119119
mod empty_drop;
120-
mod empty_enum;
120+
mod empty_enums;
121121
mod empty_line_after;
122122
mod empty_with_brackets;
123123
mod endian_bytes;
@@ -541,7 +541,7 @@ pub fn register_lint_passes(store: &mut rustc_lint::LintStore, conf: &'static Co
541541
store.register_late_pass(|_| Box::new(derive::Derive));
542542
store.register_late_pass(move |_| Box::new(derivable_impls::DerivableImpls::new(conf)));
543543
store.register_late_pass(|_| Box::new(drop_forget_ref::DropForgetRef));
544-
store.register_late_pass(|_| Box::new(empty_enum::EmptyEnum));
544+
store.register_late_pass(|_| Box::new(empty_enums::EmptyEnums));
545545
store.register_late_pass(|_| Box::new(invalid_upcast_comparisons::InvalidUpcastComparisons));
546546
store.register_late_pass(|_| Box::<regex::Regex>::default());
547547
store.register_late_pass(move |tcx| Box::new(ifs::CopyAndPaste::new(tcx, conf)));

tests/ui/empty_enum.rs renamed to tests/ui/empty_enums.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
#![warn(clippy::empty_enum)]
1+
#![warn(clippy::empty_enums)]
22
// Enable never type to test empty enum lint
33
#![feature(never_type)]
44

55
enum Empty {}
6-
//~^ empty_enum
6+
//~^ empty_enums
77

88
mod issue15910 {
99
enum NotReallyEmpty {
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
error: enum with no variants
2-
--> tests/ui/empty_enum.rs:5:1
2+
--> tests/ui/empty_enums.rs:5:1
33
|
44
LL | enum Empty {}
55
| ^^^^^^^^^^^^^
66
|
77
= help: consider using the uninhabited type `!` (never type) or a wrapper around it to introduce a type which can't be instantiated
8-
= note: `-D clippy::empty-enum` implied by `-D warnings`
9-
= help: to override `-D warnings` add `#[allow(clippy::empty_enum)]`
8+
= note: `-D clippy::empty-enums` implied by `-D warnings`
9+
= help: to override `-D warnings` add `#[allow(clippy::empty_enums)]`
1010

1111
error: aborting due to 1 previous error
1212

tests/ui/empty_enum_without_never_type.rs renamed to tests/ui/empty_enums_without_never_type.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ check-pass
22

3-
#![warn(clippy::empty_enum)]
3+
#![warn(clippy::empty_enums)]
44

55
// `never_type` is not enabled; this test has no stderr file
66
enum Empty {}

tests/ui/rename.fixed

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#![allow(drop_bounds)]
2020
#![allow(dropping_copy_types)]
2121
#![allow(dropping_references)]
22+
#![allow(clippy::empty_enums)]
2223
#![allow(clippy::mixed_read_write_in_expression)]
2324
#![allow(clippy::manual_filter_map)]
2425
#![allow(clippy::manual_find_map)]
@@ -83,6 +84,7 @@
8384
#![warn(drop_bounds)] //~ ERROR: lint `clippy::drop_bounds`
8485
#![warn(dropping_copy_types)] //~ ERROR: lint `clippy::drop_copy`
8586
#![warn(dropping_references)] //~ ERROR: lint `clippy::drop_ref`
87+
#![warn(clippy::empty_enums)] //~ ERROR: lint `clippy::empty_enum`
8688
#![warn(clippy::mixed_read_write_in_expression)] //~ ERROR: lint `clippy::eval_order_dependence`
8789
#![warn(clippy::manual_filter_map)] //~ ERROR: lint `clippy::filter_map`
8890
#![warn(clippy::manual_find_map)] //~ ERROR: lint `clippy::find_map`

tests/ui/rename.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#![allow(drop_bounds)]
2020
#![allow(dropping_copy_types)]
2121
#![allow(dropping_references)]
22+
#![allow(clippy::empty_enums)]
2223
#![allow(clippy::mixed_read_write_in_expression)]
2324
#![allow(clippy::manual_filter_map)]
2425
#![allow(clippy::manual_find_map)]
@@ -83,6 +84,7 @@
8384
#![warn(clippy::drop_bounds)] //~ ERROR: lint `clippy::drop_bounds`
8485
#![warn(clippy::drop_copy)] //~ ERROR: lint `clippy::drop_copy`
8586
#![warn(clippy::drop_ref)] //~ ERROR: lint `clippy::drop_ref`
87+
#![warn(clippy::empty_enum)] //~ ERROR: lint `clippy::empty_enum`
8688
#![warn(clippy::eval_order_dependence)] //~ ERROR: lint `clippy::eval_order_dependence`
8789
#![warn(clippy::filter_map)] //~ ERROR: lint `clippy::filter_map`
8890
#![warn(clippy::find_map)] //~ ERROR: lint `clippy::find_map`

0 commit comments

Comments
 (0)