Skip to content

Commit 18864d4

Browse files
committed
unit_like_struct_brackets -> empty_structs_with_brackets
1 parent a3ed806 commit 18864d4

10 files changed

+16
-16
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3262,6 +3262,7 @@ Released 2018-09-13
32623262
[`empty_enum`]: https://rust-lang.github.io/rust-clippy/master/index.html#empty_enum
32633263
[`empty_line_after_outer_attr`]: https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_outer_attr
32643264
[`empty_loop`]: https://rust-lang.github.io/rust-clippy/master/index.html#empty_loop
3265+
[`empty_structs_with_brackets`]: https://rust-lang.github.io/rust-clippy/master/index.html#empty_structs_with_brackets
32653266
[`enum_clike_unportable_variant`]: https://rust-lang.github.io/rust-clippy/master/index.html#enum_clike_unportable_variant
32663267
[`enum_glob_use`]: https://rust-lang.github.io/rust-clippy/master/index.html#enum_glob_use
32673268
[`enum_variant_names`]: https://rust-lang.github.io/rust-clippy/master/index.html#enum_variant_names
@@ -3635,7 +3636,6 @@ Released 2018-09-13
36353636
[`unit_arg`]: https://rust-lang.github.io/rust-clippy/master/index.html#unit_arg
36363637
[`unit_cmp`]: https://rust-lang.github.io/rust-clippy/master/index.html#unit_cmp
36373638
[`unit_hash`]: https://rust-lang.github.io/rust-clippy/master/index.html#unit_hash
3638-
[`unit_like_struct_brackets`]: https://rust-lang.github.io/rust-clippy/master/index.html#unit_like_struct_brackets
36393639
[`unit_return_expecting_ord`]: https://rust-lang.github.io/rust-clippy/master/index.html#unit_return_expecting_ord
36403640
[`unnecessary_cast`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
36413641
[`unnecessary_filter_map`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_filter_map

clippy_lints/src/unit_like_struct_brackets.rs renamed to clippy_lints/src/empty_structs_with_brackets.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ declare_clippy_lint! {
2222
/// struct Cookie;
2323
/// ```
2424
#[clippy::version = "1.62.0"]
25-
pub UNIT_LIKE_STRUCT_BRACKETS,
25+
pub EMPTY_STRUCTS_WITH_BRACKETS,
2626
style,
2727
"finds struct declarations with empty brackets"
2828
}
29-
declare_lint_pass!(UnitLikeStructBrackets => [UNIT_LIKE_STRUCT_BRACKETS]);
29+
declare_lint_pass!(EmptyStructsWithBrackets => [EMPTY_STRUCTS_WITH_BRACKETS]);
3030

31-
impl EarlyLintPass for UnitLikeStructBrackets {
31+
impl EarlyLintPass for EmptyStructsWithBrackets {
3232
fn check_item(&mut self, cx: &EarlyContext<'_>, item: &Item) {
3333
let span_after_ident = item.span.with_lo(item.ident.span.hi());
3434

@@ -37,7 +37,7 @@ impl EarlyLintPass for UnitLikeStructBrackets {
3737
&& has_no_fields(cx, var_data, span_after_ident) {
3838
span_lint_and_then(
3939
cx,
40-
UNIT_LIKE_STRUCT_BRACKETS,
40+
EMPTY_STRUCTS_WITH_BRACKETS,
4141
span_after_ident,
4242
"found empty brackets on struct declaration",
4343
|diagnostic| {

clippy_lints/src/lib.register_all.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ store.register_group(true, "clippy::all", Some("clippy_all"), vec![
5353
LintId::of(drop_forget_ref::FORGET_COPY),
5454
LintId::of(drop_forget_ref::FORGET_REF),
5555
LintId::of(duration_subsec::DURATION_SUBSEC),
56+
LintId::of(empty_structs_with_brackets::EMPTY_STRUCTS_WITH_BRACKETS),
5657
LintId::of(entry::MAP_ENTRY),
5758
LintId::of(enum_clike::ENUM_CLIKE_UNPORTABLE_VARIANT),
5859
LintId::of(enum_variants::ENUM_VARIANT_NAMES),
@@ -300,7 +301,6 @@ store.register_group(true, "clippy::all", Some("clippy_all"), vec![
300301
LintId::of(unicode::INVISIBLE_CHARACTERS),
301302
LintId::of(uninit_vec::UNINIT_VEC),
302303
LintId::of(unit_hash::UNIT_HASH),
303-
LintId::of(unit_like_struct_brackets::UNIT_LIKE_STRUCT_BRACKETS),
304304
LintId::of(unit_return_expecting_ord::UNIT_RETURN_EXPECTING_ORD),
305305
LintId::of(unit_types::UNIT_ARG),
306306
LintId::of(unit_types::UNIT_CMP),

clippy_lints/src/lib.register_lints.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ store.register_lints(&[
128128
duration_subsec::DURATION_SUBSEC,
129129
else_if_without_else::ELSE_IF_WITHOUT_ELSE,
130130
empty_enum::EMPTY_ENUM,
131+
empty_structs_with_brackets::EMPTY_STRUCTS_WITH_BRACKETS,
131132
entry::MAP_ENTRY,
132133
enum_clike::ENUM_CLIKE_UNPORTABLE_VARIANT,
133134
enum_variants::ENUM_VARIANT_NAMES,
@@ -511,7 +512,6 @@ store.register_lints(&[
511512
unicode::UNICODE_NOT_NFC,
512513
uninit_vec::UNINIT_VEC,
513514
unit_hash::UNIT_HASH,
514-
unit_like_struct_brackets::UNIT_LIKE_STRUCT_BRACKETS,
515515
unit_return_expecting_ord::UNIT_RETURN_EXPECTING_ORD,
516516
unit_types::LET_UNIT_VALUE,
517517
unit_types::UNIT_ARG,

clippy_lints/src/lib.register_style.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ store.register_group(true, "clippy::style", Some("clippy_style"), vec![
2020
LintId::of(disallowed_types::DISALLOWED_TYPES),
2121
LintId::of(doc::MISSING_SAFETY_DOC),
2222
LintId::of(doc::NEEDLESS_DOCTEST_MAIN),
23+
LintId::of(empty_structs_with_brackets::EMPTY_STRUCTS_WITH_BRACKETS),
2324
LintId::of(enum_variants::ENUM_VARIANT_NAMES),
2425
LintId::of(enum_variants::MODULE_INCEPTION),
2526
LintId::of(eq_op::OP_REF),
@@ -105,7 +106,6 @@ store.register_group(true, "clippy::style", Some("clippy_style"), vec![
105106
LintId::of(single_component_path_imports::SINGLE_COMPONENT_PATH_IMPORTS),
106107
LintId::of(tabs_in_doc_comments::TABS_IN_DOC_COMMENTS),
107108
LintId::of(to_digit_is_some::TO_DIGIT_IS_SOME),
108-
LintId::of(unit_like_struct_brackets::UNIT_LIKE_STRUCT_BRACKETS),
109109
LintId::of(unsafe_removed_from_name::UNSAFE_REMOVED_FROM_NAME),
110110
LintId::of(unused_unit::UNUSED_UNIT),
111111
LintId::of(upper_case_acronyms::UPPER_CASE_ACRONYMS),

clippy_lints/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ mod drop_forget_ref;
208208
mod duration_subsec;
209209
mod else_if_without_else;
210210
mod empty_enum;
211+
mod empty_structs_with_brackets;
211212
mod entry;
212213
mod enum_clike;
213214
mod enum_variants;
@@ -379,7 +380,6 @@ mod undropped_manually_drops;
379380
mod unicode;
380381
mod uninit_vec;
381382
mod unit_hash;
382-
mod unit_like_struct_brackets;
383383
mod unit_return_expecting_ord;
384384
mod unit_types;
385385
mod unnamed_address;
@@ -868,7 +868,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
868868
ignore_publish: cargo_ignore_publish,
869869
})
870870
});
871-
store.register_early_pass(|| Box::new(unit_like_struct_brackets::UnitLikeStructBrackets));
871+
store.register_early_pass(|| Box::new(empty_structs_with_brackets::EmptyStructsWithBrackets));
872872
// add lints here, do not remove this comment, it's used in `new_lint`
873873
}
874874

tests/ui/unit_like_struct_brackets.fixed renamed to tests/ui/empty_structs_with_brackets.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// run-rustfix
2-
#![warn(clippy::unit_like_struct_brackets)]
2+
#![warn(clippy::empty_structs_with_brackets)]
33
#![allow(dead_code)]
44

55
pub struct MyEmptyStruct; // should trigger lint

tests/ui/unit_like_struct_brackets.rs renamed to tests/ui/empty_structs_with_brackets.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// run-rustfix
2-
#![warn(clippy::unit_like_struct_brackets)]
2+
#![warn(clippy::empty_structs_with_brackets)]
33
#![allow(dead_code)]
44

55
pub struct MyEmptyStruct {} // should trigger lint

tests/ui/unit_like_struct_brackets.stderr renamed to tests/ui/empty_structs_with_brackets.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
error: found empty brackets on struct declaration
2-
--> $DIR/unit_like_struct_brackets.rs:5:25
2+
--> $DIR/empty_structs_with_brackets.rs:5:25
33
|
44
LL | pub struct MyEmptyStruct {} // should trigger lint
55
| ^^^
66
|
7-
= note: `-D clippy::unit-like-struct-brackets` implied by `-D warnings`
7+
= note: `-D clippy::empty-structs-with-brackets` implied by `-D warnings`
88
= help: remove the brackets
99

1010
error: found empty brackets on struct declaration
11-
--> $DIR/unit_like_struct_brackets.rs:6:26
11+
--> $DIR/empty_structs_with_brackets.rs:6:26
1212
|
1313
LL | struct MyEmptyTupleStruct(); // should trigger lint
1414
| ^^^

tests/ui/no_effect.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ impl FnOnce<(&str,)> for GreetStruct1 {
6868
}
6969
}
7070

71-
#[allow(clippy::unit_like_struct_brackets)]
71+
#[allow(clippy::empty_structs_with_brackets)]
7272
struct GreetStruct2();
7373

7474
impl FnOnce<(&str,)> for GreetStruct2 {

0 commit comments

Comments
 (0)