@@ -904,14 +904,23 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
904904 & unwrap_in_result:: UNWRAP_IN_RESULT ,
905905 & use_self:: USE_SELF ,
906906 & useless_conversion:: USELESS_CONVERSION ,
907+ #[ cfg( feature = "internal-lints" ) ]
907908 & utils:: internal_lints:: CLIPPY_LINTS_INTERNAL ,
909+ #[ cfg( feature = "internal-lints" ) ]
908910 & utils:: internal_lints:: COLLAPSIBLE_SPAN_LINT_CALLS ,
911+ #[ cfg( feature = "internal-lints" ) ]
909912 & utils:: internal_lints:: COMPILER_LINT_FUNCTIONS ,
913+ #[ cfg( feature = "internal-lints" ) ]
910914 & utils:: internal_lints:: DEFAULT_LINT ,
915+ #[ cfg( feature = "internal-lints" ) ]
911916 & utils:: internal_lints:: INVALID_PATHS ,
917+ #[ cfg( feature = "internal-lints" ) ]
912918 & utils:: internal_lints:: LINT_WITHOUT_LINT_PASS ,
919+ #[ cfg( feature = "internal-lints" ) ]
913920 & utils:: internal_lints:: MATCH_TYPE_ON_DIAGNOSTIC_ITEM ,
921+ #[ cfg( feature = "internal-lints" ) ]
914922 & utils:: internal_lints:: OUTER_EXPN_EXPN_DATA ,
923+ #[ cfg( feature = "internal-lints" ) ]
915924 & utils:: internal_lints:: PRODUCE_ICE ,
916925 & vec:: USELESS_VEC ,
917926 & vec_resize_to_zero:: VEC_RESIZE_TO_ZERO ,
@@ -932,11 +941,14 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
932941 // end register lints, do not remove this comment, it’s used in `update_lints`
933942 store. register_late_pass ( || box await_holding_invalid:: AwaitHolding ) ;
934943 store. register_late_pass ( || box serde_api:: SerdeAPI ) ;
935- store. register_late_pass ( || box utils:: internal_lints:: CompilerLintFunctions :: new ( ) ) ;
936- store. register_late_pass ( || box utils:: internal_lints:: LintWithoutLintPass :: default ( ) ) ;
937- store. register_late_pass ( || box utils:: internal_lints:: OuterExpnDataPass ) ;
938- store. register_late_pass ( || box utils:: internal_lints:: InvalidPaths ) ;
939- store. register_late_pass ( || box utils:: inspector:: DeepCodeInspector ) ;
944+ #[ cfg( feature = "internal-lints" ) ]
945+ {
946+ store. register_late_pass ( || box utils:: internal_lints:: CompilerLintFunctions :: new ( ) ) ;
947+ store. register_late_pass ( || box utils:: internal_lints:: LintWithoutLintPass :: default ( ) ) ;
948+ store. register_late_pass ( || box utils:: internal_lints:: OuterExpnDataPass ) ;
949+ store. register_late_pass ( || box utils:: internal_lints:: InvalidPaths ) ;
950+ store. register_late_pass ( || box utils:: inspector:: DeepCodeInspector ) ;
951+ }
940952 store. register_late_pass ( || box utils:: author:: Author ) ;
941953 let vec_box_size_threshold = conf. vec_box_size_threshold ;
942954 store. register_late_pass ( move || box types:: Types :: new ( vec_box_size_threshold) ) ;
@@ -1122,6 +1134,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
11221134 store. register_early_pass ( || box literal_representation:: LiteralDigitGrouping ) ;
11231135 let literal_representation_threshold = conf. literal_representation_threshold ;
11241136 store. register_early_pass ( move || box literal_representation:: DecimalLiteralRepresentation :: new ( literal_representation_threshold) ) ;
1137+ #[ cfg( feature = "internal-lints" ) ]
11251138 store. register_early_pass ( || box utils:: internal_lints:: ClippyLintsInternal ) ;
11261139 let enum_variant_name_threshold = conf. enum_variant_name_threshold ;
11271140 store. register_early_pass ( move || box enum_variants:: EnumVariantNames :: new ( enum_variant_name_threshold) ) ;
@@ -1136,6 +1149,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
11361149 store. register_late_pass ( move || box large_const_arrays:: LargeConstArrays :: new ( array_size_threshold) ) ;
11371150 store. register_late_pass ( || box floating_point_arithmetic:: FloatingPointArithmetic ) ;
11381151 store. register_early_pass ( || box as_conversions:: AsConversions ) ;
1152+ #[ cfg( feature = "internal-lints" ) ]
11391153 store. register_early_pass ( || box utils:: internal_lints:: ProduceIce ) ;
11401154 store. register_late_pass ( || box let_underscore:: LetUnderscore ) ;
11411155 store. register_late_pass ( || box atomic_ordering:: AtomicOrdering ) ;
@@ -1152,6 +1166,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
11521166 store. register_late_pass ( || box dereference:: Dereferencing ) ;
11531167 store. register_late_pass ( || box option_if_let_else:: OptionIfLetElse ) ;
11541168 store. register_late_pass ( || box future_not_send:: FutureNotSend ) ;
1169+ #[ cfg( feature = "internal-lints" ) ]
11551170 store. register_late_pass ( || box utils:: internal_lints:: CollapsibleCalls ) ;
11561171 store. register_late_pass ( || box if_let_mutex:: IfLetMutex ) ;
11571172 store. register_late_pass ( || box mut_mutex_lock:: MutMutexLock ) ;
@@ -1177,6 +1192,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
11771192 store. register_late_pass ( || box manual_ok_or:: ManualOkOr ) ;
11781193 store. register_late_pass ( || box float_equality_without_abs:: FloatEqualityWithoutAbs ) ;
11791194 store. register_late_pass ( || box async_yields_async:: AsyncYieldsAsync ) ;
1195+ #[ cfg( feature = "internal-lints" ) ]
11801196 store. register_late_pass ( || box utils:: internal_lints:: MatchTypeOnDiagItem ) ;
11811197 let disallowed_methods = conf. disallowed_methods . iter ( ) . cloned ( ) . collect :: < FxHashSet < _ > > ( ) ;
11821198 store. register_late_pass ( move || box disallowed_method:: DisallowedMethod :: new ( & disallowed_methods) ) ;
@@ -1317,7 +1333,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
13171333 LintId :: of( & wildcard_imports:: ENUM_GLOB_USE ) ,
13181334 LintId :: of( & wildcard_imports:: WILDCARD_IMPORTS ) ,
13191335 ] ) ;
1320-
1336+ # [ cfg ( feature = "internal-lints" ) ]
13211337 store. register_group ( true , "clippy::internal" , Some ( "clippy_internal" ) , vec ! [
13221338 LintId :: of( & utils:: internal_lints:: CLIPPY_LINTS_INTERNAL ) ,
13231339 LintId :: of( & utils:: internal_lints:: COLLAPSIBLE_SPAN_LINT_CALLS ) ,
0 commit comments