about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMax Baumann <max@bmn.dev>2022-03-28 11:35:43 +0200
committerMax Baumann <max@bmn.dev>2022-03-30 20:13:16 +0200
commit2953cba1160cb4dd8fe4923a4e9166b3ca6867f1 (patch)
tree3d709209c23d32c2c4e933df55c8f6aa98033900
parent37d5a6264c3ad22f878351267fbbfe47e62cd35b (diff)
downloadrust-2953cba1160cb4dd8fe4923a4e9166b3ca6867f1.tar.gz
rust-2953cba1160cb4dd8fe4923a4e9166b3ca6867f1.zip
unit_like_struct_brackets -> empty_structs_with_brackets
-rw-r--r--CHANGELOG.md2
-rw-r--r--clippy_lints/src/empty_structs_with_brackets.rs (renamed from clippy_lints/src/unit_like_struct_brackets.rs)8
-rw-r--r--clippy_lints/src/lib.register_all.rs2
-rw-r--r--clippy_lints/src/lib.register_lints.rs2
-rw-r--r--clippy_lints/src/lib.register_style.rs2
-rw-r--r--clippy_lints/src/lib.rs4
-rw-r--r--tests/ui/empty_structs_with_brackets.fixed (renamed from tests/ui/unit_like_struct_brackets.fixed)2
-rw-r--r--tests/ui/empty_structs_with_brackets.rs (renamed from tests/ui/unit_like_struct_brackets.rs)2
-rw-r--r--tests/ui/empty_structs_with_brackets.stderr (renamed from tests/ui/unit_like_struct_brackets.stderr)6
-rw-r--r--tests/ui/no_effect.rs2
10 files changed, 16 insertions, 16 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 49a44d98813..0aa6a019762 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3263,6 +3263,7 @@ Released 2018-09-13
 [`empty_enum`]: https://rust-lang.github.io/rust-clippy/master/index.html#empty_enum
 [`empty_line_after_outer_attr`]: https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_outer_attr
 [`empty_loop`]: https://rust-lang.github.io/rust-clippy/master/index.html#empty_loop
+[`empty_structs_with_brackets`]: https://rust-lang.github.io/rust-clippy/master/index.html#empty_structs_with_brackets
 [`enum_clike_unportable_variant`]: https://rust-lang.github.io/rust-clippy/master/index.html#enum_clike_unportable_variant
 [`enum_glob_use`]: https://rust-lang.github.io/rust-clippy/master/index.html#enum_glob_use
 [`enum_variant_names`]: https://rust-lang.github.io/rust-clippy/master/index.html#enum_variant_names
@@ -3636,7 +3637,6 @@ Released 2018-09-13
 [`unit_arg`]: https://rust-lang.github.io/rust-clippy/master/index.html#unit_arg
 [`unit_cmp`]: https://rust-lang.github.io/rust-clippy/master/index.html#unit_cmp
 [`unit_hash`]: https://rust-lang.github.io/rust-clippy/master/index.html#unit_hash
-[`unit_like_struct_brackets`]: https://rust-lang.github.io/rust-clippy/master/index.html#unit_like_struct_brackets
 [`unit_return_expecting_ord`]: https://rust-lang.github.io/rust-clippy/master/index.html#unit_return_expecting_ord
 [`unnecessary_cast`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
 [`unnecessary_filter_map`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_filter_map
diff --git a/clippy_lints/src/unit_like_struct_brackets.rs b/clippy_lints/src/empty_structs_with_brackets.rs
index 6269719e696..e3f33c1a4a3 100644
--- a/clippy_lints/src/unit_like_struct_brackets.rs
+++ b/clippy_lints/src/empty_structs_with_brackets.rs
@@ -22,13 +22,13 @@ declare_clippy_lint! {
     /// struct Cookie;
     /// ```
     #[clippy::version = "1.62.0"]
-    pub UNIT_LIKE_STRUCT_BRACKETS,
+    pub EMPTY_STRUCTS_WITH_BRACKETS,
     style,
     "finds struct declarations with empty brackets"
 }
-declare_lint_pass!(UnitLikeStructBrackets => [UNIT_LIKE_STRUCT_BRACKETS]);
+declare_lint_pass!(EmptyStructsWithBrackets => [EMPTY_STRUCTS_WITH_BRACKETS]);
 
-impl EarlyLintPass for UnitLikeStructBrackets {
+impl EarlyLintPass for EmptyStructsWithBrackets {
     fn check_item(&mut self, cx: &EarlyContext<'_>, item: &Item) {
         let span_after_ident = item.span.with_lo(item.ident.span.hi());
 
@@ -37,7 +37,7 @@ impl EarlyLintPass for UnitLikeStructBrackets {
             && has_no_fields(cx, var_data, span_after_ident) {
             span_lint_and_then(
                 cx,
-                UNIT_LIKE_STRUCT_BRACKETS,
+                EMPTY_STRUCTS_WITH_BRACKETS,
                 span_after_ident,
                 "found empty brackets on struct declaration",
                 |diagnostic| {
diff --git a/clippy_lints/src/lib.register_all.rs b/clippy_lints/src/lib.register_all.rs
index f488aab46ec..bdad518a3e8 100644
--- a/clippy_lints/src/lib.register_all.rs
+++ b/clippy_lints/src/lib.register_all.rs
@@ -54,6 +54,7 @@ store.register_group(true, "clippy::all", Some("clippy_all"), vec![
     LintId::of(drop_forget_ref::FORGET_COPY),
     LintId::of(drop_forget_ref::FORGET_REF),
     LintId::of(duration_subsec::DURATION_SUBSEC),
+    LintId::of(empty_structs_with_brackets::EMPTY_STRUCTS_WITH_BRACKETS),
     LintId::of(entry::MAP_ENTRY),
     LintId::of(enum_clike::ENUM_CLIKE_UNPORTABLE_VARIANT),
     LintId::of(enum_variants::ENUM_VARIANT_NAMES),
@@ -301,7 +302,6 @@ store.register_group(true, "clippy::all", Some("clippy_all"), vec![
     LintId::of(unicode::INVISIBLE_CHARACTERS),
     LintId::of(uninit_vec::UNINIT_VEC),
     LintId::of(unit_hash::UNIT_HASH),
-    LintId::of(unit_like_struct_brackets::UNIT_LIKE_STRUCT_BRACKETS),
     LintId::of(unit_return_expecting_ord::UNIT_RETURN_EXPECTING_ORD),
     LintId::of(unit_types::UNIT_ARG),
     LintId::of(unit_types::UNIT_CMP),
diff --git a/clippy_lints/src/lib.register_lints.rs b/clippy_lints/src/lib.register_lints.rs
index a1e6ca76a16..bba3cae45f5 100644
--- a/clippy_lints/src/lib.register_lints.rs
+++ b/clippy_lints/src/lib.register_lints.rs
@@ -129,6 +129,7 @@ store.register_lints(&[
     duration_subsec::DURATION_SUBSEC,
     else_if_without_else::ELSE_IF_WITHOUT_ELSE,
     empty_enum::EMPTY_ENUM,
+    empty_structs_with_brackets::EMPTY_STRUCTS_WITH_BRACKETS,
     entry::MAP_ENTRY,
     enum_clike::ENUM_CLIKE_UNPORTABLE_VARIANT,
     enum_variants::ENUM_VARIANT_NAMES,
@@ -512,7 +513,6 @@ store.register_lints(&[
     unicode::UNICODE_NOT_NFC,
     uninit_vec::UNINIT_VEC,
     unit_hash::UNIT_HASH,
-    unit_like_struct_brackets::UNIT_LIKE_STRUCT_BRACKETS,
     unit_return_expecting_ord::UNIT_RETURN_EXPECTING_ORD,
     unit_types::LET_UNIT_VALUE,
     unit_types::UNIT_ARG,
diff --git a/clippy_lints/src/lib.register_style.rs b/clippy_lints/src/lib.register_style.rs
index 89657cfb784..b2465d1a0cd 100644
--- a/clippy_lints/src/lib.register_style.rs
+++ b/clippy_lints/src/lib.register_style.rs
@@ -20,6 +20,7 @@ store.register_group(true, "clippy::style", Some("clippy_style"), vec![
     LintId::of(disallowed_types::DISALLOWED_TYPES),
     LintId::of(doc::MISSING_SAFETY_DOC),
     LintId::of(doc::NEEDLESS_DOCTEST_MAIN),
+    LintId::of(empty_structs_with_brackets::EMPTY_STRUCTS_WITH_BRACKETS),
     LintId::of(enum_variants::ENUM_VARIANT_NAMES),
     LintId::of(enum_variants::MODULE_INCEPTION),
     LintId::of(eq_op::OP_REF),
@@ -105,7 +106,6 @@ store.register_group(true, "clippy::style", Some("clippy_style"), vec![
     LintId::of(single_component_path_imports::SINGLE_COMPONENT_PATH_IMPORTS),
     LintId::of(tabs_in_doc_comments::TABS_IN_DOC_COMMENTS),
     LintId::of(to_digit_is_some::TO_DIGIT_IS_SOME),
-    LintId::of(unit_like_struct_brackets::UNIT_LIKE_STRUCT_BRACKETS),
     LintId::of(unsafe_removed_from_name::UNSAFE_REMOVED_FROM_NAME),
     LintId::of(unused_unit::UNUSED_UNIT),
     LintId::of(upper_case_acronyms::UPPER_CASE_ACRONYMS),
diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs
index af8d9b3655c..3138ee9bce5 100644
--- a/clippy_lints/src/lib.rs
+++ b/clippy_lints/src/lib.rs
@@ -209,6 +209,7 @@ mod drop_forget_ref;
 mod duration_subsec;
 mod else_if_without_else;
 mod empty_enum;
+mod empty_structs_with_brackets;
 mod entry;
 mod enum_clike;
 mod enum_variants;
@@ -380,7 +381,6 @@ mod undropped_manually_drops;
 mod unicode;
 mod uninit_vec;
 mod unit_hash;
-mod unit_like_struct_brackets;
 mod unit_return_expecting_ord;
 mod unit_types;
 mod unnamed_address;
@@ -870,7 +870,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
         })
     });
     store.register_early_pass(|| Box::new(crate_in_macro_def::CrateInMacroDef));
-    store.register_early_pass(|| Box::new(unit_like_struct_brackets::UnitLikeStructBrackets));
+    store.register_early_pass(|| Box::new(empty_structs_with_brackets::EmptyStructsWithBrackets));
     // add lints here, do not remove this comment, it's used in `new_lint`
 }
 
diff --git a/tests/ui/unit_like_struct_brackets.fixed b/tests/ui/empty_structs_with_brackets.fixed
index 2769920c5fe..80f07603b8d 100644
--- a/tests/ui/unit_like_struct_brackets.fixed
+++ b/tests/ui/empty_structs_with_brackets.fixed
@@ -1,5 +1,5 @@
 // run-rustfix
-#![warn(clippy::unit_like_struct_brackets)]
+#![warn(clippy::empty_structs_with_brackets)]
 #![allow(dead_code)]
 
 pub struct MyEmptyStruct; // should trigger lint
diff --git a/tests/ui/unit_like_struct_brackets.rs b/tests/ui/empty_structs_with_brackets.rs
index b20f8516bd1..1d1ed4c7690 100644
--- a/tests/ui/unit_like_struct_brackets.rs
+++ b/tests/ui/empty_structs_with_brackets.rs
@@ -1,5 +1,5 @@
 // run-rustfix
-#![warn(clippy::unit_like_struct_brackets)]
+#![warn(clippy::empty_structs_with_brackets)]
 #![allow(dead_code)]
 
 pub struct MyEmptyStruct {} // should trigger lint
diff --git a/tests/ui/unit_like_struct_brackets.stderr b/tests/ui/empty_structs_with_brackets.stderr
index d3037f5d350..0308cb5571a 100644
--- a/tests/ui/unit_like_struct_brackets.stderr
+++ b/tests/ui/empty_structs_with_brackets.stderr
@@ -1,14 +1,14 @@
 error: found empty brackets on struct declaration
-  --> $DIR/unit_like_struct_brackets.rs:5:25
+  --> $DIR/empty_structs_with_brackets.rs:5:25
    |
 LL | pub struct MyEmptyStruct {} // should trigger lint
    |                         ^^^
    |
-   = note: `-D clippy::unit-like-struct-brackets` implied by `-D warnings`
+   = note: `-D clippy::empty-structs-with-brackets` implied by `-D warnings`
    = help: remove the brackets
 
 error: found empty brackets on struct declaration
-  --> $DIR/unit_like_struct_brackets.rs:6:26
+  --> $DIR/empty_structs_with_brackets.rs:6:26
    |
 LL | struct MyEmptyTupleStruct(); // should trigger lint
    |                          ^^^
diff --git a/tests/ui/no_effect.rs b/tests/ui/no_effect.rs
index 291dab4fb31..0847297ade7 100644
--- a/tests/ui/no_effect.rs
+++ b/tests/ui/no_effect.rs
@@ -68,7 +68,7 @@ impl FnOnce<(&str,)> for GreetStruct1 {
     }
 }
 
-#[allow(clippy::unit_like_struct_brackets)]
+#[allow(clippy::empty_structs_with_brackets)]
 struct GreetStruct2();
 
 impl FnOnce<(&str,)> for GreetStruct2 {