@@ -467,6 +467,26 @@ define_Conf! {
467467    /// Whether to check MSRV compatibility in `#[test]` and `#[cfg(test)]` code. 
468468     #[ lints( incompatible_msrv) ] 
469469    check_incompatible_msrv_in_tests:  bool  = false , 
470+     /// Whether to suggest reordering constructor fields when initializers are present. 
471+      /// 
472+      /// Warnings produced by this configuration aren't necessarily fixed by just reordering the fields. Even if the 
473+      /// suggested code would compile, it can change semantics if the initializer expressions have side effects. The 
474+      /// following example [from rust-clippy#11846] shows how the suggestion can run into borrow check errors: 
475+      /// 
476+      /// ```rust 
477+      /// struct MyStruct { 
478+      ///     vector: Vec<u32>, 
479+      ///     length: usize 
480+      /// } 
481+      /// fn main() { 
482+      ///     let vector = vec![1,2,3]; 
483+      ///     MyStruct { length: vector.len(), vector}; 
484+      /// } 
485+      /// ``` 
486+      /// 
487+      /// [from rust-clippy#11846]: https://github.com/rust-lang/rust-clippy/issues/11846#issuecomment-1820747924 
488+      #[ lints( inconsistent_struct_constructor) ] 
489+     check_inconsistent_struct_field_initializers:  bool  = false , 
470490    /// Whether to also run the listed lints on private items. 
471491     #[ lints( missing_errors_doc,  missing_panics_doc,  missing_safety_doc,  unnecessary_safety_doc) ] 
472492    check_private_items:  bool  = false , 
@@ -542,25 +562,10 @@ define_Conf! {
542562    /// The maximum size of the `Err`-variant in a `Result` returned from a function 
543563     #[ lints( result_large_err) ] 
544564    large_error_threshold:  u64  = 128 , 
545-     /// Whether to suggest reordering constructor fields when initializers are present. 
546-      /// 
547-      /// Warnings produced by this configuration aren't necessarily fixed by just reordering the fields. Even if the 
548-      /// suggested code would compile, it can change semantics if the initializer expressions have side effects. The 
549-      /// following example [from rust-clippy#11846] shows how the suggestion can run into borrow check errors: 
565+     /// DEPRECATED CONFIGURATION: lint-inconsistent-struct-field-initializers 
550566     /// 
551-      /// ```rust 
552-      /// struct MyStruct { 
553-      ///     vector: Vec<u32>, 
554-      ///     length: usize 
555-      /// } 
556-      /// fn main() { 
557-      ///     let vector = vec![1,2,3]; 
558-      ///     MyStruct { length: vector.len(), vector}; 
559-      /// } 
560-      /// ``` 
561-      /// 
562-      /// [from rust-clippy#11846]: https://github.com/rust-lang/rust-clippy/issues/11846#issuecomment-1820747924 
563-      #[ lints( inconsistent_struct_constructor) ] 
567+      /// Use the `check-inconsistent-struct-field-initializers` configuration instead. 
568+      #[ conf_deprecated( "Please use `check-inconsistent-struct-field-initializers` instead" ,  check_inconsistent_struct_field_initializers) ] 
564569    lint_inconsistent_struct_field_initializers:  bool  = false , 
565570    /// The lower bound for linting decimal literals 
566571     #[ lints( decimal_literal_representation) ] 
@@ -935,7 +940,23 @@ impl serde::de::Error for FieldError {
935940        // set and allows it. 
936941        use  fmt:: Write ; 
937942
938-         let  mut  expected = expected. to_vec ( ) ; 
943+         let  metadata = get_configuration_metadata ( ) ; 
944+         let  deprecated = metadata
945+             . iter ( ) 
946+             . filter_map ( |conf| { 
947+                 if  conf. deprecation_reason . is_some ( )  { 
948+                     Some ( conf. name . as_str ( ) ) 
949+                 }  else  { 
950+                     None 
951+                 } 
952+             } ) 
953+             . collect :: < Vec < _ > > ( ) ; 
954+ 
955+         let  mut  expected = expected
956+             . iter ( ) 
957+             . copied ( ) 
958+             . filter ( |name| !deprecated. contains ( name) ) 
959+             . collect :: < Vec < _ > > ( ) ; 
939960        expected. sort_unstable ( ) ; 
940961
941962        let  ( rows,  column_widths)  = calculate_dimensions ( & expected) ; 
0 commit comments