@@ -441,7 +441,6 @@ pub fn read_conf(sess: &Session) -> Conf {
441441///
442442/// Used in `./src/driver.rs`.
443443#[ allow( clippy:: too_many_lines) ]
444- #[ rustfmt:: skip]
445444pub fn register_plugins ( store : & mut rustc_lint:: LintStore , sess : & Session , conf : & Conf ) {
446445 register_removed_non_tool_lints ( store) ;
447446
@@ -493,11 +492,13 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
493492 let vec_box_size_threshold = conf. vec_box_size_threshold ;
494493 let type_complexity_threshold = conf. type_complexity_threshold ;
495494 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+ } ) ;
501502 store. register_late_pass ( || Box :: new ( booleans:: NonminimalBool ) ) ;
502503 store. register_late_pass ( || Box :: new ( needless_bitwise_bool:: NeedlessBitwiseBool ) ) ;
503504 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:
535536
536537 let msrv = conf. msrv . as_ref ( ) . and_then ( |s| {
537538 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+ ) ) ;
539543 None
540544 } )
541545 } ) ;
@@ -579,10 +583,14 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
579583 store. register_late_pass ( || Box :: new ( temporary_assignment:: TemporaryAssignment ) ) ;
580584 store. register_late_pass ( || Box :: new ( transmute:: Transmute ) ) ;
581585 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+ } ) ;
583591 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 } ) ) ;
586594 store. register_late_pass ( || Box :: new ( panic_unimplemented:: PanicUnimplemented ) ) ;
587595 store. register_late_pass ( || Box :: new ( strings:: StringLitAsBytes ) ) ;
588596 store. register_late_pass ( || Box :: new ( derive:: Derive ) ) ;
@@ -603,7 +611,12 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
603611 store. register_late_pass ( move || Box :: new ( blacklisted_name:: BlacklistedName :: new ( blacklisted_names. clone ( ) ) ) ) ;
604612 let too_many_arguments_threshold = conf. too_many_arguments_threshold ;
605613 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+ } ) ;
607620 let doc_valid_idents = conf. doc_valid_idents . iter ( ) . cloned ( ) . collect :: < FxHashSet < _ > > ( ) ;
608621 store. register_late_pass ( move || Box :: new ( doc:: DocMarkdown :: new ( doc_valid_idents. clone ( ) ) ) ) ;
609622 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:
688701 store. register_late_pass ( || Box :: new ( multiple_crate_versions:: MultipleCrateVersions ) ) ;
689702 store. register_late_pass ( || Box :: new ( wildcard_dependencies:: WildcardDependencies ) ) ;
690703 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+ } ) ;
692709 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+ } ) ;
694715 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+ } ) ;
696722 store. register_early_pass ( || Box :: new ( tabs_in_doc_comments:: TabsInDocComments ) ) ;
697723 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+ } ) ;
699730 store. register_late_pass ( || Box :: new ( default:: Default :: default ( ) ) ) ;
700731 store. register_late_pass ( || Box :: new ( unused_self:: UnusedSelf ) ) ;
701732 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:
710741 store. register_early_pass ( || Box :: new ( single_component_path_imports:: SingleComponentPathImports ) ) ;
711742 let max_fn_params_bools = conf. max_fn_params_bools ;
712743 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+ } ) ;
714750 store. register_early_pass ( || Box :: new ( option_env_unwrap:: OptionEnvUnwrap ) ) ;
715751 let warn_on_all_wildcard_imports = conf. warn_on_all_wildcard_imports ;
716752 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:
729765 store. register_late_pass ( || Box :: new ( vec_resize_to_zero:: VecResizeToZero ) ) ;
730766 store. register_late_pass ( || Box :: new ( panic_in_result_fn:: PanicInResultFn ) ) ;
731767 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+ } ) ;
735773 let macro_matcher = conf. standard_macro_braces . iter ( ) . cloned ( ) . collect :: < FxHashSet < _ > > ( ) ;
736774 store. register_early_pass ( move || Box :: new ( nonstandard_macro_braces:: MacroBraces :: new ( & macro_matcher) ) ) ;
737775 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:
754792 store. register_late_pass ( || Box :: new ( strings:: StringToString ) ) ;
755793 store. register_late_pass ( || Box :: new ( zero_sized_map_values:: ZeroSizedMapValues ) ) ;
756794 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+ } ) ;
758798 store. register_late_pass ( || Box :: new ( redundant_slicing:: RedundantSlicing ) ) ;
759799 store. register_late_pass ( || Box :: new ( from_str_radix_10:: FromStrRadix10 ) ) ;
760800 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:
765805 let disallowed_types = conf. disallowed_types . clone ( ) ;
766806 store. register_late_pass ( move || Box :: new ( disallowed_type:: DisallowedType :: new ( disallowed_types. clone ( ) ) ) ) ;
767807 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+ } ) ;
769813 let scripts = conf. allowed_scripts . clone ( ) ;
770814 store. register_early_pass ( move || Box :: new ( disallowed_script_idents:: DisallowedScriptIdents :: new ( & scripts) ) ) ;
771815 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:
774818 store. register_late_pass ( move || Box :: new ( iter_not_returning_iterator:: IterNotReturningIterator ) ) ;
775819 store. register_late_pass ( move || Box :: new ( manual_assert:: ManualAssert ) ) ;
776820 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+ } ) ;
778826 store. register_late_pass ( move || Box :: new ( undocumented_unsafe_blocks:: UndocumentedUnsafeBlocks :: default ( ) ) ) ;
779827 store. register_late_pass ( || Box :: new ( match_str_case_mismatch:: MatchStrCaseMismatch ) ) ;
780828 store. register_late_pass ( move || Box :: new ( format_args:: FormatArgs ) ) ;
0 commit comments