@@ -499,6 +499,24 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
499
499
500
500
// begin register lints, do not remove this comment, it’s used in `update_lints`
501
501
store. register_lints ( & [
502
+ #[ cfg( feature = "internal-lints" ) ]
503
+ & utils:: internal_lints:: CLIPPY_LINTS_INTERNAL ,
504
+ #[ cfg( feature = "internal-lints" ) ]
505
+ & utils:: internal_lints:: COLLAPSIBLE_SPAN_LINT_CALLS ,
506
+ #[ cfg( feature = "internal-lints" ) ]
507
+ & utils:: internal_lints:: COMPILER_LINT_FUNCTIONS ,
508
+ #[ cfg( feature = "internal-lints" ) ]
509
+ & utils:: internal_lints:: DEFAULT_LINT ,
510
+ #[ cfg( feature = "internal-lints" ) ]
511
+ & utils:: internal_lints:: INVALID_PATHS ,
512
+ #[ cfg( feature = "internal-lints" ) ]
513
+ & utils:: internal_lints:: LINT_WITHOUT_LINT_PASS ,
514
+ #[ cfg( feature = "internal-lints" ) ]
515
+ & utils:: internal_lints:: MATCH_TYPE_ON_DIAGNOSTIC_ITEM ,
516
+ #[ cfg( feature = "internal-lints" ) ]
517
+ & utils:: internal_lints:: OUTER_EXPN_EXPN_DATA ,
518
+ #[ cfg( feature = "internal-lints" ) ]
519
+ & utils:: internal_lints:: PRODUCE_ICE ,
502
520
& approx_const:: APPROX_CONSTANT ,
503
521
& arithmetic:: FLOAT_ARITHMETIC ,
504
522
& arithmetic:: INTEGER_ARITHMETIC ,
@@ -902,15 +920,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
902
920
& unwrap_in_result:: UNWRAP_IN_RESULT ,
903
921
& use_self:: USE_SELF ,
904
922
& useless_conversion:: USELESS_CONVERSION ,
905
- & utils:: internal_lints:: CLIPPY_LINTS_INTERNAL ,
906
- & utils:: internal_lints:: COLLAPSIBLE_SPAN_LINT_CALLS ,
907
- & utils:: internal_lints:: COMPILER_LINT_FUNCTIONS ,
908
- & utils:: internal_lints:: DEFAULT_LINT ,
909
- & utils:: internal_lints:: INVALID_PATHS ,
910
- & utils:: internal_lints:: LINT_WITHOUT_LINT_PASS ,
911
- & utils:: internal_lints:: MATCH_TYPE_ON_DIAGNOSTIC_ITEM ,
912
- & utils:: internal_lints:: OUTER_EXPN_EXPN_DATA ,
913
- & utils:: internal_lints:: PRODUCE_ICE ,
914
923
& vec:: USELESS_VEC ,
915
924
& vec_resize_to_zero:: VEC_RESIZE_TO_ZERO ,
916
925
& verbose_file_reads:: VERBOSE_FILE_READS ,
@@ -931,11 +940,14 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
931
940
932
941
store. register_late_pass ( || box await_holding_invalid:: AwaitHolding ) ;
933
942
store. register_late_pass ( || box serde_api:: SerdeAPI ) ;
934
- store. register_late_pass ( || box utils:: internal_lints:: CompilerLintFunctions :: new ( ) ) ;
935
- store. register_late_pass ( || box utils:: internal_lints:: LintWithoutLintPass :: default ( ) ) ;
936
- store. register_late_pass ( || box utils:: internal_lints:: OuterExpnDataPass ) ;
937
- store. register_late_pass ( || box utils:: internal_lints:: InvalidPaths ) ;
938
- store. register_late_pass ( || box utils:: inspector:: DeepCodeInspector ) ;
943
+ #[ cfg( feature = "internal-lints" ) ]
944
+ {
945
+ store. register_late_pass ( || box utils:: internal_lints:: CompilerLintFunctions :: new ( ) ) ;
946
+ store. register_late_pass ( || box utils:: internal_lints:: LintWithoutLintPass :: default ( ) ) ;
947
+ store. register_late_pass ( || box utils:: internal_lints:: OuterExpnDataPass ) ;
948
+ store. register_late_pass ( || box utils:: internal_lints:: InvalidPaths ) ;
949
+ store. register_late_pass ( || box utils:: inspector:: DeepCodeInspector ) ;
950
+ }
939
951
store. register_late_pass ( || box utils:: author:: Author ) ;
940
952
let vec_box_size_threshold = conf. vec_box_size_threshold ;
941
953
store. register_late_pass ( move || box types:: Types :: new ( vec_box_size_threshold) ) ;
@@ -1104,6 +1116,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
1104
1116
store. register_early_pass ( || box literal_representation:: LiteralDigitGrouping ) ;
1105
1117
let literal_representation_threshold = conf. literal_representation_threshold ;
1106
1118
store. register_early_pass ( move || box literal_representation:: DecimalLiteralRepresentation :: new ( literal_representation_threshold) ) ;
1119
+ #[ cfg( feature = "internal-lints" ) ]
1107
1120
store. register_early_pass ( || box utils:: internal_lints:: ClippyLintsInternal ) ;
1108
1121
let enum_variant_name_threshold = conf. enum_variant_name_threshold ;
1109
1122
store. register_early_pass ( move || box enum_variants:: EnumVariantNames :: new ( enum_variant_name_threshold) ) ;
@@ -1118,6 +1131,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
1118
1131
store. register_late_pass ( move || box large_const_arrays:: LargeConstArrays :: new ( array_size_threshold) ) ;
1119
1132
store. register_late_pass ( || box floating_point_arithmetic:: FloatingPointArithmetic ) ;
1120
1133
store. register_early_pass ( || box as_conversions:: AsConversions ) ;
1134
+ #[ cfg( feature = "internal-lints" ) ]
1121
1135
store. register_early_pass ( || box utils:: internal_lints:: ProduceIce ) ;
1122
1136
store. register_late_pass ( || box let_underscore:: LetUnderscore ) ;
1123
1137
store. register_late_pass ( || box atomic_ordering:: AtomicOrdering ) ;
@@ -1134,6 +1148,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
1134
1148
store. register_late_pass ( || box dereference:: Dereferencing ) ;
1135
1149
store. register_late_pass ( || box option_if_let_else:: OptionIfLetElse ) ;
1136
1150
store. register_late_pass ( || box future_not_send:: FutureNotSend ) ;
1151
+ #[ cfg( feature = "internal-lints" ) ]
1137
1152
store. register_late_pass ( || box utils:: internal_lints:: CollapsibleCalls ) ;
1138
1153
store. register_late_pass ( || box if_let_mutex:: IfLetMutex ) ;
1139
1154
store. register_late_pass ( || box mut_mutex_lock:: MutMutexLock ) ;
@@ -1161,6 +1176,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
1161
1176
store. register_late_pass ( || box float_equality_without_abs:: FloatEqualityWithoutAbs ) ;
1162
1177
store. register_late_pass ( || box async_yields_async:: AsyncYieldsAsync ) ;
1163
1178
store. register_late_pass ( || box manual_strip:: ManualStrip ) ;
1179
+ #[ cfg( feature = "internal-lints" ) ]
1164
1180
store. register_late_pass ( || box utils:: internal_lints:: MatchTypeOnDiagItem ) ;
1165
1181
let disallowed_methods = conf. disallowed_methods . iter ( ) . cloned ( ) . collect :: < FxHashSet < _ > > ( ) ;
1166
1182
store. register_late_pass ( move || box disallowed_method:: DisallowedMethod :: new ( & disallowed_methods) ) ;
@@ -1295,7 +1311,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
1295
1311
LintId :: of( & wildcard_imports:: ENUM_GLOB_USE ) ,
1296
1312
LintId :: of( & wildcard_imports:: WILDCARD_IMPORTS ) ,
1297
1313
] ) ;
1298
-
1314
+ # [ cfg ( feature = "internal-lints" ) ]
1299
1315
store. register_group ( true , "clippy::internal" , Some ( "clippy_internal" ) , vec ! [
1300
1316
LintId :: of( & utils:: internal_lints:: CLIPPY_LINTS_INTERNAL ) ,
1301
1317
LintId :: of( & utils:: internal_lints:: COLLAPSIBLE_SPAN_LINT_CALLS ) ,
0 commit comments