@@ -181,6 +181,7 @@ mod bool_assert_comparison;
181
181
mod bool_to_int_with_if;
182
182
mod booleans;
183
183
mod borrow_deref_ref;
184
+ mod box_default;
184
185
mod cargo;
185
186
mod casts;
186
187
mod checked_conversions;
@@ -533,8 +534,8 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
533
534
store. register_late_pass ( || Box :: new ( utils:: internal_lints:: CompilerLintFunctions :: new ( ) ) ) ;
534
535
store. register_late_pass ( || Box :: new ( utils:: internal_lints:: IfChainStyle ) ) ;
535
536
store. register_late_pass ( || Box :: new ( utils:: internal_lints:: InvalidPaths ) ) ;
536
- store. register_late_pass ( || Box :: new ( utils:: internal_lints:: InterningDefinedSymbol :: default ( ) ) ) ;
537
- store. register_late_pass ( || Box :: new ( utils:: internal_lints:: LintWithoutLintPass :: default ( ) ) ) ;
537
+ store. register_late_pass ( || Box :: < utils:: internal_lints:: InterningDefinedSymbol > :: default ( ) ) ;
538
+ store. register_late_pass ( || Box :: < utils:: internal_lints:: LintWithoutLintPass > :: default ( ) ) ;
538
539
store. register_late_pass ( || Box :: new ( utils:: internal_lints:: MatchTypeOnDiagItem ) ) ;
539
540
store. register_late_pass ( || Box :: new ( utils:: internal_lints:: OuterExpnDataPass ) ) ;
540
541
store. register_late_pass ( || Box :: new ( utils:: internal_lints:: MsrvAttrImpl ) ) ;
@@ -627,10 +628,10 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
627
628
msrv,
628
629
) )
629
630
} ) ;
630
- store. register_late_pass ( || Box :: new ( shadow:: Shadow :: default ( ) ) ) ;
631
+ store. register_late_pass ( || Box :: < shadow:: Shadow > :: default ( ) ) ;
631
632
store. register_late_pass ( || Box :: new ( unit_types:: UnitTypes ) ) ;
632
633
store. register_late_pass ( || Box :: new ( loops:: Loops ) ) ;
633
- store. register_late_pass ( || Box :: new ( main_recursion:: MainRecursion :: default ( ) ) ) ;
634
+ store. register_late_pass ( || Box :: < main_recursion:: MainRecursion > :: default ( ) ) ;
634
635
store. register_late_pass ( || Box :: new ( lifetimes:: Lifetimes ) ) ;
635
636
store. register_late_pass ( || Box :: new ( entry:: HashMapPass ) ) ;
636
637
store. register_late_pass ( || Box :: new ( minmax:: MinMaxPass ) ) ;
@@ -664,7 +665,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
664
665
store. register_late_pass ( || Box :: new ( format:: UselessFormat ) ) ;
665
666
store. register_late_pass ( || Box :: new ( swap:: Swap ) ) ;
666
667
store. register_late_pass ( || Box :: new ( overflow_check_conditional:: OverflowCheckConditional ) ) ;
667
- store. register_late_pass ( || Box :: new ( new_without_default:: NewWithoutDefault :: default ( ) ) ) ;
668
+ store. register_late_pass ( || Box :: < new_without_default:: NewWithoutDefault > :: default ( ) ) ;
668
669
let disallowed_names = conf. disallowed_names . iter ( ) . cloned ( ) . collect :: < FxHashSet < _ > > ( ) ;
669
670
store. register_late_pass ( move || Box :: new ( disallowed_names:: DisallowedNames :: new ( disallowed_names. clone ( ) ) ) ) ;
670
671
let too_many_arguments_threshold = conf. too_many_arguments_threshold ;
@@ -703,7 +704,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
703
704
store. register_late_pass ( || Box :: new ( ref_option_ref:: RefOptionRef ) ) ;
704
705
store. register_late_pass ( || Box :: new ( infinite_iter:: InfiniteIter ) ) ;
705
706
store. register_late_pass ( || Box :: new ( inline_fn_without_body:: InlineFnWithoutBody ) ) ;
706
- store. register_late_pass ( || Box :: new ( useless_conversion:: UselessConversion :: default ( ) ) ) ;
707
+ store. register_late_pass ( || Box :: < useless_conversion:: UselessConversion > :: default ( ) ) ;
707
708
store. register_late_pass ( || Box :: new ( implicit_hasher:: ImplicitHasher ) ) ;
708
709
store. register_late_pass ( || Box :: new ( fallible_impl_from:: FallibleImplFrom ) ) ;
709
710
store. register_late_pass ( || Box :: new ( question_mark:: QuestionMark ) ) ;
@@ -773,7 +774,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
773
774
upper_case_acronyms_aggressive,
774
775
) )
775
776
} ) ;
776
- store. register_late_pass ( || Box :: new ( default:: Default :: default ( ) ) ) ;
777
+ store. register_late_pass ( || Box :: < default:: Default > :: default ( ) ) ;
777
778
store. register_late_pass ( move || Box :: new ( unused_self:: UnusedSelf :: new ( avoid_breaking_exported_api) ) ) ;
778
779
store. register_late_pass ( || Box :: new ( mutable_debug_assertion:: DebugAssertWithMutCall ) ) ;
779
780
store. register_late_pass ( || Box :: new ( exit:: Exit ) ) ;
@@ -796,7 +797,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
796
797
store. register_early_pass ( || Box :: new ( option_env_unwrap:: OptionEnvUnwrap ) ) ;
797
798
let warn_on_all_wildcard_imports = conf. warn_on_all_wildcard_imports ;
798
799
store. register_late_pass ( move || Box :: new ( wildcard_imports:: WildcardImports :: new ( warn_on_all_wildcard_imports) ) ) ;
799
- store. register_late_pass ( || Box :: new ( redundant_pub_crate:: RedundantPubCrate :: default ( ) ) ) ;
800
+ store. register_late_pass ( || Box :: < redundant_pub_crate:: RedundantPubCrate > :: default ( ) ) ;
800
801
store. register_late_pass ( || Box :: new ( unnamed_address:: UnnamedAddress ) ) ;
801
802
store. register_late_pass ( move || Box :: new ( dereference:: Dereferencing :: new ( msrv) ) ) ;
802
803
store. register_late_pass ( || Box :: new ( option_if_let_else:: OptionIfLetElse ) ) ;
@@ -814,7 +815,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
814
815
} ) ;
815
816
let macro_matcher = conf. standard_macro_braces . iter ( ) . cloned ( ) . collect :: < FxHashSet < _ > > ( ) ;
816
817
store. register_early_pass ( move || Box :: new ( nonstandard_macro_braces:: MacroBraces :: new ( & macro_matcher) ) ) ;
817
- store. register_late_pass ( || Box :: new ( macro_use:: MacroUseImports :: default ( ) ) ) ;
818
+ store. register_late_pass ( || Box :: < macro_use:: MacroUseImports > :: default ( ) ) ;
818
819
store. register_late_pass ( || Box :: new ( pattern_type_mismatch:: PatternTypeMismatch ) ) ;
819
820
store. register_late_pass ( || Box :: new ( unwrap_in_result:: UnwrapInResult ) ) ;
820
821
store. register_late_pass ( || Box :: new ( semicolon_if_nothing_returned:: SemicolonIfNothingReturned ) ) ;
@@ -827,7 +828,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
827
828
store. register_late_pass ( || Box :: new ( strings:: StrToString ) ) ;
828
829
store. register_late_pass ( || Box :: new ( strings:: StringToString ) ) ;
829
830
store. register_late_pass ( || Box :: new ( zero_sized_map_values:: ZeroSizedMapValues ) ) ;
830
- store. register_late_pass ( || Box :: new ( vec_init_then_push:: VecInitThenPush :: default ( ) ) ) ;
831
+ store. register_late_pass ( || Box :: < vec_init_then_push:: VecInitThenPush > :: default ( ) ) ;
831
832
store. register_late_pass ( || Box :: new ( redundant_slicing:: RedundantSlicing ) ) ;
832
833
store. register_late_pass ( || Box :: new ( from_str_radix_10:: FromStrRadix10 ) ) ;
833
834
store. register_late_pass ( move || Box :: new ( if_then_some_else_none:: IfThenSomeElseNone :: new ( msrv) ) ) ;
@@ -865,7 +866,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
865
866
store. register_late_pass ( move || Box :: new ( manual_bits:: ManualBits :: new ( msrv) ) ) ;
866
867
store. register_late_pass ( || Box :: new ( default_union_representation:: DefaultUnionRepresentation ) ) ;
867
868
store. register_early_pass ( || Box :: new ( doc_link_with_quotes:: DocLinkWithQuotes ) ) ;
868
- store. register_late_pass ( || Box :: new ( only_used_in_recursion:: OnlyUsedInRecursion :: default ( ) ) ) ;
869
+ store. register_late_pass ( || Box :: < only_used_in_recursion:: OnlyUsedInRecursion > :: default ( ) ) ;
869
870
let allow_dbg_in_tests = conf. allow_dbg_in_tests ;
870
871
store. register_late_pass ( move || Box :: new ( dbg_macro:: DbgMacro :: new ( allow_dbg_in_tests) ) ) ;
871
872
let cargo_ignore_publish = conf. cargo_ignore_publish ;
@@ -874,7 +875,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
874
875
ignore_publish : cargo_ignore_publish,
875
876
} )
876
877
} ) ;
877
- store. register_late_pass ( || Box :: new ( write:: Write :: default ( ) ) ) ;
878
+ store. register_late_pass ( || Box :: < write:: Write > :: default ( ) ) ;
878
879
store. register_early_pass ( || Box :: new ( crate_in_macro_def:: CrateInMacroDef ) ) ;
879
880
store. register_early_pass ( || Box :: new ( empty_structs_with_brackets:: EmptyStructsWithBrackets ) ) ;
880
881
store. register_late_pass ( || Box :: new ( unnecessary_owned_empty_strings:: UnnecessaryOwnedEmptyStrings ) ) ;
@@ -884,7 +885,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
884
885
store. register_late_pass ( move || Box :: new ( large_include_file:: LargeIncludeFile :: new ( max_include_file_size) ) ) ;
885
886
store. register_late_pass ( || Box :: new ( strings:: TrimSplitWhitespace ) ) ;
886
887
store. register_late_pass ( || Box :: new ( rc_clone_in_vec_init:: RcCloneInVecInit ) ) ;
887
- store. register_early_pass ( || Box :: new ( duplicate_mod:: DuplicateMod :: default ( ) ) ) ;
888
+ store. register_early_pass ( || Box :: < duplicate_mod:: DuplicateMod > :: default ( ) ) ;
888
889
store. register_early_pass ( || Box :: new ( unused_rounding:: UnusedRounding ) ) ;
889
890
store. register_early_pass ( move || Box :: new ( almost_complete_letter_range:: AlmostCompleteLetterRange :: new ( msrv) ) ) ;
890
891
store. register_late_pass ( || Box :: new ( swap_ptr_to_ref:: SwapPtrToRef ) ) ;
@@ -896,13 +897,14 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
896
897
let verbose_bit_mask_threshold = conf. verbose_bit_mask_threshold ;
897
898
store. register_late_pass ( move || Box :: new ( operators:: Operators :: new ( verbose_bit_mask_threshold) ) ) ;
898
899
store. register_late_pass ( || Box :: new ( invalid_utf8_in_unchecked:: InvalidUtf8InUnchecked ) ) ;
899
- store. register_late_pass ( || Box :: new ( std_instead_of_core:: StdReexports :: default ( ) ) ) ;
900
+ store. register_late_pass ( || Box :: < std_instead_of_core:: StdReexports > :: default ( ) ) ;
900
901
store. register_late_pass ( || Box :: new ( manual_instant_elapsed:: ManualInstantElapsed ) ) ;
901
902
store. register_late_pass ( || Box :: new ( partialeq_to_none:: PartialeqToNone ) ) ;
902
903
store. register_late_pass ( || Box :: new ( manual_string_new:: ManualStringNew ) ) ;
903
904
store. register_late_pass ( || Box :: new ( unused_peekable:: UnusedPeekable ) ) ;
904
905
store. register_early_pass ( || Box :: new ( multi_assignments:: MultiAssignments ) ) ;
905
906
store. register_late_pass ( || Box :: new ( bool_to_int_with_if:: BoolToIntWithIf ) ) ;
907
+ store. register_late_pass ( || Box :: new ( box_default:: BoxDefault ) ) ;
906
908
// add lints here, do not remove this comment, it's used in `new_lint`
907
909
}
908
910
0 commit comments