@@ -498,6 +498,24 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
498
498
499
499
// begin register lints, do not remove this comment, it’s used in `update_lints`
500
500
store. register_lints ( & [
501
+ #[ cfg( feature = "internal-lints" ) ]
502
+ & utils:: internal_lints:: CLIPPY_LINTS_INTERNAL ,
503
+ #[ cfg( feature = "internal-lints" ) ]
504
+ & utils:: internal_lints:: COLLAPSIBLE_SPAN_LINT_CALLS ,
505
+ #[ cfg( feature = "internal-lints" ) ]
506
+ & utils:: internal_lints:: COMPILER_LINT_FUNCTIONS ,
507
+ #[ cfg( feature = "internal-lints" ) ]
508
+ & utils:: internal_lints:: DEFAULT_LINT ,
509
+ #[ cfg( feature = "internal-lints" ) ]
510
+ & utils:: internal_lints:: INVALID_PATHS ,
511
+ #[ cfg( feature = "internal-lints" ) ]
512
+ & utils:: internal_lints:: LINT_WITHOUT_LINT_PASS ,
513
+ #[ cfg( feature = "internal-lints" ) ]
514
+ & utils:: internal_lints:: MATCH_TYPE_ON_DIAGNOSTIC_ITEM ,
515
+ #[ cfg( feature = "internal-lints" ) ]
516
+ & utils:: internal_lints:: OUTER_EXPN_EXPN_DATA ,
517
+ #[ cfg( feature = "internal-lints" ) ]
518
+ & utils:: internal_lints:: PRODUCE_ICE ,
501
519
& approx_const:: APPROX_CONSTANT ,
502
520
& arithmetic:: FLOAT_ARITHMETIC ,
503
521
& arithmetic:: INTEGER_ARITHMETIC ,
@@ -904,15 +922,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
904
922
& unwrap_in_result:: UNWRAP_IN_RESULT ,
905
923
& use_self:: USE_SELF ,
906
924
& useless_conversion:: USELESS_CONVERSION ,
907
- & utils:: internal_lints:: CLIPPY_LINTS_INTERNAL ,
908
- & utils:: internal_lints:: COLLAPSIBLE_SPAN_LINT_CALLS ,
909
- & utils:: internal_lints:: COMPILER_LINT_FUNCTIONS ,
910
- & utils:: internal_lints:: DEFAULT_LINT ,
911
- & utils:: internal_lints:: INVALID_PATHS ,
912
- & utils:: internal_lints:: LINT_WITHOUT_LINT_PASS ,
913
- & utils:: internal_lints:: MATCH_TYPE_ON_DIAGNOSTIC_ITEM ,
914
- & utils:: internal_lints:: OUTER_EXPN_EXPN_DATA ,
915
- & utils:: internal_lints:: PRODUCE_ICE ,
916
925
& vec:: USELESS_VEC ,
917
926
& vec_resize_to_zero:: VEC_RESIZE_TO_ZERO ,
918
927
& verbose_file_reads:: VERBOSE_FILE_READS ,
@@ -930,14 +939,23 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
930
939
& zero_div_zero:: ZERO_DIVIDED_BY_ZERO ,
931
940
] ) ;
932
941
// end register lints, do not remove this comment, it’s used in `update_lints`
942
+
943
+ // all the internal lints
944
+ #[ cfg( feature = "internal-lints" ) ]
945
+ {
946
+ store. register_early_pass ( || box utils:: internal_lints:: ClippyLintsInternal ) ;
947
+ store. register_early_pass ( || box utils:: internal_lints:: ProduceIce ) ;
948
+ store. register_late_pass ( || box utils:: inspector:: DeepCodeInspector ) ;
949
+ store. register_late_pass ( || box utils:: internal_lints:: CollapsibleCalls ) ;
950
+ store. register_late_pass ( || box utils:: internal_lints:: CompilerLintFunctions :: new ( ) ) ;
951
+ store. register_late_pass ( || box utils:: internal_lints:: InvalidPaths ) ;
952
+ store. register_late_pass ( || box utils:: internal_lints:: LintWithoutLintPass :: default ( ) ) ;
953
+ store. register_late_pass ( || box utils:: internal_lints:: MatchTypeOnDiagItem ) ;
954
+ store. register_late_pass ( || box utils:: internal_lints:: OuterExpnDataPass ) ;
955
+ }
956
+ store. register_late_pass ( || box utils:: author:: Author ) ;
933
957
store. register_late_pass ( || box await_holding_invalid:: AwaitHolding ) ;
934
958
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 ) ;
940
- store. register_late_pass ( || box utils:: author:: Author ) ;
941
959
let vec_box_size_threshold = conf. vec_box_size_threshold ;
942
960
store. register_late_pass ( move || box types:: Types :: new ( vec_box_size_threshold) ) ;
943
961
store. register_late_pass ( || box booleans:: NonminimalBool ) ;
@@ -1122,7 +1140,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
1122
1140
store. register_early_pass ( || box literal_representation:: LiteralDigitGrouping ) ;
1123
1141
let literal_representation_threshold = conf. literal_representation_threshold ;
1124
1142
store. register_early_pass ( move || box literal_representation:: DecimalLiteralRepresentation :: new ( literal_representation_threshold) ) ;
1125
- store. register_early_pass ( || box utils:: internal_lints:: ClippyLintsInternal ) ;
1126
1143
let enum_variant_name_threshold = conf. enum_variant_name_threshold ;
1127
1144
store. register_early_pass ( move || box enum_variants:: EnumVariantNames :: new ( enum_variant_name_threshold) ) ;
1128
1145
store. register_early_pass ( || box tabs_in_doc_comments:: TabsInDocComments ) ;
@@ -1136,7 +1153,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
1136
1153
store. register_late_pass ( move || box large_const_arrays:: LargeConstArrays :: new ( array_size_threshold) ) ;
1137
1154
store. register_late_pass ( || box floating_point_arithmetic:: FloatingPointArithmetic ) ;
1138
1155
store. register_early_pass ( || box as_conversions:: AsConversions ) ;
1139
- store. register_early_pass ( || box utils:: internal_lints:: ProduceIce ) ;
1140
1156
store. register_late_pass ( || box let_underscore:: LetUnderscore ) ;
1141
1157
store. register_late_pass ( || box atomic_ordering:: AtomicOrdering ) ;
1142
1158
store. register_early_pass ( || box single_component_path_imports:: SingleComponentPathImports ) ;
@@ -1152,15 +1168,13 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
1152
1168
store. register_late_pass ( || box dereference:: Dereferencing ) ;
1153
1169
store. register_late_pass ( || box option_if_let_else:: OptionIfLetElse ) ;
1154
1170
store. register_late_pass ( || box future_not_send:: FutureNotSend ) ;
1155
- store. register_late_pass ( || box utils:: internal_lints:: CollapsibleCalls ) ;
1156
1171
store. register_late_pass ( || box if_let_mutex:: IfLetMutex ) ;
1157
1172
store. register_late_pass ( || box mut_mutex_lock:: MutMutexLock ) ;
1158
1173
store. register_late_pass ( || box match_on_vec_items:: MatchOnVecItems ) ;
1159
1174
store. register_late_pass ( || box manual_async_fn:: ManualAsyncFn ) ;
1160
1175
store. register_early_pass ( || box redundant_field_names:: RedundantFieldNames ) ;
1161
1176
store. register_late_pass ( || box vec_resize_to_zero:: VecResizeToZero ) ;
1162
1177
store. register_late_pass ( || box panic_in_result_fn:: PanicInResultFn ) ;
1163
-
1164
1178
let single_char_binding_names_threshold = conf. single_char_binding_names_threshold ;
1165
1179
store. register_early_pass ( move || box non_expressive_names:: NonExpressiveNames {
1166
1180
single_char_binding_names_threshold,
@@ -1177,7 +1191,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
1177
1191
store. register_late_pass ( || box manual_ok_or:: ManualOkOr ) ;
1178
1192
store. register_late_pass ( || box float_equality_without_abs:: FloatEqualityWithoutAbs ) ;
1179
1193
store. register_late_pass ( || box async_yields_async:: AsyncYieldsAsync ) ;
1180
- store. register_late_pass ( || box utils:: internal_lints:: MatchTypeOnDiagItem ) ;
1181
1194
let disallowed_methods = conf. disallowed_methods . iter ( ) . cloned ( ) . collect :: < FxHashSet < _ > > ( ) ;
1182
1195
store. register_late_pass ( move || box disallowed_method:: DisallowedMethod :: new ( & disallowed_methods) ) ;
1183
1196
store. register_early_pass ( || box asm_syntax:: InlineAsmX86AttSyntax ) ;
@@ -1186,7 +1199,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
1186
1199
store. register_late_pass ( || box strings:: StrToString ) ;
1187
1200
store. register_late_pass ( || box strings:: StringToString ) ;
1188
1201
1189
-
1190
1202
store. register_group ( true , "clippy::restriction" , Some ( "clippy_restriction" ) , vec ! [
1191
1203
LintId :: of( & arithmetic:: FLOAT_ARITHMETIC ) ,
1192
1204
LintId :: of( & arithmetic:: INTEGER_ARITHMETIC ) ,
@@ -1318,6 +1330,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
1318
1330
LintId :: of( & wildcard_imports:: WILDCARD_IMPORTS ) ,
1319
1331
] ) ;
1320
1332
1333
+ #[ cfg( feature = "internal-lints" ) ]
1321
1334
store. register_group ( true , "clippy::internal" , Some ( "clippy_internal" ) , vec ! [
1322
1335
LintId :: of( & utils:: internal_lints:: CLIPPY_LINTS_INTERNAL ) ,
1323
1336
LintId :: of( & utils:: internal_lints:: COLLAPSIBLE_SPAN_LINT_CALLS ) ,
0 commit comments