@@ -441,7 +441,6 @@ pub fn read_conf(sess: &Session) -> Conf {
441
441
///
442
442
/// Used in `./src/driver.rs`.
443
443
#[ allow( clippy:: too_many_lines) ]
444
- #[ rustfmt:: skip]
445
444
pub fn register_plugins ( store : & mut rustc_lint:: LintStore , sess : & Session , conf : & Conf ) {
446
445
register_removed_non_tool_lints ( store) ;
447
446
@@ -493,11 +492,13 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
493
492
let vec_box_size_threshold = conf. vec_box_size_threshold ;
494
493
let type_complexity_threshold = conf. type_complexity_threshold ;
495
494
let avoid_breaking_exported_api = conf. avoid_breaking_exported_api ;
496
- store. register_late_pass ( move || Box :: new ( types:: Types :: new (
497
- vec_box_size_threshold,
498
- type_complexity_threshold,
499
- avoid_breaking_exported_api,
500
- ) ) ) ;
495
+ store. register_late_pass ( move || {
496
+ Box :: new ( types:: Types :: new (
497
+ vec_box_size_threshold,
498
+ type_complexity_threshold,
499
+ avoid_breaking_exported_api,
500
+ ) )
501
+ } ) ;
501
502
store. register_late_pass ( || Box :: new ( booleans:: NonminimalBool ) ) ;
502
503
store. register_late_pass ( || Box :: new ( needless_bitwise_bool:: NeedlessBitwiseBool ) ) ;
503
504
store. register_late_pass ( || Box :: new ( eq_op:: EqOp ) ) ;
@@ -535,7 +536,10 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
535
536
536
537
let msrv = conf. msrv . as_ref ( ) . and_then ( |s| {
537
538
parse_msrv ( s, None , None ) . or_else ( || {
538
- sess. err ( & format ! ( "error reading Clippy's configuration file. `{}` is not a valid Rust version" , s) ) ;
539
+ sess. err ( & format ! (
540
+ "error reading Clippy's configuration file. `{}` is not a valid Rust version" ,
541
+ s
542
+ ) ) ;
539
543
None
540
544
} )
541
545
} ) ;
@@ -579,10 +583,14 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
579
583
store. register_late_pass ( || Box :: new ( temporary_assignment:: TemporaryAssignment ) ) ;
580
584
store. register_late_pass ( || Box :: new ( transmute:: Transmute ) ) ;
581
585
let cognitive_complexity_threshold = conf. cognitive_complexity_threshold ;
582
- store. register_late_pass ( move || Box :: new ( cognitive_complexity:: CognitiveComplexity :: new ( cognitive_complexity_threshold) ) ) ;
586
+ store. register_late_pass ( move || {
587
+ Box :: new ( cognitive_complexity:: CognitiveComplexity :: new (
588
+ cognitive_complexity_threshold,
589
+ ) )
590
+ } ) ;
583
591
let too_large_for_stack = conf. too_large_for_stack ;
584
- store. register_late_pass ( move || Box :: new ( escape:: BoxedLocal { too_large_for_stack} ) ) ;
585
- store. register_late_pass ( move || Box :: new ( vec:: UselessVec { too_large_for_stack} ) ) ;
592
+ store. register_late_pass ( move || Box :: new ( escape:: BoxedLocal { too_large_for_stack } ) ) ;
593
+ store. register_late_pass ( move || Box :: new ( vec:: UselessVec { too_large_for_stack } ) ) ;
586
594
store. register_late_pass ( || Box :: new ( panic_unimplemented:: PanicUnimplemented ) ) ;
587
595
store. register_late_pass ( || Box :: new ( strings:: StringLitAsBytes ) ) ;
588
596
store. register_late_pass ( || Box :: new ( derive:: Derive ) ) ;
@@ -603,7 +611,12 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
603
611
store. register_late_pass ( move || Box :: new ( blacklisted_name:: BlacklistedName :: new ( blacklisted_names. clone ( ) ) ) ) ;
604
612
let too_many_arguments_threshold = conf. too_many_arguments_threshold ;
605
613
let too_many_lines_threshold = conf. too_many_lines_threshold ;
606
- store. register_late_pass ( move || Box :: new ( functions:: Functions :: new ( too_many_arguments_threshold, too_many_lines_threshold) ) ) ;
614
+ store. register_late_pass ( move || {
615
+ Box :: new ( functions:: Functions :: new (
616
+ too_many_arguments_threshold,
617
+ too_many_lines_threshold,
618
+ ) )
619
+ } ) ;
607
620
let doc_valid_idents = conf. doc_valid_idents . iter ( ) . cloned ( ) . collect :: < FxHashSet < _ > > ( ) ;
608
621
store. register_late_pass ( move || Box :: new ( doc:: DocMarkdown :: new ( doc_valid_idents. clone ( ) ) ) ) ;
609
622
store. register_late_pass ( || Box :: new ( neg_multiply:: NegMultiply ) ) ;
@@ -688,14 +701,32 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
688
701
store. register_late_pass ( || Box :: new ( multiple_crate_versions:: MultipleCrateVersions ) ) ;
689
702
store. register_late_pass ( || Box :: new ( wildcard_dependencies:: WildcardDependencies ) ) ;
690
703
let literal_representation_lint_fraction_readability = conf. unreadable_literal_lint_fractions ;
691
- store. register_early_pass ( move || Box :: new ( literal_representation:: LiteralDigitGrouping :: new ( literal_representation_lint_fraction_readability) ) ) ;
704
+ store. register_early_pass ( move || {
705
+ Box :: new ( literal_representation:: LiteralDigitGrouping :: new (
706
+ literal_representation_lint_fraction_readability,
707
+ ) )
708
+ } ) ;
692
709
let literal_representation_threshold = conf. literal_representation_threshold ;
693
- store. register_early_pass ( move || Box :: new ( literal_representation:: DecimalLiteralRepresentation :: new ( literal_representation_threshold) ) ) ;
710
+ store. register_early_pass ( move || {
711
+ Box :: new ( literal_representation:: DecimalLiteralRepresentation :: new (
712
+ literal_representation_threshold,
713
+ ) )
714
+ } ) ;
694
715
let enum_variant_name_threshold = conf. enum_variant_name_threshold ;
695
- store. register_late_pass ( move || Box :: new ( enum_variants:: EnumVariantNames :: new ( enum_variant_name_threshold, avoid_breaking_exported_api) ) ) ;
716
+ store. register_late_pass ( move || {
717
+ Box :: new ( enum_variants:: EnumVariantNames :: new (
718
+ enum_variant_name_threshold,
719
+ avoid_breaking_exported_api,
720
+ ) )
721
+ } ) ;
696
722
store. register_early_pass ( || Box :: new ( tabs_in_doc_comments:: TabsInDocComments ) ) ;
697
723
let upper_case_acronyms_aggressive = conf. upper_case_acronyms_aggressive ;
698
- store. register_late_pass ( move || Box :: new ( upper_case_acronyms:: UpperCaseAcronyms :: new ( avoid_breaking_exported_api, upper_case_acronyms_aggressive) ) ) ;
724
+ store. register_late_pass ( move || {
725
+ Box :: new ( upper_case_acronyms:: UpperCaseAcronyms :: new (
726
+ avoid_breaking_exported_api,
727
+ upper_case_acronyms_aggressive,
728
+ ) )
729
+ } ) ;
699
730
store. register_late_pass ( || Box :: new ( default:: Default :: default ( ) ) ) ;
700
731
store. register_late_pass ( || Box :: new ( unused_self:: UnusedSelf ) ) ;
701
732
store. register_late_pass ( || Box :: new ( mutable_debug_assertion:: DebugAssertWithMutCall ) ) ;
@@ -710,7 +741,12 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
710
741
store. register_early_pass ( || Box :: new ( single_component_path_imports:: SingleComponentPathImports ) ) ;
711
742
let max_fn_params_bools = conf. max_fn_params_bools ;
712
743
let max_struct_bools = conf. max_struct_bools ;
713
- store. register_early_pass ( move || Box :: new ( excessive_bools:: ExcessiveBools :: new ( max_struct_bools, max_fn_params_bools) ) ) ;
744
+ store. register_early_pass ( move || {
745
+ Box :: new ( excessive_bools:: ExcessiveBools :: new (
746
+ max_struct_bools,
747
+ max_fn_params_bools,
748
+ ) )
749
+ } ) ;
714
750
store. register_early_pass ( || Box :: new ( option_env_unwrap:: OptionEnvUnwrap ) ) ;
715
751
let warn_on_all_wildcard_imports = conf. warn_on_all_wildcard_imports ;
716
752
store. register_late_pass ( move || Box :: new ( wildcard_imports:: WildcardImports :: new ( warn_on_all_wildcard_imports) ) ) ;
@@ -729,9 +765,11 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
729
765
store. register_late_pass ( || Box :: new ( vec_resize_to_zero:: VecResizeToZero ) ) ;
730
766
store. register_late_pass ( || Box :: new ( panic_in_result_fn:: PanicInResultFn ) ) ;
731
767
let single_char_binding_names_threshold = conf. single_char_binding_names_threshold ;
732
- store. register_early_pass ( move || Box :: new ( non_expressive_names:: NonExpressiveNames {
733
- single_char_binding_names_threshold,
734
- } ) ) ;
768
+ store. register_early_pass ( move || {
769
+ Box :: new ( non_expressive_names:: NonExpressiveNames {
770
+ single_char_binding_names_threshold,
771
+ } )
772
+ } ) ;
735
773
let macro_matcher = conf. standard_macro_braces . iter ( ) . cloned ( ) . collect :: < FxHashSet < _ > > ( ) ;
736
774
store. register_early_pass ( move || Box :: new ( nonstandard_macro_braces:: MacroBraces :: new ( & macro_matcher) ) ) ;
737
775
store. register_late_pass ( || Box :: new ( macro_use:: MacroUseImports :: default ( ) ) ) ;
@@ -754,7 +792,9 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
754
792
store. register_late_pass ( || Box :: new ( strings:: StringToString ) ) ;
755
793
store. register_late_pass ( || Box :: new ( zero_sized_map_values:: ZeroSizedMapValues ) ) ;
756
794
store. register_late_pass ( || Box :: new ( vec_init_then_push:: VecInitThenPush :: default ( ) ) ) ;
757
- store. register_late_pass ( || Box :: new ( case_sensitive_file_extension_comparisons:: CaseSensitiveFileExtensionComparisons ) ) ;
795
+ store. register_late_pass ( || {
796
+ Box :: new ( case_sensitive_file_extension_comparisons:: CaseSensitiveFileExtensionComparisons )
797
+ } ) ;
758
798
store. register_late_pass ( || Box :: new ( redundant_slicing:: RedundantSlicing ) ) ;
759
799
store. register_late_pass ( || Box :: new ( from_str_radix_10:: FromStrRadix10 ) ) ;
760
800
store. register_late_pass ( || Box :: new ( manual_map:: ManualMap ) ) ;
@@ -765,7 +805,11 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
765
805
let disallowed_types = conf. disallowed_types . clone ( ) ;
766
806
store. register_late_pass ( move || Box :: new ( disallowed_type:: DisallowedType :: new ( disallowed_types. clone ( ) ) ) ) ;
767
807
let import_renames = conf. enforced_import_renames . clone ( ) ;
768
- store. register_late_pass ( move || Box :: new ( missing_enforced_import_rename:: ImportRename :: new ( import_renames. clone ( ) ) ) ) ;
808
+ store. register_late_pass ( move || {
809
+ Box :: new ( missing_enforced_import_rename:: ImportRename :: new (
810
+ import_renames. clone ( ) ,
811
+ ) )
812
+ } ) ;
769
813
let scripts = conf. allowed_scripts . clone ( ) ;
770
814
store. register_early_pass ( move || Box :: new ( disallowed_script_idents:: DisallowedScriptIdents :: new ( & scripts) ) ) ;
771
815
store. register_late_pass ( || Box :: new ( strlen_on_c_strings:: StrlenOnCStrings ) ) ;
@@ -774,7 +818,11 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
774
818
store. register_late_pass ( move || Box :: new ( iter_not_returning_iterator:: IterNotReturningIterator ) ) ;
775
819
store. register_late_pass ( move || Box :: new ( manual_assert:: ManualAssert ) ) ;
776
820
let enable_raw_pointer_heuristic_for_send = conf. enable_raw_pointer_heuristic_for_send ;
777
- store. register_late_pass ( move || Box :: new ( non_send_fields_in_send_ty:: NonSendFieldInSendTy :: new ( enable_raw_pointer_heuristic_for_send) ) ) ;
821
+ store. register_late_pass ( move || {
822
+ Box :: new ( non_send_fields_in_send_ty:: NonSendFieldInSendTy :: new (
823
+ enable_raw_pointer_heuristic_for_send,
824
+ ) )
825
+ } ) ;
778
826
store. register_late_pass ( move || Box :: new ( undocumented_unsafe_blocks:: UndocumentedUnsafeBlocks :: default ( ) ) ) ;
779
827
store. register_late_pass ( || Box :: new ( match_str_case_mismatch:: MatchStrCaseMismatch ) ) ;
780
828
store. register_late_pass ( move || Box :: new ( format_args:: FormatArgs ) ) ;
0 commit comments