Skip to content

Commit 0d4e24e

Browse files
committed
Auto merge of #7193 - wchargin:wchargin-inconsistent-struct-constructor-pedantic, r=camsteffen
Move `inconsistent_struct_constructor` to pedantic The whole point of named fields is that we don't have to worry about order. The names, not the position, communicate the information, so worrying about consistency for consistency's sake is pedantic to a *T*. Cf. #7192. changelog: [`inconsistent_struct_constructor`] is moved to pedantic. wchargin-branch: inconsistent-struct-constructor-pedantic
2 parents 72be476 + 1b2ca30 commit 0d4e24e

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

clippy_lints/src/inconsistent_struct_constructor.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ declare_clippy_lint! {
5858
/// Foo { x, y };
5959
/// ```
6060
pub INCONSISTENT_STRUCT_CONSTRUCTOR,
61-
style,
61+
pedantic,
6262
"the order of the field init shorthand is inconsistent with the order in the struct definition"
6363
}
6464

clippy_lints/src/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1364,6 +1364,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
13641364
LintId::of(if_not_else::IF_NOT_ELSE),
13651365
LintId::of(implicit_hasher::IMPLICIT_HASHER),
13661366
LintId::of(implicit_saturating_sub::IMPLICIT_SATURATING_SUB),
1367+
LintId::of(inconsistent_struct_constructor::INCONSISTENT_STRUCT_CONSTRUCTOR),
13671368
LintId::of(infinite_iter::MAYBE_INFINITE_ITER),
13681369
LintId::of(invalid_upcast_comparisons::INVALID_UPCAST_COMPARISONS),
13691370
LintId::of(items_after_statements::ITEMS_AFTER_STATEMENTS),
@@ -1510,7 +1511,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
15101511
LintId::of(identity_op::IDENTITY_OP),
15111512
LintId::of(if_let_mutex::IF_LET_MUTEX),
15121513
LintId::of(if_let_some_result::IF_LET_SOME_RESULT),
1513-
LintId::of(inconsistent_struct_constructor::INCONSISTENT_STRUCT_CONSTRUCTOR),
15141514
LintId::of(indexing_slicing::OUT_OF_BOUNDS_INDEXING),
15151515
LintId::of(infinite_iter::INFINITE_ITER),
15161516
LintId::of(inherent_to_string::INHERENT_TO_STRING),
@@ -1763,7 +1763,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
17631763
LintId::of(functions::MUST_USE_UNIT),
17641764
LintId::of(functions::RESULT_UNIT_ERR),
17651765
LintId::of(if_let_some_result::IF_LET_SOME_RESULT),
1766-
LintId::of(inconsistent_struct_constructor::INCONSISTENT_STRUCT_CONSTRUCTOR),
17671766
LintId::of(inherent_to_string::INHERENT_TO_STRING),
17681767
LintId::of(len_zero::COMPARISON_TO_EMPTY),
17691768
LintId::of(len_zero::LEN_WITHOUT_IS_EMPTY),

0 commit comments

Comments
 (0)