]> git.lizzy.rs Git - rust.git/blob - clippy_lints/src/lib.rs
Auto merge of #7605 - xordi:issue-7548-fix, r=giraffate
[rust.git] / clippy_lints / src / lib.rs
1 // error-pattern:cargo-clippy
2
3 #![feature(box_patterns)]
4 #![feature(box_syntax)]
5 #![feature(drain_filter)]
6 #![feature(in_band_lifetimes)]
7 #![feature(iter_zip)]
8 #![feature(once_cell)]
9 #![feature(rustc_private)]
10 #![feature(stmt_expr_attributes)]
11 #![feature(control_flow_enum)]
12 #![recursion_limit = "512"]
13 #![cfg_attr(feature = "deny-warnings", deny(warnings))]
14 #![allow(clippy::missing_docs_in_private_items, clippy::must_use_candidate)]
15 #![warn(trivial_casts, trivial_numeric_casts)]
16 // warn on lints, that are included in `rust-lang/rust`s bootstrap
17 #![warn(rust_2018_idioms, unused_lifetimes)]
18 // warn on rustc internal lints
19 #![warn(rustc::internal)]
20
21 // FIXME: switch to something more ergonomic here, once available.
22 // (Currently there is no way to opt into sysroot crates without `extern crate`.)
23 extern crate rustc_ast;
24 extern crate rustc_ast_pretty;
25 extern crate rustc_data_structures;
26 extern crate rustc_driver;
27 extern crate rustc_errors;
28 extern crate rustc_hir;
29 extern crate rustc_hir_pretty;
30 extern crate rustc_index;
31 extern crate rustc_infer;
32 extern crate rustc_lexer;
33 extern crate rustc_lint;
34 extern crate rustc_middle;
35 extern crate rustc_mir;
36 extern crate rustc_parse;
37 extern crate rustc_parse_format;
38 extern crate rustc_session;
39 extern crate rustc_span;
40 extern crate rustc_target;
41 extern crate rustc_trait_selection;
42 extern crate rustc_typeck;
43
44 #[macro_use]
45 extern crate clippy_utils;
46
47 use clippy_utils::parse_msrv;
48 use rustc_data_structures::fx::FxHashSet;
49 use rustc_lint::LintId;
50 use rustc_session::Session;
51
52 /// Macro used to declare a Clippy lint.
53 ///
54 /// Every lint declaration consists of 4 parts:
55 ///
56 /// 1. The documentation, which is used for the website
57 /// 2. The `LINT_NAME`. See [lint naming][lint_naming] on lint naming conventions.
58 /// 3. The `lint_level`, which is a mapping from *one* of our lint groups to `Allow`, `Warn` or
59 ///    `Deny`. The lint level here has nothing to do with what lint groups the lint is a part of.
60 /// 4. The `description` that contains a short explanation on what's wrong with code where the
61 ///    lint is triggered.
62 ///
63 /// Currently the categories `style`, `correctness`, `suspicious`, `complexity` and `perf` are
64 /// enabled by default. As said in the README.md of this repository, if the lint level mapping
65 /// changes, please update README.md.
66 ///
67 /// # Example
68 ///
69 /// ```
70 /// #![feature(rustc_private)]
71 /// extern crate rustc_session;
72 /// use rustc_session::declare_tool_lint;
73 /// use clippy_lints::declare_clippy_lint;
74 ///
75 /// declare_clippy_lint! {
76 ///     /// ### What it does
77 ///     /// Checks for ... (describe what the lint matches).
78 ///     ///
79 ///     /// ### Why is this bad?
80 ///     /// Supply the reason for linting the code.
81 ///     ///
82 ///     /// ### Example
83 ///     /// ```rust
84 ///     /// // Bad
85 ///     /// Insert a short example of code that triggers the lint
86 ///     ///
87 ///     /// // Good
88 ///     /// Insert a short example of improved code that doesn't trigger the lint
89 ///     /// ```
90 ///     pub LINT_NAME,
91 ///     pedantic,
92 ///     "description"
93 /// }
94 /// ```
95 /// [lint_naming]: https://rust-lang.github.io/rfcs/0344-conventions-galore.html#lints
96 #[macro_export]
97 macro_rules! declare_clippy_lint {
98     { $(#[$attr:meta])* pub $name:tt, style, $description:tt } => {
99         declare_tool_lint! {
100             $(#[$attr])* pub clippy::$name, Warn, $description, report_in_external_macro: true
101         }
102     };
103     { $(#[$attr:meta])* pub $name:tt, correctness, $description:tt } => {
104         declare_tool_lint! {
105             $(#[$attr])* pub clippy::$name, Deny, $description, report_in_external_macro: true
106         }
107     };
108     { $(#[$attr:meta])* pub $name:tt, suspicious, $description:tt } => {
109         declare_tool_lint! {
110             $(#[$attr])* pub clippy::$name, Warn, $description, report_in_external_macro: true
111         }
112     };
113     { $(#[$attr:meta])* pub $name:tt, complexity, $description:tt } => {
114         declare_tool_lint! {
115             $(#[$attr])* pub clippy::$name, Warn, $description, report_in_external_macro: true
116         }
117     };
118     { $(#[$attr:meta])* pub $name:tt, perf, $description:tt } => {
119         declare_tool_lint! {
120             $(#[$attr])* pub clippy::$name, Warn, $description, report_in_external_macro: true
121         }
122     };
123     { $(#[$attr:meta])* pub $name:tt, pedantic, $description:tt } => {
124         declare_tool_lint! {
125             $(#[$attr])* pub clippy::$name, Allow, $description, report_in_external_macro: true
126         }
127     };
128     { $(#[$attr:meta])* pub $name:tt, restriction, $description:tt } => {
129         declare_tool_lint! {
130             $(#[$attr])* pub clippy::$name, Allow, $description, report_in_external_macro: true
131         }
132     };
133     { $(#[$attr:meta])* pub $name:tt, cargo, $description:tt } => {
134         declare_tool_lint! {
135             $(#[$attr])* pub clippy::$name, Allow, $description, report_in_external_macro: true
136         }
137     };
138     { $(#[$attr:meta])* pub $name:tt, nursery, $description:tt } => {
139         declare_tool_lint! {
140             $(#[$attr])* pub clippy::$name, Allow, $description, report_in_external_macro: true
141         }
142     };
143     { $(#[$attr:meta])* pub $name:tt, internal, $description:tt } => {
144         declare_tool_lint! {
145             $(#[$attr])* pub clippy::$name, Allow, $description, report_in_external_macro: true
146         }
147     };
148     { $(#[$attr:meta])* pub $name:tt, internal_warn, $description:tt } => {
149         declare_tool_lint! {
150             $(#[$attr])* pub clippy::$name, Warn, $description, report_in_external_macro: true
151         }
152     };
153 }
154
155 #[cfg(feature = "metadata-collector-lint")]
156 mod deprecated_lints;
157 mod utils;
158
159 // begin lints modules, do not remove this comment, it’s used in `update_lints`
160 mod absurd_extreme_comparisons;
161 mod approx_const;
162 mod arithmetic;
163 mod as_conversions;
164 mod asm_syntax;
165 mod assertions_on_constants;
166 mod assign_ops;
167 mod async_yields_async;
168 mod atomic_ordering;
169 mod attrs;
170 mod await_holding_invalid;
171 mod bit_mask;
172 mod blacklisted_name;
173 mod blocks_in_if_conditions;
174 mod bool_assert_comparison;
175 mod booleans;
176 mod bytecount;
177 mod cargo_common_metadata;
178 mod case_sensitive_file_extension_comparisons;
179 mod casts;
180 mod checked_conversions;
181 mod cognitive_complexity;
182 mod collapsible_if;
183 mod collapsible_match;
184 mod comparison_chain;
185 mod copies;
186 mod copy_iterator;
187 mod create_dir;
188 mod dbg_macro;
189 mod default;
190 mod default_numeric_fallback;
191 mod dereference;
192 mod derive;
193 mod disallowed_method;
194 mod disallowed_script_idents;
195 mod disallowed_type;
196 mod doc;
197 mod double_comparison;
198 mod double_parens;
199 mod drop_forget_ref;
200 mod duration_subsec;
201 mod else_if_without_else;
202 mod empty_enum;
203 mod entry;
204 mod enum_clike;
205 mod enum_variants;
206 mod eq_op;
207 mod erasing_op;
208 mod escape;
209 mod eta_reduction;
210 mod eval_order_dependence;
211 mod excessive_bools;
212 mod exhaustive_items;
213 mod exit;
214 mod explicit_write;
215 mod fallible_impl_from;
216 mod feature_name;
217 mod float_equality_without_abs;
218 mod float_literal;
219 mod floating_point_arithmetic;
220 mod format;
221 mod formatting;
222 mod from_over_into;
223 mod from_str_radix_10;
224 mod functions;
225 mod future_not_send;
226 mod get_last_with_len;
227 mod identity_op;
228 mod if_let_mutex;
229 mod if_let_some_result;
230 mod if_not_else;
231 mod if_then_some_else_none;
232 mod implicit_hasher;
233 mod implicit_return;
234 mod implicit_saturating_sub;
235 mod inconsistent_struct_constructor;
236 mod indexing_slicing;
237 mod infinite_iter;
238 mod inherent_impl;
239 mod inherent_to_string;
240 mod inline_fn_without_body;
241 mod int_plus_one;
242 mod integer_division;
243 mod invalid_upcast_comparisons;
244 mod items_after_statements;
245 mod large_const_arrays;
246 mod large_enum_variant;
247 mod large_stack_arrays;
248 mod len_zero;
249 mod let_if_seq;
250 mod let_underscore;
251 mod lifetimes;
252 mod literal_representation;
253 mod loops;
254 mod macro_use;
255 mod main_recursion;
256 mod manual_async_fn;
257 mod manual_map;
258 mod manual_non_exhaustive;
259 mod manual_ok_or;
260 mod manual_strip;
261 mod manual_unwrap_or;
262 mod map_clone;
263 mod map_err_ignore;
264 mod map_unit_fn;
265 mod match_on_vec_items;
266 mod matches;
267 mod mem_discriminant;
268 mod mem_forget;
269 mod mem_replace;
270 mod methods;
271 mod minmax;
272 mod misc;
273 mod misc_early;
274 mod missing_const_for_fn;
275 mod missing_doc;
276 mod missing_enforced_import_rename;
277 mod missing_inline;
278 mod module_style;
279 mod modulo_arithmetic;
280 mod multiple_crate_versions;
281 mod mut_key;
282 mod mut_mut;
283 mod mut_mutex_lock;
284 mod mut_reference;
285 mod mutable_debug_assertion;
286 mod mutex_atomic;
287 mod needless_arbitrary_self_type;
288 mod needless_bitwise_bool;
289 mod needless_bool;
290 mod needless_borrow;
291 mod needless_borrowed_ref;
292 mod needless_continue;
293 mod needless_for_each;
294 mod needless_pass_by_value;
295 mod needless_question_mark;
296 mod needless_update;
297 mod neg_cmp_op_on_partial_ord;
298 mod neg_multiply;
299 mod new_without_default;
300 mod no_effect;
301 mod non_copy_const;
302 mod non_expressive_names;
303 mod non_octal_unix_permissions;
304 mod nonstandard_macro_braces;
305 mod open_options;
306 mod option_env_unwrap;
307 mod option_if_let_else;
308 mod overflow_check_conditional;
309 mod panic_in_result_fn;
310 mod panic_unimplemented;
311 mod partialeq_ne_impl;
312 mod pass_by_ref_or_value;
313 mod path_buf_push_overwrite;
314 mod pattern_type_mismatch;
315 mod precedence;
316 mod ptr;
317 mod ptr_eq;
318 mod ptr_offset_with_cast;
319 mod question_mark;
320 mod ranges;
321 mod redundant_clone;
322 mod redundant_closure_call;
323 mod redundant_else;
324 mod redundant_field_names;
325 mod redundant_pub_crate;
326 mod redundant_slicing;
327 mod redundant_static_lifetimes;
328 mod ref_option_ref;
329 mod reference;
330 mod regex;
331 mod repeat_once;
332 mod returns;
333 mod self_assignment;
334 mod self_named_constructors;
335 mod semicolon_if_nothing_returned;
336 mod serde_api;
337 mod shadow;
338 mod single_component_path_imports;
339 mod size_of_in_element_count;
340 mod slow_vector_initialization;
341 mod stable_sort_primitive;
342 mod strings;
343 mod strlen_on_c_strings;
344 mod suspicious_operation_groupings;
345 mod suspicious_trait_impl;
346 mod swap;
347 mod tabs_in_doc_comments;
348 mod temporary_assignment;
349 mod to_digit_is_some;
350 mod to_string_in_display;
351 mod trait_bounds;
352 mod transmute;
353 mod transmuting_null;
354 mod try_err;
355 mod types;
356 mod undropped_manually_drops;
357 mod unicode;
358 mod unit_return_expecting_ord;
359 mod unit_types;
360 mod unnamed_address;
361 mod unnecessary_self_imports;
362 mod unnecessary_sort_by;
363 mod unnecessary_wraps;
364 mod unnested_or_patterns;
365 mod unsafe_removed_from_name;
366 mod unused_async;
367 mod unused_io_amount;
368 mod unused_self;
369 mod unused_unit;
370 mod unwrap;
371 mod unwrap_in_result;
372 mod upper_case_acronyms;
373 mod use_self;
374 mod useless_conversion;
375 mod vec;
376 mod vec_init_then_push;
377 mod vec_resize_to_zero;
378 mod verbose_file_reads;
379 mod wildcard_dependencies;
380 mod wildcard_imports;
381 mod write;
382 mod zero_div_zero;
383 mod zero_sized_map_values;
384 // end lints modules, do not remove this comment, it’s used in `update_lints`
385
386 pub use crate::utils::conf::Conf;
387 use crate::utils::conf::TryConf;
388
389 /// Register all pre expansion lints
390 ///
391 /// Pre-expansion lints run before any macro expansion has happened.
392 ///
393 /// Note that due to the architecture of the compiler, currently `cfg_attr` attributes on crate
394 /// level (i.e `#![cfg_attr(...)]`) will still be expanded even when using a pre-expansion pass.
395 ///
396 /// Used in `./src/driver.rs`.
397 pub fn register_pre_expansion_lints(store: &mut rustc_lint::LintStore) {
398     // NOTE: Do not add any more pre-expansion passes. These should be removed eventually.
399     store.register_pre_expansion_pass(|| box write::Write::default());
400     store.register_pre_expansion_pass(|| box attrs::EarlyAttributes);
401     store.register_pre_expansion_pass(|| box dbg_macro::DbgMacro);
402 }
403
404 #[doc(hidden)]
405 pub fn read_conf(sess: &Session) -> Conf {
406     let file_name = match utils::conf::lookup_conf_file() {
407         Ok(Some(path)) => path,
408         Ok(None) => return Conf::default(),
409         Err(error) => {
410             sess.struct_err(&format!("error finding Clippy's configuration file: {}", error))
411                 .emit();
412             return Conf::default();
413         },
414     };
415
416     let TryConf { conf, errors } = utils::conf::read(&file_name);
417     // all conf errors are non-fatal, we just use the default conf in case of error
418     for error in errors {
419         sess.struct_err(&format!(
420             "error reading Clippy's configuration file `{}`: {}",
421             file_name.display(),
422             error
423         ))
424         .emit();
425     }
426
427     conf
428 }
429
430 /// Register all lints and lint groups with the rustc plugin registry
431 ///
432 /// Used in `./src/driver.rs`.
433 #[allow(clippy::too_many_lines)]
434 #[rustfmt::skip]
435 pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf: &Conf) {
436     register_removed_non_tool_lints(store);
437
438     // begin deprecated lints, do not remove this comment, it’s used in `update_lints`
439     store.register_removed(
440         "clippy::should_assert_eq",
441         "`assert!()` will be more flexible with RFC 2011",
442     );
443     store.register_removed(
444         "clippy::extend_from_slice",
445         "`.extend_from_slice(_)` is a faster way to extend a Vec by a slice",
446     );
447     store.register_removed(
448         "clippy::range_step_by_zero",
449         "`iterator.step_by(0)` panics nowadays",
450     );
451     store.register_removed(
452         "clippy::unstable_as_slice",
453         "`Vec::as_slice` has been stabilized in 1.7",
454     );
455     store.register_removed(
456         "clippy::unstable_as_mut_slice",
457         "`Vec::as_mut_slice` has been stabilized in 1.7",
458     );
459     store.register_removed(
460         "clippy::misaligned_transmute",
461         "this lint has been split into cast_ptr_alignment and transmute_ptr_to_ptr",
462     );
463     store.register_removed(
464         "clippy::assign_ops",
465         "using compound assignment operators (e.g., `+=`) is harmless",
466     );
467     store.register_removed(
468         "clippy::if_let_redundant_pattern_matching",
469         "this lint has been changed to redundant_pattern_matching",
470     );
471     store.register_removed(
472         "clippy::unsafe_vector_initialization",
473         "the replacement suggested by this lint had substantially different behavior",
474     );
475     store.register_removed(
476         "clippy::unused_collect",
477         "`collect` has been marked as #[must_use] in rustc and that covers all cases of this lint",
478     );
479     store.register_removed(
480         "clippy::replace_consts",
481         "associated-constants `MIN`/`MAX` of integers are preferred to `{min,max}_value()` and module constants",
482     );
483     store.register_removed(
484         "clippy::regex_macro",
485         "the regex! macro has been removed from the regex crate in 2018",
486     );
487     store.register_removed(
488         "clippy::find_map",
489         "this lint has been replaced by `manual_find_map`, a more specific lint",
490     );
491     store.register_removed(
492         "clippy::filter_map",
493         "this lint has been replaced by `manual_filter_map`, a more specific lint",
494     );
495     store.register_removed(
496         "clippy::pub_enum_variant_names",
497         "set the `avoid-breaking-exported-api` config option to `false` to enable the `enum_variant_names` lint for public items",
498     );
499     store.register_removed(
500         "clippy::wrong_pub_self_convention",
501         "set the `avoid-breaking-exported-api` config option to `false` to enable the `wrong_self_convention` lint for public items",
502     );
503     // end deprecated lints, do not remove this comment, it’s used in `update_lints`
504
505     // begin register lints, do not remove this comment, it’s used in `update_lints`
506     store.register_lints(&[
507         #[cfg(feature = "internal-lints")]
508         utils::internal_lints::CLIPPY_LINTS_INTERNAL,
509         #[cfg(feature = "internal-lints")]
510         utils::internal_lints::COLLAPSIBLE_SPAN_LINT_CALLS,
511         #[cfg(feature = "internal-lints")]
512         utils::internal_lints::COMPILER_LINT_FUNCTIONS,
513         #[cfg(feature = "internal-lints")]
514         utils::internal_lints::DEFAULT_LINT,
515         #[cfg(feature = "internal-lints")]
516         utils::internal_lints::IF_CHAIN_STYLE,
517         #[cfg(feature = "internal-lints")]
518         utils::internal_lints::INTERNING_DEFINED_SYMBOL,
519         #[cfg(feature = "internal-lints")]
520         utils::internal_lints::INVALID_PATHS,
521         #[cfg(feature = "internal-lints")]
522         utils::internal_lints::LINT_WITHOUT_LINT_PASS,
523         #[cfg(feature = "internal-lints")]
524         utils::internal_lints::MATCH_TYPE_ON_DIAGNOSTIC_ITEM,
525         #[cfg(feature = "internal-lints")]
526         utils::internal_lints::OUTER_EXPN_EXPN_DATA,
527         #[cfg(feature = "internal-lints")]
528         utils::internal_lints::PRODUCE_ICE,
529         #[cfg(feature = "internal-lints")]
530         utils::internal_lints::UNNECESSARY_SYMBOL_STR,
531         absurd_extreme_comparisons::ABSURD_EXTREME_COMPARISONS,
532         approx_const::APPROX_CONSTANT,
533         arithmetic::FLOAT_ARITHMETIC,
534         arithmetic::INTEGER_ARITHMETIC,
535         as_conversions::AS_CONVERSIONS,
536         asm_syntax::INLINE_ASM_X86_ATT_SYNTAX,
537         asm_syntax::INLINE_ASM_X86_INTEL_SYNTAX,
538         assertions_on_constants::ASSERTIONS_ON_CONSTANTS,
539         assign_ops::ASSIGN_OP_PATTERN,
540         assign_ops::MISREFACTORED_ASSIGN_OP,
541         async_yields_async::ASYNC_YIELDS_ASYNC,
542         atomic_ordering::INVALID_ATOMIC_ORDERING,
543         attrs::BLANKET_CLIPPY_RESTRICTION_LINTS,
544         attrs::DEPRECATED_CFG_ATTR,
545         attrs::DEPRECATED_SEMVER,
546         attrs::EMPTY_LINE_AFTER_OUTER_ATTR,
547         attrs::INLINE_ALWAYS,
548         attrs::MISMATCHED_TARGET_OS,
549         attrs::USELESS_ATTRIBUTE,
550         await_holding_invalid::AWAIT_HOLDING_LOCK,
551         await_holding_invalid::AWAIT_HOLDING_REFCELL_REF,
552         bit_mask::BAD_BIT_MASK,
553         bit_mask::INEFFECTIVE_BIT_MASK,
554         bit_mask::VERBOSE_BIT_MASK,
555         blacklisted_name::BLACKLISTED_NAME,
556         blocks_in_if_conditions::BLOCKS_IN_IF_CONDITIONS,
557         bool_assert_comparison::BOOL_ASSERT_COMPARISON,
558         booleans::LOGIC_BUG,
559         booleans::NONMINIMAL_BOOL,
560         bytecount::NAIVE_BYTECOUNT,
561         cargo_common_metadata::CARGO_COMMON_METADATA,
562         case_sensitive_file_extension_comparisons::CASE_SENSITIVE_FILE_EXTENSION_COMPARISONS,
563         casts::CAST_LOSSLESS,
564         casts::CAST_POSSIBLE_TRUNCATION,
565         casts::CAST_POSSIBLE_WRAP,
566         casts::CAST_PRECISION_LOSS,
567         casts::CAST_PTR_ALIGNMENT,
568         casts::CAST_REF_TO_MUT,
569         casts::CAST_SIGN_LOSS,
570         casts::CHAR_LIT_AS_U8,
571         casts::FN_TO_NUMERIC_CAST,
572         casts::FN_TO_NUMERIC_CAST_WITH_TRUNCATION,
573         casts::PTR_AS_PTR,
574         casts::UNNECESSARY_CAST,
575         checked_conversions::CHECKED_CONVERSIONS,
576         cognitive_complexity::COGNITIVE_COMPLEXITY,
577         collapsible_if::COLLAPSIBLE_ELSE_IF,
578         collapsible_if::COLLAPSIBLE_IF,
579         collapsible_match::COLLAPSIBLE_MATCH,
580         comparison_chain::COMPARISON_CHAIN,
581         copies::BRANCHES_SHARING_CODE,
582         copies::IFS_SAME_COND,
583         copies::IF_SAME_THEN_ELSE,
584         copies::SAME_FUNCTIONS_IN_IF_CONDITION,
585         copy_iterator::COPY_ITERATOR,
586         create_dir::CREATE_DIR,
587         dbg_macro::DBG_MACRO,
588         default::DEFAULT_TRAIT_ACCESS,
589         default::FIELD_REASSIGN_WITH_DEFAULT,
590         default_numeric_fallback::DEFAULT_NUMERIC_FALLBACK,
591         dereference::EXPLICIT_DEREF_METHODS,
592         derive::DERIVE_HASH_XOR_EQ,
593         derive::DERIVE_ORD_XOR_PARTIAL_ORD,
594         derive::EXPL_IMPL_CLONE_ON_COPY,
595         derive::UNSAFE_DERIVE_DESERIALIZE,
596         disallowed_method::DISALLOWED_METHOD,
597         disallowed_script_idents::DISALLOWED_SCRIPT_IDENTS,
598         disallowed_type::DISALLOWED_TYPE,
599         doc::DOC_MARKDOWN,
600         doc::MISSING_ERRORS_DOC,
601         doc::MISSING_PANICS_DOC,
602         doc::MISSING_SAFETY_DOC,
603         doc::NEEDLESS_DOCTEST_MAIN,
604         double_comparison::DOUBLE_COMPARISONS,
605         double_parens::DOUBLE_PARENS,
606         drop_forget_ref::DROP_COPY,
607         drop_forget_ref::DROP_REF,
608         drop_forget_ref::FORGET_COPY,
609         drop_forget_ref::FORGET_REF,
610         duration_subsec::DURATION_SUBSEC,
611         else_if_without_else::ELSE_IF_WITHOUT_ELSE,
612         empty_enum::EMPTY_ENUM,
613         entry::MAP_ENTRY,
614         enum_clike::ENUM_CLIKE_UNPORTABLE_VARIANT,
615         enum_variants::ENUM_VARIANT_NAMES,
616         enum_variants::MODULE_INCEPTION,
617         enum_variants::MODULE_NAME_REPETITIONS,
618         eq_op::EQ_OP,
619         eq_op::OP_REF,
620         erasing_op::ERASING_OP,
621         escape::BOXED_LOCAL,
622         eta_reduction::REDUNDANT_CLOSURE,
623         eta_reduction::REDUNDANT_CLOSURE_FOR_METHOD_CALLS,
624         eval_order_dependence::DIVERGING_SUB_EXPRESSION,
625         eval_order_dependence::EVAL_ORDER_DEPENDENCE,
626         excessive_bools::FN_PARAMS_EXCESSIVE_BOOLS,
627         excessive_bools::STRUCT_EXCESSIVE_BOOLS,
628         exhaustive_items::EXHAUSTIVE_ENUMS,
629         exhaustive_items::EXHAUSTIVE_STRUCTS,
630         exit::EXIT,
631         explicit_write::EXPLICIT_WRITE,
632         fallible_impl_from::FALLIBLE_IMPL_FROM,
633         feature_name::NEGATIVE_FEATURE_NAMES,
634         feature_name::REDUNDANT_FEATURE_NAMES,
635         float_equality_without_abs::FLOAT_EQUALITY_WITHOUT_ABS,
636         float_literal::EXCESSIVE_PRECISION,
637         float_literal::LOSSY_FLOAT_LITERAL,
638         floating_point_arithmetic::IMPRECISE_FLOPS,
639         floating_point_arithmetic::SUBOPTIMAL_FLOPS,
640         format::USELESS_FORMAT,
641         formatting::POSSIBLE_MISSING_COMMA,
642         formatting::SUSPICIOUS_ASSIGNMENT_FORMATTING,
643         formatting::SUSPICIOUS_ELSE_FORMATTING,
644         formatting::SUSPICIOUS_UNARY_OP_FORMATTING,
645         from_over_into::FROM_OVER_INTO,
646         from_str_radix_10::FROM_STR_RADIX_10,
647         functions::DOUBLE_MUST_USE,
648         functions::MUST_USE_CANDIDATE,
649         functions::MUST_USE_UNIT,
650         functions::NOT_UNSAFE_PTR_ARG_DEREF,
651         functions::RESULT_UNIT_ERR,
652         functions::TOO_MANY_ARGUMENTS,
653         functions::TOO_MANY_LINES,
654         future_not_send::FUTURE_NOT_SEND,
655         get_last_with_len::GET_LAST_WITH_LEN,
656         identity_op::IDENTITY_OP,
657         if_let_mutex::IF_LET_MUTEX,
658         if_let_some_result::IF_LET_SOME_RESULT,
659         if_not_else::IF_NOT_ELSE,
660         if_then_some_else_none::IF_THEN_SOME_ELSE_NONE,
661         implicit_hasher::IMPLICIT_HASHER,
662         implicit_return::IMPLICIT_RETURN,
663         implicit_saturating_sub::IMPLICIT_SATURATING_SUB,
664         inconsistent_struct_constructor::INCONSISTENT_STRUCT_CONSTRUCTOR,
665         indexing_slicing::INDEXING_SLICING,
666         indexing_slicing::OUT_OF_BOUNDS_INDEXING,
667         infinite_iter::INFINITE_ITER,
668         infinite_iter::MAYBE_INFINITE_ITER,
669         inherent_impl::MULTIPLE_INHERENT_IMPL,
670         inherent_to_string::INHERENT_TO_STRING,
671         inherent_to_string::INHERENT_TO_STRING_SHADOW_DISPLAY,
672         inline_fn_without_body::INLINE_FN_WITHOUT_BODY,
673         int_plus_one::INT_PLUS_ONE,
674         integer_division::INTEGER_DIVISION,
675         invalid_upcast_comparisons::INVALID_UPCAST_COMPARISONS,
676         items_after_statements::ITEMS_AFTER_STATEMENTS,
677         large_const_arrays::LARGE_CONST_ARRAYS,
678         large_enum_variant::LARGE_ENUM_VARIANT,
679         large_stack_arrays::LARGE_STACK_ARRAYS,
680         len_zero::COMPARISON_TO_EMPTY,
681         len_zero::LEN_WITHOUT_IS_EMPTY,
682         len_zero::LEN_ZERO,
683         let_if_seq::USELESS_LET_IF_SEQ,
684         let_underscore::LET_UNDERSCORE_DROP,
685         let_underscore::LET_UNDERSCORE_LOCK,
686         let_underscore::LET_UNDERSCORE_MUST_USE,
687         lifetimes::EXTRA_UNUSED_LIFETIMES,
688         lifetimes::NEEDLESS_LIFETIMES,
689         literal_representation::DECIMAL_LITERAL_REPRESENTATION,
690         literal_representation::INCONSISTENT_DIGIT_GROUPING,
691         literal_representation::LARGE_DIGIT_GROUPS,
692         literal_representation::MISTYPED_LITERAL_SUFFIXES,
693         literal_representation::UNREADABLE_LITERAL,
694         literal_representation::UNUSUAL_BYTE_GROUPINGS,
695         loops::EMPTY_LOOP,
696         loops::EXPLICIT_COUNTER_LOOP,
697         loops::EXPLICIT_INTO_ITER_LOOP,
698         loops::EXPLICIT_ITER_LOOP,
699         loops::FOR_KV_MAP,
700         loops::FOR_LOOPS_OVER_FALLIBLES,
701         loops::ITER_NEXT_LOOP,
702         loops::MANUAL_FLATTEN,
703         loops::MANUAL_MEMCPY,
704         loops::MUT_RANGE_BOUND,
705         loops::NEEDLESS_COLLECT,
706         loops::NEEDLESS_RANGE_LOOP,
707         loops::NEVER_LOOP,
708         loops::SAME_ITEM_PUSH,
709         loops::SINGLE_ELEMENT_LOOP,
710         loops::WHILE_IMMUTABLE_CONDITION,
711         loops::WHILE_LET_LOOP,
712         loops::WHILE_LET_ON_ITERATOR,
713         macro_use::MACRO_USE_IMPORTS,
714         main_recursion::MAIN_RECURSION,
715         manual_async_fn::MANUAL_ASYNC_FN,
716         manual_map::MANUAL_MAP,
717         manual_non_exhaustive::MANUAL_NON_EXHAUSTIVE,
718         manual_ok_or::MANUAL_OK_OR,
719         manual_strip::MANUAL_STRIP,
720         manual_unwrap_or::MANUAL_UNWRAP_OR,
721         map_clone::MAP_CLONE,
722         map_err_ignore::MAP_ERR_IGNORE,
723         map_unit_fn::OPTION_MAP_UNIT_FN,
724         map_unit_fn::RESULT_MAP_UNIT_FN,
725         match_on_vec_items::MATCH_ON_VEC_ITEMS,
726         matches::INFALLIBLE_DESTRUCTURING_MATCH,
727         matches::MATCH_AS_REF,
728         matches::MATCH_BOOL,
729         matches::MATCH_LIKE_MATCHES_MACRO,
730         matches::MATCH_OVERLAPPING_ARM,
731         matches::MATCH_REF_PATS,
732         matches::MATCH_SAME_ARMS,
733         matches::MATCH_SINGLE_BINDING,
734         matches::MATCH_WILDCARD_FOR_SINGLE_VARIANTS,
735         matches::MATCH_WILD_ERR_ARM,
736         matches::REDUNDANT_PATTERN_MATCHING,
737         matches::REST_PAT_IN_FULLY_BOUND_STRUCTS,
738         matches::SINGLE_MATCH,
739         matches::SINGLE_MATCH_ELSE,
740         matches::WILDCARD_ENUM_MATCH_ARM,
741         matches::WILDCARD_IN_OR_PATTERNS,
742         mem_discriminant::MEM_DISCRIMINANT_NON_ENUM,
743         mem_forget::MEM_FORGET,
744         mem_replace::MEM_REPLACE_OPTION_WITH_NONE,
745         mem_replace::MEM_REPLACE_WITH_DEFAULT,
746         mem_replace::MEM_REPLACE_WITH_UNINIT,
747         methods::BIND_INSTEAD_OF_MAP,
748         methods::BYTES_NTH,
749         methods::CHARS_LAST_CMP,
750         methods::CHARS_NEXT_CMP,
751         methods::CLONED_INSTEAD_OF_COPIED,
752         methods::CLONE_DOUBLE_REF,
753         methods::CLONE_ON_COPY,
754         methods::CLONE_ON_REF_PTR,
755         methods::EXPECT_FUN_CALL,
756         methods::EXPECT_USED,
757         methods::EXTEND_WITH_DRAIN,
758         methods::FILETYPE_IS_FILE,
759         methods::FILTER_MAP_IDENTITY,
760         methods::FILTER_MAP_NEXT,
761         methods::FILTER_NEXT,
762         methods::FLAT_MAP_IDENTITY,
763         methods::FLAT_MAP_OPTION,
764         methods::FROM_ITER_INSTEAD_OF_COLLECT,
765         methods::GET_UNWRAP,
766         methods::IMPLICIT_CLONE,
767         methods::INEFFICIENT_TO_STRING,
768         methods::INSPECT_FOR_EACH,
769         methods::INTO_ITER_ON_REF,
770         methods::ITERATOR_STEP_BY_ZERO,
771         methods::ITER_CLONED_COLLECT,
772         methods::ITER_COUNT,
773         methods::ITER_NEXT_SLICE,
774         methods::ITER_NTH,
775         methods::ITER_NTH_ZERO,
776         methods::ITER_SKIP_NEXT,
777         methods::MANUAL_FILTER_MAP,
778         methods::MANUAL_FIND_MAP,
779         methods::MANUAL_SATURATING_ARITHMETIC,
780         methods::MANUAL_SPLIT_ONCE,
781         methods::MANUAL_STR_REPEAT,
782         methods::MAP_COLLECT_RESULT_UNIT,
783         methods::MAP_FLATTEN,
784         methods::MAP_IDENTITY,
785         methods::MAP_UNWRAP_OR,
786         methods::NEW_RET_NO_SELF,
787         methods::OK_EXPECT,
788         methods::OPTION_AS_REF_DEREF,
789         methods::OPTION_FILTER_MAP,
790         methods::OPTION_MAP_OR_NONE,
791         methods::OR_FUN_CALL,
792         methods::RESULT_MAP_OR_INTO_OPTION,
793         methods::SEARCH_IS_SOME,
794         methods::SHOULD_IMPLEMENT_TRAIT,
795         methods::SINGLE_CHAR_ADD_STR,
796         methods::SINGLE_CHAR_PATTERN,
797         methods::SKIP_WHILE_NEXT,
798         methods::STRING_EXTEND_CHARS,
799         methods::SUSPICIOUS_MAP,
800         methods::SUSPICIOUS_SPLITN,
801         methods::UNINIT_ASSUMED_INIT,
802         methods::UNNECESSARY_FILTER_MAP,
803         methods::UNNECESSARY_FOLD,
804         methods::UNNECESSARY_LAZY_EVALUATIONS,
805         methods::UNWRAP_OR_ELSE_DEFAULT,
806         methods::UNWRAP_USED,
807         methods::USELESS_ASREF,
808         methods::WRONG_SELF_CONVENTION,
809         methods::ZST_OFFSET,
810         minmax::MIN_MAX,
811         misc::CMP_NAN,
812         misc::CMP_OWNED,
813         misc::FLOAT_CMP,
814         misc::FLOAT_CMP_CONST,
815         misc::MODULO_ONE,
816         misc::SHORT_CIRCUIT_STATEMENT,
817         misc::TOPLEVEL_REF_ARG,
818         misc::USED_UNDERSCORE_BINDING,
819         misc::ZERO_PTR,
820         misc_early::BUILTIN_TYPE_SHADOW,
821         misc_early::DOUBLE_NEG,
822         misc_early::DUPLICATE_UNDERSCORE_ARGUMENT,
823         misc_early::MIXED_CASE_HEX_LITERALS,
824         misc_early::REDUNDANT_PATTERN,
825         misc_early::UNNEEDED_FIELD_PATTERN,
826         misc_early::UNNEEDED_WILDCARD_PATTERN,
827         misc_early::UNSEPARATED_LITERAL_SUFFIX,
828         misc_early::ZERO_PREFIXED_LITERAL,
829         missing_const_for_fn::MISSING_CONST_FOR_FN,
830         missing_doc::MISSING_DOCS_IN_PRIVATE_ITEMS,
831         missing_enforced_import_rename::MISSING_ENFORCED_IMPORT_RENAMES,
832         missing_inline::MISSING_INLINE_IN_PUBLIC_ITEMS,
833         module_style::MOD_MODULE_FILES,
834         module_style::SELF_NAMED_MODULE_FILES,
835         modulo_arithmetic::MODULO_ARITHMETIC,
836         multiple_crate_versions::MULTIPLE_CRATE_VERSIONS,
837         mut_key::MUTABLE_KEY_TYPE,
838         mut_mut::MUT_MUT,
839         mut_mutex_lock::MUT_MUTEX_LOCK,
840         mut_reference::UNNECESSARY_MUT_PASSED,
841         mutable_debug_assertion::DEBUG_ASSERT_WITH_MUT_CALL,
842         mutex_atomic::MUTEX_ATOMIC,
843         mutex_atomic::MUTEX_INTEGER,
844         needless_arbitrary_self_type::NEEDLESS_ARBITRARY_SELF_TYPE,
845         needless_bitwise_bool::NEEDLESS_BITWISE_BOOL,
846         needless_bool::BOOL_COMPARISON,
847         needless_bool::NEEDLESS_BOOL,
848         needless_borrow::NEEDLESS_BORROW,
849         needless_borrow::REF_BINDING_TO_REFERENCE,
850         needless_borrowed_ref::NEEDLESS_BORROWED_REFERENCE,
851         needless_continue::NEEDLESS_CONTINUE,
852         needless_for_each::NEEDLESS_FOR_EACH,
853         needless_pass_by_value::NEEDLESS_PASS_BY_VALUE,
854         needless_question_mark::NEEDLESS_QUESTION_MARK,
855         needless_update::NEEDLESS_UPDATE,
856         neg_cmp_op_on_partial_ord::NEG_CMP_OP_ON_PARTIAL_ORD,
857         neg_multiply::NEG_MULTIPLY,
858         new_without_default::NEW_WITHOUT_DEFAULT,
859         no_effect::NO_EFFECT,
860         no_effect::UNNECESSARY_OPERATION,
861         non_copy_const::BORROW_INTERIOR_MUTABLE_CONST,
862         non_copy_const::DECLARE_INTERIOR_MUTABLE_CONST,
863         non_expressive_names::JUST_UNDERSCORES_AND_DIGITS,
864         non_expressive_names::MANY_SINGLE_CHAR_NAMES,
865         non_expressive_names::SIMILAR_NAMES,
866         non_octal_unix_permissions::NON_OCTAL_UNIX_PERMISSIONS,
867         nonstandard_macro_braces::NONSTANDARD_MACRO_BRACES,
868         open_options::NONSENSICAL_OPEN_OPTIONS,
869         option_env_unwrap::OPTION_ENV_UNWRAP,
870         option_if_let_else::OPTION_IF_LET_ELSE,
871         overflow_check_conditional::OVERFLOW_CHECK_CONDITIONAL,
872         panic_in_result_fn::PANIC_IN_RESULT_FN,
873         panic_unimplemented::PANIC,
874         panic_unimplemented::TODO,
875         panic_unimplemented::UNIMPLEMENTED,
876         panic_unimplemented::UNREACHABLE,
877         partialeq_ne_impl::PARTIALEQ_NE_IMPL,
878         pass_by_ref_or_value::LARGE_TYPES_PASSED_BY_VALUE,
879         pass_by_ref_or_value::TRIVIALLY_COPY_PASS_BY_REF,
880         path_buf_push_overwrite::PATH_BUF_PUSH_OVERWRITE,
881         pattern_type_mismatch::PATTERN_TYPE_MISMATCH,
882         precedence::PRECEDENCE,
883         ptr::CMP_NULL,
884         ptr::INVALID_NULL_PTR_USAGE,
885         ptr::MUT_FROM_REF,
886         ptr::PTR_ARG,
887         ptr_eq::PTR_EQ,
888         ptr_offset_with_cast::PTR_OFFSET_WITH_CAST,
889         question_mark::QUESTION_MARK,
890         ranges::MANUAL_RANGE_CONTAINS,
891         ranges::RANGE_MINUS_ONE,
892         ranges::RANGE_PLUS_ONE,
893         ranges::RANGE_ZIP_WITH_LEN,
894         ranges::REVERSED_EMPTY_RANGES,
895         redundant_clone::REDUNDANT_CLONE,
896         redundant_closure_call::REDUNDANT_CLOSURE_CALL,
897         redundant_else::REDUNDANT_ELSE,
898         redundant_field_names::REDUNDANT_FIELD_NAMES,
899         redundant_pub_crate::REDUNDANT_PUB_CRATE,
900         redundant_slicing::REDUNDANT_SLICING,
901         redundant_static_lifetimes::REDUNDANT_STATIC_LIFETIMES,
902         ref_option_ref::REF_OPTION_REF,
903         reference::DEREF_ADDROF,
904         reference::REF_IN_DEREF,
905         regex::INVALID_REGEX,
906         regex::TRIVIAL_REGEX,
907         repeat_once::REPEAT_ONCE,
908         returns::LET_AND_RETURN,
909         returns::NEEDLESS_RETURN,
910         self_assignment::SELF_ASSIGNMENT,
911         self_named_constructors::SELF_NAMED_CONSTRUCTORS,
912         semicolon_if_nothing_returned::SEMICOLON_IF_NOTHING_RETURNED,
913         serde_api::SERDE_API_MISUSE,
914         shadow::SHADOW_REUSE,
915         shadow::SHADOW_SAME,
916         shadow::SHADOW_UNRELATED,
917         single_component_path_imports::SINGLE_COMPONENT_PATH_IMPORTS,
918         size_of_in_element_count::SIZE_OF_IN_ELEMENT_COUNT,
919         slow_vector_initialization::SLOW_VECTOR_INITIALIZATION,
920         stable_sort_primitive::STABLE_SORT_PRIMITIVE,
921         strings::STRING_ADD,
922         strings::STRING_ADD_ASSIGN,
923         strings::STRING_FROM_UTF8_AS_BYTES,
924         strings::STRING_LIT_AS_BYTES,
925         strings::STRING_TO_STRING,
926         strings::STR_TO_STRING,
927         strlen_on_c_strings::STRLEN_ON_C_STRINGS,
928         suspicious_operation_groupings::SUSPICIOUS_OPERATION_GROUPINGS,
929         suspicious_trait_impl::SUSPICIOUS_ARITHMETIC_IMPL,
930         suspicious_trait_impl::SUSPICIOUS_OP_ASSIGN_IMPL,
931         swap::ALMOST_SWAPPED,
932         swap::MANUAL_SWAP,
933         tabs_in_doc_comments::TABS_IN_DOC_COMMENTS,
934         temporary_assignment::TEMPORARY_ASSIGNMENT,
935         to_digit_is_some::TO_DIGIT_IS_SOME,
936         to_string_in_display::TO_STRING_IN_DISPLAY,
937         trait_bounds::TRAIT_DUPLICATION_IN_BOUNDS,
938         trait_bounds::TYPE_REPETITION_IN_BOUNDS,
939         transmute::CROSSPOINTER_TRANSMUTE,
940         transmute::TRANSMUTES_EXPRESSIBLE_AS_PTR_CASTS,
941         transmute::TRANSMUTE_BYTES_TO_STR,
942         transmute::TRANSMUTE_FLOAT_TO_INT,
943         transmute::TRANSMUTE_INT_TO_BOOL,
944         transmute::TRANSMUTE_INT_TO_CHAR,
945         transmute::TRANSMUTE_INT_TO_FLOAT,
946         transmute::TRANSMUTE_PTR_TO_PTR,
947         transmute::TRANSMUTE_PTR_TO_REF,
948         transmute::UNSOUND_COLLECTION_TRANSMUTE,
949         transmute::USELESS_TRANSMUTE,
950         transmute::WRONG_TRANSMUTE,
951         transmuting_null::TRANSMUTING_NULL,
952         try_err::TRY_ERR,
953         types::BORROWED_BOX,
954         types::BOX_VEC,
955         types::LINKEDLIST,
956         types::OPTION_OPTION,
957         types::RC_BUFFER,
958         types::RC_MUTEX,
959         types::REDUNDANT_ALLOCATION,
960         types::TYPE_COMPLEXITY,
961         types::VEC_BOX,
962         undropped_manually_drops::UNDROPPED_MANUALLY_DROPS,
963         unicode::INVISIBLE_CHARACTERS,
964         unicode::NON_ASCII_LITERAL,
965         unicode::UNICODE_NOT_NFC,
966         unit_return_expecting_ord::UNIT_RETURN_EXPECTING_ORD,
967         unit_types::LET_UNIT_VALUE,
968         unit_types::UNIT_ARG,
969         unit_types::UNIT_CMP,
970         unnamed_address::FN_ADDRESS_COMPARISONS,
971         unnamed_address::VTABLE_ADDRESS_COMPARISONS,
972         unnecessary_self_imports::UNNECESSARY_SELF_IMPORTS,
973         unnecessary_sort_by::UNNECESSARY_SORT_BY,
974         unnecessary_wraps::UNNECESSARY_WRAPS,
975         unnested_or_patterns::UNNESTED_OR_PATTERNS,
976         unsafe_removed_from_name::UNSAFE_REMOVED_FROM_NAME,
977         unused_async::UNUSED_ASYNC,
978         unused_io_amount::UNUSED_IO_AMOUNT,
979         unused_self::UNUSED_SELF,
980         unused_unit::UNUSED_UNIT,
981         unwrap::PANICKING_UNWRAP,
982         unwrap::UNNECESSARY_UNWRAP,
983         unwrap_in_result::UNWRAP_IN_RESULT,
984         upper_case_acronyms::UPPER_CASE_ACRONYMS,
985         use_self::USE_SELF,
986         useless_conversion::USELESS_CONVERSION,
987         vec::USELESS_VEC,
988         vec_init_then_push::VEC_INIT_THEN_PUSH,
989         vec_resize_to_zero::VEC_RESIZE_TO_ZERO,
990         verbose_file_reads::VERBOSE_FILE_READS,
991         wildcard_dependencies::WILDCARD_DEPENDENCIES,
992         wildcard_imports::ENUM_GLOB_USE,
993         wildcard_imports::WILDCARD_IMPORTS,
994         write::PRINTLN_EMPTY_STRING,
995         write::PRINT_LITERAL,
996         write::PRINT_STDERR,
997         write::PRINT_STDOUT,
998         write::PRINT_WITH_NEWLINE,
999         write::USE_DEBUG,
1000         write::WRITELN_EMPTY_STRING,
1001         write::WRITE_LITERAL,
1002         write::WRITE_WITH_NEWLINE,
1003         zero_div_zero::ZERO_DIVIDED_BY_ZERO,
1004         zero_sized_map_values::ZERO_SIZED_MAP_VALUES,
1005     ]);
1006     // end register lints, do not remove this comment, it’s used in `update_lints`
1007
1008     store.register_group(true, "clippy::restriction", Some("clippy_restriction"), vec![
1009         LintId::of(arithmetic::FLOAT_ARITHMETIC),
1010         LintId::of(arithmetic::INTEGER_ARITHMETIC),
1011         LintId::of(as_conversions::AS_CONVERSIONS),
1012         LintId::of(asm_syntax::INLINE_ASM_X86_ATT_SYNTAX),
1013         LintId::of(asm_syntax::INLINE_ASM_X86_INTEL_SYNTAX),
1014         LintId::of(create_dir::CREATE_DIR),
1015         LintId::of(dbg_macro::DBG_MACRO),
1016         LintId::of(default_numeric_fallback::DEFAULT_NUMERIC_FALLBACK),
1017         LintId::of(disallowed_script_idents::DISALLOWED_SCRIPT_IDENTS),
1018         LintId::of(else_if_without_else::ELSE_IF_WITHOUT_ELSE),
1019         LintId::of(exhaustive_items::EXHAUSTIVE_ENUMS),
1020         LintId::of(exhaustive_items::EXHAUSTIVE_STRUCTS),
1021         LintId::of(exit::EXIT),
1022         LintId::of(float_literal::LOSSY_FLOAT_LITERAL),
1023         LintId::of(if_then_some_else_none::IF_THEN_SOME_ELSE_NONE),
1024         LintId::of(implicit_return::IMPLICIT_RETURN),
1025         LintId::of(indexing_slicing::INDEXING_SLICING),
1026         LintId::of(inherent_impl::MULTIPLE_INHERENT_IMPL),
1027         LintId::of(integer_division::INTEGER_DIVISION),
1028         LintId::of(let_underscore::LET_UNDERSCORE_MUST_USE),
1029         LintId::of(literal_representation::DECIMAL_LITERAL_REPRESENTATION),
1030         LintId::of(map_err_ignore::MAP_ERR_IGNORE),
1031         LintId::of(matches::REST_PAT_IN_FULLY_BOUND_STRUCTS),
1032         LintId::of(matches::WILDCARD_ENUM_MATCH_ARM),
1033         LintId::of(mem_forget::MEM_FORGET),
1034         LintId::of(methods::CLONE_ON_REF_PTR),
1035         LintId::of(methods::EXPECT_USED),
1036         LintId::of(methods::FILETYPE_IS_FILE),
1037         LintId::of(methods::GET_UNWRAP),
1038         LintId::of(methods::UNWRAP_USED),
1039         LintId::of(misc::FLOAT_CMP_CONST),
1040         LintId::of(misc_early::UNNEEDED_FIELD_PATTERN),
1041         LintId::of(missing_doc::MISSING_DOCS_IN_PRIVATE_ITEMS),
1042         LintId::of(missing_enforced_import_rename::MISSING_ENFORCED_IMPORT_RENAMES),
1043         LintId::of(missing_inline::MISSING_INLINE_IN_PUBLIC_ITEMS),
1044         LintId::of(module_style::MOD_MODULE_FILES),
1045         LintId::of(module_style::SELF_NAMED_MODULE_FILES),
1046         LintId::of(modulo_arithmetic::MODULO_ARITHMETIC),
1047         LintId::of(panic_in_result_fn::PANIC_IN_RESULT_FN),
1048         LintId::of(panic_unimplemented::PANIC),
1049         LintId::of(panic_unimplemented::TODO),
1050         LintId::of(panic_unimplemented::UNIMPLEMENTED),
1051         LintId::of(panic_unimplemented::UNREACHABLE),
1052         LintId::of(pattern_type_mismatch::PATTERN_TYPE_MISMATCH),
1053         LintId::of(shadow::SHADOW_REUSE),
1054         LintId::of(shadow::SHADOW_SAME),
1055         LintId::of(strings::STRING_ADD),
1056         LintId::of(strings::STRING_TO_STRING),
1057         LintId::of(strings::STR_TO_STRING),
1058         LintId::of(types::RC_BUFFER),
1059         LintId::of(types::RC_MUTEX),
1060         LintId::of(unnecessary_self_imports::UNNECESSARY_SELF_IMPORTS),
1061         LintId::of(unwrap_in_result::UNWRAP_IN_RESULT),
1062         LintId::of(verbose_file_reads::VERBOSE_FILE_READS),
1063         LintId::of(write::PRINT_STDERR),
1064         LintId::of(write::PRINT_STDOUT),
1065         LintId::of(write::USE_DEBUG),
1066     ]);
1067
1068     store.register_group(true, "clippy::pedantic", Some("clippy_pedantic"), vec![
1069         LintId::of(attrs::INLINE_ALWAYS),
1070         LintId::of(await_holding_invalid::AWAIT_HOLDING_LOCK),
1071         LintId::of(await_holding_invalid::AWAIT_HOLDING_REFCELL_REF),
1072         LintId::of(bit_mask::VERBOSE_BIT_MASK),
1073         LintId::of(bytecount::NAIVE_BYTECOUNT),
1074         LintId::of(case_sensitive_file_extension_comparisons::CASE_SENSITIVE_FILE_EXTENSION_COMPARISONS),
1075         LintId::of(casts::CAST_LOSSLESS),
1076         LintId::of(casts::CAST_POSSIBLE_TRUNCATION),
1077         LintId::of(casts::CAST_POSSIBLE_WRAP),
1078         LintId::of(casts::CAST_PRECISION_LOSS),
1079         LintId::of(casts::CAST_PTR_ALIGNMENT),
1080         LintId::of(casts::CAST_SIGN_LOSS),
1081         LintId::of(casts::PTR_AS_PTR),
1082         LintId::of(checked_conversions::CHECKED_CONVERSIONS),
1083         LintId::of(copies::SAME_FUNCTIONS_IN_IF_CONDITION),
1084         LintId::of(copy_iterator::COPY_ITERATOR),
1085         LintId::of(default::DEFAULT_TRAIT_ACCESS),
1086         LintId::of(dereference::EXPLICIT_DEREF_METHODS),
1087         LintId::of(derive::EXPL_IMPL_CLONE_ON_COPY),
1088         LintId::of(derive::UNSAFE_DERIVE_DESERIALIZE),
1089         LintId::of(doc::DOC_MARKDOWN),
1090         LintId::of(doc::MISSING_ERRORS_DOC),
1091         LintId::of(doc::MISSING_PANICS_DOC),
1092         LintId::of(empty_enum::EMPTY_ENUM),
1093         LintId::of(enum_variants::MODULE_NAME_REPETITIONS),
1094         LintId::of(eta_reduction::REDUNDANT_CLOSURE_FOR_METHOD_CALLS),
1095         LintId::of(excessive_bools::FN_PARAMS_EXCESSIVE_BOOLS),
1096         LintId::of(excessive_bools::STRUCT_EXCESSIVE_BOOLS),
1097         LintId::of(functions::MUST_USE_CANDIDATE),
1098         LintId::of(functions::TOO_MANY_LINES),
1099         LintId::of(if_not_else::IF_NOT_ELSE),
1100         LintId::of(implicit_hasher::IMPLICIT_HASHER),
1101         LintId::of(implicit_saturating_sub::IMPLICIT_SATURATING_SUB),
1102         LintId::of(inconsistent_struct_constructor::INCONSISTENT_STRUCT_CONSTRUCTOR),
1103         LintId::of(infinite_iter::MAYBE_INFINITE_ITER),
1104         LintId::of(invalid_upcast_comparisons::INVALID_UPCAST_COMPARISONS),
1105         LintId::of(items_after_statements::ITEMS_AFTER_STATEMENTS),
1106         LintId::of(large_stack_arrays::LARGE_STACK_ARRAYS),
1107         LintId::of(let_underscore::LET_UNDERSCORE_DROP),
1108         LintId::of(literal_representation::LARGE_DIGIT_GROUPS),
1109         LintId::of(literal_representation::UNREADABLE_LITERAL),
1110         LintId::of(loops::EXPLICIT_INTO_ITER_LOOP),
1111         LintId::of(loops::EXPLICIT_ITER_LOOP),
1112         LintId::of(macro_use::MACRO_USE_IMPORTS),
1113         LintId::of(manual_ok_or::MANUAL_OK_OR),
1114         LintId::of(match_on_vec_items::MATCH_ON_VEC_ITEMS),
1115         LintId::of(matches::MATCH_BOOL),
1116         LintId::of(matches::MATCH_SAME_ARMS),
1117         LintId::of(matches::MATCH_WILDCARD_FOR_SINGLE_VARIANTS),
1118         LintId::of(matches::MATCH_WILD_ERR_ARM),
1119         LintId::of(matches::SINGLE_MATCH_ELSE),
1120         LintId::of(methods::CLONED_INSTEAD_OF_COPIED),
1121         LintId::of(methods::FILTER_MAP_NEXT),
1122         LintId::of(methods::FLAT_MAP_OPTION),
1123         LintId::of(methods::FROM_ITER_INSTEAD_OF_COLLECT),
1124         LintId::of(methods::IMPLICIT_CLONE),
1125         LintId::of(methods::INEFFICIENT_TO_STRING),
1126         LintId::of(methods::MAP_FLATTEN),
1127         LintId::of(methods::MAP_UNWRAP_OR),
1128         LintId::of(misc::USED_UNDERSCORE_BINDING),
1129         LintId::of(misc_early::UNSEPARATED_LITERAL_SUFFIX),
1130         LintId::of(mut_mut::MUT_MUT),
1131         LintId::of(needless_bitwise_bool::NEEDLESS_BITWISE_BOOL),
1132         LintId::of(needless_borrow::REF_BINDING_TO_REFERENCE),
1133         LintId::of(needless_continue::NEEDLESS_CONTINUE),
1134         LintId::of(needless_for_each::NEEDLESS_FOR_EACH),
1135         LintId::of(needless_pass_by_value::NEEDLESS_PASS_BY_VALUE),
1136         LintId::of(non_expressive_names::SIMILAR_NAMES),
1137         LintId::of(pass_by_ref_or_value::LARGE_TYPES_PASSED_BY_VALUE),
1138         LintId::of(pass_by_ref_or_value::TRIVIALLY_COPY_PASS_BY_REF),
1139         LintId::of(ranges::RANGE_MINUS_ONE),
1140         LintId::of(ranges::RANGE_PLUS_ONE),
1141         LintId::of(redundant_else::REDUNDANT_ELSE),
1142         LintId::of(ref_option_ref::REF_OPTION_REF),
1143         LintId::of(semicolon_if_nothing_returned::SEMICOLON_IF_NOTHING_RETURNED),
1144         LintId::of(shadow::SHADOW_UNRELATED),
1145         LintId::of(strings::STRING_ADD_ASSIGN),
1146         LintId::of(trait_bounds::TRAIT_DUPLICATION_IN_BOUNDS),
1147         LintId::of(trait_bounds::TYPE_REPETITION_IN_BOUNDS),
1148         LintId::of(transmute::TRANSMUTE_PTR_TO_PTR),
1149         LintId::of(types::LINKEDLIST),
1150         LintId::of(types::OPTION_OPTION),
1151         LintId::of(unicode::NON_ASCII_LITERAL),
1152         LintId::of(unicode::UNICODE_NOT_NFC),
1153         LintId::of(unit_types::LET_UNIT_VALUE),
1154         LintId::of(unnecessary_wraps::UNNECESSARY_WRAPS),
1155         LintId::of(unnested_or_patterns::UNNESTED_OR_PATTERNS),
1156         LintId::of(unused_async::UNUSED_ASYNC),
1157         LintId::of(unused_self::UNUSED_SELF),
1158         LintId::of(wildcard_imports::ENUM_GLOB_USE),
1159         LintId::of(wildcard_imports::WILDCARD_IMPORTS),
1160         LintId::of(zero_sized_map_values::ZERO_SIZED_MAP_VALUES),
1161     ]);
1162
1163     #[cfg(feature = "internal-lints")]
1164     store.register_group(true, "clippy::internal", Some("clippy_internal"), vec![
1165         LintId::of(utils::internal_lints::CLIPPY_LINTS_INTERNAL),
1166         LintId::of(utils::internal_lints::COLLAPSIBLE_SPAN_LINT_CALLS),
1167         LintId::of(utils::internal_lints::COMPILER_LINT_FUNCTIONS),
1168         LintId::of(utils::internal_lints::DEFAULT_LINT),
1169         LintId::of(utils::internal_lints::IF_CHAIN_STYLE),
1170         LintId::of(utils::internal_lints::INTERNING_DEFINED_SYMBOL),
1171         LintId::of(utils::internal_lints::INVALID_PATHS),
1172         LintId::of(utils::internal_lints::LINT_WITHOUT_LINT_PASS),
1173         LintId::of(utils::internal_lints::MATCH_TYPE_ON_DIAGNOSTIC_ITEM),
1174         LintId::of(utils::internal_lints::OUTER_EXPN_EXPN_DATA),
1175         LintId::of(utils::internal_lints::PRODUCE_ICE),
1176         LintId::of(utils::internal_lints::UNNECESSARY_SYMBOL_STR),
1177     ]);
1178
1179     store.register_group(true, "clippy::all", Some("clippy"), vec![
1180         LintId::of(absurd_extreme_comparisons::ABSURD_EXTREME_COMPARISONS),
1181         LintId::of(approx_const::APPROX_CONSTANT),
1182         LintId::of(assertions_on_constants::ASSERTIONS_ON_CONSTANTS),
1183         LintId::of(assign_ops::ASSIGN_OP_PATTERN),
1184         LintId::of(assign_ops::MISREFACTORED_ASSIGN_OP),
1185         LintId::of(async_yields_async::ASYNC_YIELDS_ASYNC),
1186         LintId::of(atomic_ordering::INVALID_ATOMIC_ORDERING),
1187         LintId::of(attrs::BLANKET_CLIPPY_RESTRICTION_LINTS),
1188         LintId::of(attrs::DEPRECATED_CFG_ATTR),
1189         LintId::of(attrs::DEPRECATED_SEMVER),
1190         LintId::of(attrs::MISMATCHED_TARGET_OS),
1191         LintId::of(attrs::USELESS_ATTRIBUTE),
1192         LintId::of(bit_mask::BAD_BIT_MASK),
1193         LintId::of(bit_mask::INEFFECTIVE_BIT_MASK),
1194         LintId::of(blacklisted_name::BLACKLISTED_NAME),
1195         LintId::of(blocks_in_if_conditions::BLOCKS_IN_IF_CONDITIONS),
1196         LintId::of(bool_assert_comparison::BOOL_ASSERT_COMPARISON),
1197         LintId::of(booleans::LOGIC_BUG),
1198         LintId::of(booleans::NONMINIMAL_BOOL),
1199         LintId::of(casts::CAST_REF_TO_MUT),
1200         LintId::of(casts::CHAR_LIT_AS_U8),
1201         LintId::of(casts::FN_TO_NUMERIC_CAST),
1202         LintId::of(casts::FN_TO_NUMERIC_CAST_WITH_TRUNCATION),
1203         LintId::of(casts::UNNECESSARY_CAST),
1204         LintId::of(collapsible_if::COLLAPSIBLE_ELSE_IF),
1205         LintId::of(collapsible_if::COLLAPSIBLE_IF),
1206         LintId::of(collapsible_match::COLLAPSIBLE_MATCH),
1207         LintId::of(comparison_chain::COMPARISON_CHAIN),
1208         LintId::of(copies::IFS_SAME_COND),
1209         LintId::of(copies::IF_SAME_THEN_ELSE),
1210         LintId::of(default::FIELD_REASSIGN_WITH_DEFAULT),
1211         LintId::of(derive::DERIVE_HASH_XOR_EQ),
1212         LintId::of(derive::DERIVE_ORD_XOR_PARTIAL_ORD),
1213         LintId::of(doc::MISSING_SAFETY_DOC),
1214         LintId::of(doc::NEEDLESS_DOCTEST_MAIN),
1215         LintId::of(double_comparison::DOUBLE_COMPARISONS),
1216         LintId::of(double_parens::DOUBLE_PARENS),
1217         LintId::of(drop_forget_ref::DROP_COPY),
1218         LintId::of(drop_forget_ref::DROP_REF),
1219         LintId::of(drop_forget_ref::FORGET_COPY),
1220         LintId::of(drop_forget_ref::FORGET_REF),
1221         LintId::of(duration_subsec::DURATION_SUBSEC),
1222         LintId::of(entry::MAP_ENTRY),
1223         LintId::of(enum_clike::ENUM_CLIKE_UNPORTABLE_VARIANT),
1224         LintId::of(enum_variants::ENUM_VARIANT_NAMES),
1225         LintId::of(enum_variants::MODULE_INCEPTION),
1226         LintId::of(eq_op::EQ_OP),
1227         LintId::of(eq_op::OP_REF),
1228         LintId::of(erasing_op::ERASING_OP),
1229         LintId::of(escape::BOXED_LOCAL),
1230         LintId::of(eta_reduction::REDUNDANT_CLOSURE),
1231         LintId::of(eval_order_dependence::DIVERGING_SUB_EXPRESSION),
1232         LintId::of(eval_order_dependence::EVAL_ORDER_DEPENDENCE),
1233         LintId::of(explicit_write::EXPLICIT_WRITE),
1234         LintId::of(float_equality_without_abs::FLOAT_EQUALITY_WITHOUT_ABS),
1235         LintId::of(float_literal::EXCESSIVE_PRECISION),
1236         LintId::of(format::USELESS_FORMAT),
1237         LintId::of(formatting::POSSIBLE_MISSING_COMMA),
1238         LintId::of(formatting::SUSPICIOUS_ASSIGNMENT_FORMATTING),
1239         LintId::of(formatting::SUSPICIOUS_ELSE_FORMATTING),
1240         LintId::of(formatting::SUSPICIOUS_UNARY_OP_FORMATTING),
1241         LintId::of(from_over_into::FROM_OVER_INTO),
1242         LintId::of(from_str_radix_10::FROM_STR_RADIX_10),
1243         LintId::of(functions::DOUBLE_MUST_USE),
1244         LintId::of(functions::MUST_USE_UNIT),
1245         LintId::of(functions::NOT_UNSAFE_PTR_ARG_DEREF),
1246         LintId::of(functions::RESULT_UNIT_ERR),
1247         LintId::of(functions::TOO_MANY_ARGUMENTS),
1248         LintId::of(get_last_with_len::GET_LAST_WITH_LEN),
1249         LintId::of(identity_op::IDENTITY_OP),
1250         LintId::of(if_let_mutex::IF_LET_MUTEX),
1251         LintId::of(if_let_some_result::IF_LET_SOME_RESULT),
1252         LintId::of(indexing_slicing::OUT_OF_BOUNDS_INDEXING),
1253         LintId::of(infinite_iter::INFINITE_ITER),
1254         LintId::of(inherent_to_string::INHERENT_TO_STRING),
1255         LintId::of(inherent_to_string::INHERENT_TO_STRING_SHADOW_DISPLAY),
1256         LintId::of(inline_fn_without_body::INLINE_FN_WITHOUT_BODY),
1257         LintId::of(int_plus_one::INT_PLUS_ONE),
1258         LintId::of(large_const_arrays::LARGE_CONST_ARRAYS),
1259         LintId::of(large_enum_variant::LARGE_ENUM_VARIANT),
1260         LintId::of(len_zero::COMPARISON_TO_EMPTY),
1261         LintId::of(len_zero::LEN_WITHOUT_IS_EMPTY),
1262         LintId::of(len_zero::LEN_ZERO),
1263         LintId::of(let_underscore::LET_UNDERSCORE_LOCK),
1264         LintId::of(lifetimes::EXTRA_UNUSED_LIFETIMES),
1265         LintId::of(lifetimes::NEEDLESS_LIFETIMES),
1266         LintId::of(literal_representation::INCONSISTENT_DIGIT_GROUPING),
1267         LintId::of(literal_representation::MISTYPED_LITERAL_SUFFIXES),
1268         LintId::of(literal_representation::UNUSUAL_BYTE_GROUPINGS),
1269         LintId::of(loops::EMPTY_LOOP),
1270         LintId::of(loops::EXPLICIT_COUNTER_LOOP),
1271         LintId::of(loops::FOR_KV_MAP),
1272         LintId::of(loops::FOR_LOOPS_OVER_FALLIBLES),
1273         LintId::of(loops::ITER_NEXT_LOOP),
1274         LintId::of(loops::MANUAL_FLATTEN),
1275         LintId::of(loops::MANUAL_MEMCPY),
1276         LintId::of(loops::MUT_RANGE_BOUND),
1277         LintId::of(loops::NEEDLESS_COLLECT),
1278         LintId::of(loops::NEEDLESS_RANGE_LOOP),
1279         LintId::of(loops::NEVER_LOOP),
1280         LintId::of(loops::SAME_ITEM_PUSH),
1281         LintId::of(loops::SINGLE_ELEMENT_LOOP),
1282         LintId::of(loops::WHILE_IMMUTABLE_CONDITION),
1283         LintId::of(loops::WHILE_LET_LOOP),
1284         LintId::of(loops::WHILE_LET_ON_ITERATOR),
1285         LintId::of(main_recursion::MAIN_RECURSION),
1286         LintId::of(manual_async_fn::MANUAL_ASYNC_FN),
1287         LintId::of(manual_map::MANUAL_MAP),
1288         LintId::of(manual_non_exhaustive::MANUAL_NON_EXHAUSTIVE),
1289         LintId::of(manual_strip::MANUAL_STRIP),
1290         LintId::of(manual_unwrap_or::MANUAL_UNWRAP_OR),
1291         LintId::of(map_clone::MAP_CLONE),
1292         LintId::of(map_unit_fn::OPTION_MAP_UNIT_FN),
1293         LintId::of(map_unit_fn::RESULT_MAP_UNIT_FN),
1294         LintId::of(matches::INFALLIBLE_DESTRUCTURING_MATCH),
1295         LintId::of(matches::MATCH_AS_REF),
1296         LintId::of(matches::MATCH_LIKE_MATCHES_MACRO),
1297         LintId::of(matches::MATCH_OVERLAPPING_ARM),
1298         LintId::of(matches::MATCH_REF_PATS),
1299         LintId::of(matches::MATCH_SINGLE_BINDING),
1300         LintId::of(matches::REDUNDANT_PATTERN_MATCHING),
1301         LintId::of(matches::SINGLE_MATCH),
1302         LintId::of(matches::WILDCARD_IN_OR_PATTERNS),
1303         LintId::of(mem_discriminant::MEM_DISCRIMINANT_NON_ENUM),
1304         LintId::of(mem_replace::MEM_REPLACE_OPTION_WITH_NONE),
1305         LintId::of(mem_replace::MEM_REPLACE_WITH_DEFAULT),
1306         LintId::of(mem_replace::MEM_REPLACE_WITH_UNINIT),
1307         LintId::of(methods::BIND_INSTEAD_OF_MAP),
1308         LintId::of(methods::BYTES_NTH),
1309         LintId::of(methods::CHARS_LAST_CMP),
1310         LintId::of(methods::CHARS_NEXT_CMP),
1311         LintId::of(methods::CLONE_DOUBLE_REF),
1312         LintId::of(methods::CLONE_ON_COPY),
1313         LintId::of(methods::EXPECT_FUN_CALL),
1314         LintId::of(methods::EXTEND_WITH_DRAIN),
1315         LintId::of(methods::FILTER_MAP_IDENTITY),
1316         LintId::of(methods::FILTER_NEXT),
1317         LintId::of(methods::FLAT_MAP_IDENTITY),
1318         LintId::of(methods::INSPECT_FOR_EACH),
1319         LintId::of(methods::INTO_ITER_ON_REF),
1320         LintId::of(methods::ITERATOR_STEP_BY_ZERO),
1321         LintId::of(methods::ITER_CLONED_COLLECT),
1322         LintId::of(methods::ITER_COUNT),
1323         LintId::of(methods::ITER_NEXT_SLICE),
1324         LintId::of(methods::ITER_NTH),
1325         LintId::of(methods::ITER_NTH_ZERO),
1326         LintId::of(methods::ITER_SKIP_NEXT),
1327         LintId::of(methods::MANUAL_FILTER_MAP),
1328         LintId::of(methods::MANUAL_FIND_MAP),
1329         LintId::of(methods::MANUAL_SATURATING_ARITHMETIC),
1330         LintId::of(methods::MANUAL_SPLIT_ONCE),
1331         LintId::of(methods::MANUAL_STR_REPEAT),
1332         LintId::of(methods::MAP_COLLECT_RESULT_UNIT),
1333         LintId::of(methods::MAP_IDENTITY),
1334         LintId::of(methods::NEW_RET_NO_SELF),
1335         LintId::of(methods::OK_EXPECT),
1336         LintId::of(methods::OPTION_AS_REF_DEREF),
1337         LintId::of(methods::OPTION_FILTER_MAP),
1338         LintId::of(methods::OPTION_MAP_OR_NONE),
1339         LintId::of(methods::OR_FUN_CALL),
1340         LintId::of(methods::RESULT_MAP_OR_INTO_OPTION),
1341         LintId::of(methods::SEARCH_IS_SOME),
1342         LintId::of(methods::SHOULD_IMPLEMENT_TRAIT),
1343         LintId::of(methods::SINGLE_CHAR_ADD_STR),
1344         LintId::of(methods::SINGLE_CHAR_PATTERN),
1345         LintId::of(methods::SKIP_WHILE_NEXT),
1346         LintId::of(methods::STRING_EXTEND_CHARS),
1347         LintId::of(methods::SUSPICIOUS_MAP),
1348         LintId::of(methods::SUSPICIOUS_SPLITN),
1349         LintId::of(methods::UNINIT_ASSUMED_INIT),
1350         LintId::of(methods::UNNECESSARY_FILTER_MAP),
1351         LintId::of(methods::UNNECESSARY_FOLD),
1352         LintId::of(methods::UNNECESSARY_LAZY_EVALUATIONS),
1353         LintId::of(methods::UNWRAP_OR_ELSE_DEFAULT),
1354         LintId::of(methods::USELESS_ASREF),
1355         LintId::of(methods::WRONG_SELF_CONVENTION),
1356         LintId::of(methods::ZST_OFFSET),
1357         LintId::of(minmax::MIN_MAX),
1358         LintId::of(misc::CMP_NAN),
1359         LintId::of(misc::CMP_OWNED),
1360         LintId::of(misc::FLOAT_CMP),
1361         LintId::of(misc::MODULO_ONE),
1362         LintId::of(misc::SHORT_CIRCUIT_STATEMENT),
1363         LintId::of(misc::TOPLEVEL_REF_ARG),
1364         LintId::of(misc::ZERO_PTR),
1365         LintId::of(misc_early::BUILTIN_TYPE_SHADOW),
1366         LintId::of(misc_early::DOUBLE_NEG),
1367         LintId::of(misc_early::DUPLICATE_UNDERSCORE_ARGUMENT),
1368         LintId::of(misc_early::MIXED_CASE_HEX_LITERALS),
1369         LintId::of(misc_early::REDUNDANT_PATTERN),
1370         LintId::of(misc_early::UNNEEDED_WILDCARD_PATTERN),
1371         LintId::of(misc_early::ZERO_PREFIXED_LITERAL),
1372         LintId::of(mut_key::MUTABLE_KEY_TYPE),
1373         LintId::of(mut_mutex_lock::MUT_MUTEX_LOCK),
1374         LintId::of(mut_reference::UNNECESSARY_MUT_PASSED),
1375         LintId::of(mutex_atomic::MUTEX_ATOMIC),
1376         LintId::of(needless_arbitrary_self_type::NEEDLESS_ARBITRARY_SELF_TYPE),
1377         LintId::of(needless_bool::BOOL_COMPARISON),
1378         LintId::of(needless_bool::NEEDLESS_BOOL),
1379         LintId::of(needless_borrow::NEEDLESS_BORROW),
1380         LintId::of(needless_borrowed_ref::NEEDLESS_BORROWED_REFERENCE),
1381         LintId::of(needless_question_mark::NEEDLESS_QUESTION_MARK),
1382         LintId::of(needless_update::NEEDLESS_UPDATE),
1383         LintId::of(neg_cmp_op_on_partial_ord::NEG_CMP_OP_ON_PARTIAL_ORD),
1384         LintId::of(neg_multiply::NEG_MULTIPLY),
1385         LintId::of(new_without_default::NEW_WITHOUT_DEFAULT),
1386         LintId::of(no_effect::NO_EFFECT),
1387         LintId::of(no_effect::UNNECESSARY_OPERATION),
1388         LintId::of(non_copy_const::BORROW_INTERIOR_MUTABLE_CONST),
1389         LintId::of(non_copy_const::DECLARE_INTERIOR_MUTABLE_CONST),
1390         LintId::of(non_expressive_names::JUST_UNDERSCORES_AND_DIGITS),
1391         LintId::of(non_expressive_names::MANY_SINGLE_CHAR_NAMES),
1392         LintId::of(non_octal_unix_permissions::NON_OCTAL_UNIX_PERMISSIONS),
1393         LintId::of(open_options::NONSENSICAL_OPEN_OPTIONS),
1394         LintId::of(option_env_unwrap::OPTION_ENV_UNWRAP),
1395         LintId::of(overflow_check_conditional::OVERFLOW_CHECK_CONDITIONAL),
1396         LintId::of(partialeq_ne_impl::PARTIALEQ_NE_IMPL),
1397         LintId::of(precedence::PRECEDENCE),
1398         LintId::of(ptr::CMP_NULL),
1399         LintId::of(ptr::INVALID_NULL_PTR_USAGE),
1400         LintId::of(ptr::MUT_FROM_REF),
1401         LintId::of(ptr::PTR_ARG),
1402         LintId::of(ptr_eq::PTR_EQ),
1403         LintId::of(ptr_offset_with_cast::PTR_OFFSET_WITH_CAST),
1404         LintId::of(question_mark::QUESTION_MARK),
1405         LintId::of(ranges::MANUAL_RANGE_CONTAINS),
1406         LintId::of(ranges::RANGE_ZIP_WITH_LEN),
1407         LintId::of(ranges::REVERSED_EMPTY_RANGES),
1408         LintId::of(redundant_clone::REDUNDANT_CLONE),
1409         LintId::of(redundant_closure_call::REDUNDANT_CLOSURE_CALL),
1410         LintId::of(redundant_field_names::REDUNDANT_FIELD_NAMES),
1411         LintId::of(redundant_slicing::REDUNDANT_SLICING),
1412         LintId::of(redundant_static_lifetimes::REDUNDANT_STATIC_LIFETIMES),
1413         LintId::of(reference::DEREF_ADDROF),
1414         LintId::of(reference::REF_IN_DEREF),
1415         LintId::of(regex::INVALID_REGEX),
1416         LintId::of(repeat_once::REPEAT_ONCE),
1417         LintId::of(returns::LET_AND_RETURN),
1418         LintId::of(returns::NEEDLESS_RETURN),
1419         LintId::of(self_assignment::SELF_ASSIGNMENT),
1420         LintId::of(self_named_constructors::SELF_NAMED_CONSTRUCTORS),
1421         LintId::of(serde_api::SERDE_API_MISUSE),
1422         LintId::of(single_component_path_imports::SINGLE_COMPONENT_PATH_IMPORTS),
1423         LintId::of(size_of_in_element_count::SIZE_OF_IN_ELEMENT_COUNT),
1424         LintId::of(slow_vector_initialization::SLOW_VECTOR_INITIALIZATION),
1425         LintId::of(stable_sort_primitive::STABLE_SORT_PRIMITIVE),
1426         LintId::of(strings::STRING_FROM_UTF8_AS_BYTES),
1427         LintId::of(strlen_on_c_strings::STRLEN_ON_C_STRINGS),
1428         LintId::of(suspicious_trait_impl::SUSPICIOUS_ARITHMETIC_IMPL),
1429         LintId::of(suspicious_trait_impl::SUSPICIOUS_OP_ASSIGN_IMPL),
1430         LintId::of(swap::ALMOST_SWAPPED),
1431         LintId::of(swap::MANUAL_SWAP),
1432         LintId::of(tabs_in_doc_comments::TABS_IN_DOC_COMMENTS),
1433         LintId::of(temporary_assignment::TEMPORARY_ASSIGNMENT),
1434         LintId::of(to_digit_is_some::TO_DIGIT_IS_SOME),
1435         LintId::of(to_string_in_display::TO_STRING_IN_DISPLAY),
1436         LintId::of(transmute::CROSSPOINTER_TRANSMUTE),
1437         LintId::of(transmute::TRANSMUTES_EXPRESSIBLE_AS_PTR_CASTS),
1438         LintId::of(transmute::TRANSMUTE_BYTES_TO_STR),
1439         LintId::of(transmute::TRANSMUTE_FLOAT_TO_INT),
1440         LintId::of(transmute::TRANSMUTE_INT_TO_BOOL),
1441         LintId::of(transmute::TRANSMUTE_INT_TO_CHAR),
1442         LintId::of(transmute::TRANSMUTE_INT_TO_FLOAT),
1443         LintId::of(transmute::TRANSMUTE_PTR_TO_REF),
1444         LintId::of(transmute::UNSOUND_COLLECTION_TRANSMUTE),
1445         LintId::of(transmute::WRONG_TRANSMUTE),
1446         LintId::of(transmuting_null::TRANSMUTING_NULL),
1447         LintId::of(try_err::TRY_ERR),
1448         LintId::of(types::BORROWED_BOX),
1449         LintId::of(types::BOX_VEC),
1450         LintId::of(types::REDUNDANT_ALLOCATION),
1451         LintId::of(types::TYPE_COMPLEXITY),
1452         LintId::of(types::VEC_BOX),
1453         LintId::of(undropped_manually_drops::UNDROPPED_MANUALLY_DROPS),
1454         LintId::of(unicode::INVISIBLE_CHARACTERS),
1455         LintId::of(unit_return_expecting_ord::UNIT_RETURN_EXPECTING_ORD),
1456         LintId::of(unit_types::UNIT_ARG),
1457         LintId::of(unit_types::UNIT_CMP),
1458         LintId::of(unnamed_address::FN_ADDRESS_COMPARISONS),
1459         LintId::of(unnamed_address::VTABLE_ADDRESS_COMPARISONS),
1460         LintId::of(unnecessary_sort_by::UNNECESSARY_SORT_BY),
1461         LintId::of(unsafe_removed_from_name::UNSAFE_REMOVED_FROM_NAME),
1462         LintId::of(unused_io_amount::UNUSED_IO_AMOUNT),
1463         LintId::of(unused_unit::UNUSED_UNIT),
1464         LintId::of(unwrap::PANICKING_UNWRAP),
1465         LintId::of(unwrap::UNNECESSARY_UNWRAP),
1466         LintId::of(upper_case_acronyms::UPPER_CASE_ACRONYMS),
1467         LintId::of(useless_conversion::USELESS_CONVERSION),
1468         LintId::of(vec::USELESS_VEC),
1469         LintId::of(vec_init_then_push::VEC_INIT_THEN_PUSH),
1470         LintId::of(vec_resize_to_zero::VEC_RESIZE_TO_ZERO),
1471         LintId::of(write::PRINTLN_EMPTY_STRING),
1472         LintId::of(write::PRINT_LITERAL),
1473         LintId::of(write::PRINT_WITH_NEWLINE),
1474         LintId::of(write::WRITELN_EMPTY_STRING),
1475         LintId::of(write::WRITE_LITERAL),
1476         LintId::of(write::WRITE_WITH_NEWLINE),
1477         LintId::of(zero_div_zero::ZERO_DIVIDED_BY_ZERO),
1478     ]);
1479
1480     store.register_group(true, "clippy::style", Some("clippy_style"), vec![
1481         LintId::of(assertions_on_constants::ASSERTIONS_ON_CONSTANTS),
1482         LintId::of(assign_ops::ASSIGN_OP_PATTERN),
1483         LintId::of(blacklisted_name::BLACKLISTED_NAME),
1484         LintId::of(blocks_in_if_conditions::BLOCKS_IN_IF_CONDITIONS),
1485         LintId::of(bool_assert_comparison::BOOL_ASSERT_COMPARISON),
1486         LintId::of(casts::FN_TO_NUMERIC_CAST),
1487         LintId::of(casts::FN_TO_NUMERIC_CAST_WITH_TRUNCATION),
1488         LintId::of(collapsible_if::COLLAPSIBLE_ELSE_IF),
1489         LintId::of(collapsible_if::COLLAPSIBLE_IF),
1490         LintId::of(collapsible_match::COLLAPSIBLE_MATCH),
1491         LintId::of(comparison_chain::COMPARISON_CHAIN),
1492         LintId::of(default::FIELD_REASSIGN_WITH_DEFAULT),
1493         LintId::of(doc::MISSING_SAFETY_DOC),
1494         LintId::of(doc::NEEDLESS_DOCTEST_MAIN),
1495         LintId::of(enum_variants::ENUM_VARIANT_NAMES),
1496         LintId::of(enum_variants::MODULE_INCEPTION),
1497         LintId::of(eq_op::OP_REF),
1498         LintId::of(eta_reduction::REDUNDANT_CLOSURE),
1499         LintId::of(float_literal::EXCESSIVE_PRECISION),
1500         LintId::of(from_over_into::FROM_OVER_INTO),
1501         LintId::of(from_str_radix_10::FROM_STR_RADIX_10),
1502         LintId::of(functions::DOUBLE_MUST_USE),
1503         LintId::of(functions::MUST_USE_UNIT),
1504         LintId::of(functions::RESULT_UNIT_ERR),
1505         LintId::of(if_let_some_result::IF_LET_SOME_RESULT),
1506         LintId::of(inherent_to_string::INHERENT_TO_STRING),
1507         LintId::of(len_zero::COMPARISON_TO_EMPTY),
1508         LintId::of(len_zero::LEN_WITHOUT_IS_EMPTY),
1509         LintId::of(len_zero::LEN_ZERO),
1510         LintId::of(literal_representation::INCONSISTENT_DIGIT_GROUPING),
1511         LintId::of(literal_representation::UNUSUAL_BYTE_GROUPINGS),
1512         LintId::of(loops::FOR_KV_MAP),
1513         LintId::of(loops::NEEDLESS_RANGE_LOOP),
1514         LintId::of(loops::SAME_ITEM_PUSH),
1515         LintId::of(loops::WHILE_LET_ON_ITERATOR),
1516         LintId::of(main_recursion::MAIN_RECURSION),
1517         LintId::of(manual_async_fn::MANUAL_ASYNC_FN),
1518         LintId::of(manual_map::MANUAL_MAP),
1519         LintId::of(manual_non_exhaustive::MANUAL_NON_EXHAUSTIVE),
1520         LintId::of(map_clone::MAP_CLONE),
1521         LintId::of(matches::INFALLIBLE_DESTRUCTURING_MATCH),
1522         LintId::of(matches::MATCH_LIKE_MATCHES_MACRO),
1523         LintId::of(matches::MATCH_OVERLAPPING_ARM),
1524         LintId::of(matches::MATCH_REF_PATS),
1525         LintId::of(matches::REDUNDANT_PATTERN_MATCHING),
1526         LintId::of(matches::SINGLE_MATCH),
1527         LintId::of(mem_replace::MEM_REPLACE_OPTION_WITH_NONE),
1528         LintId::of(mem_replace::MEM_REPLACE_WITH_DEFAULT),
1529         LintId::of(methods::BYTES_NTH),
1530         LintId::of(methods::CHARS_LAST_CMP),
1531         LintId::of(methods::CHARS_NEXT_CMP),
1532         LintId::of(methods::INTO_ITER_ON_REF),
1533         LintId::of(methods::ITER_CLONED_COLLECT),
1534         LintId::of(methods::ITER_NEXT_SLICE),
1535         LintId::of(methods::ITER_NTH_ZERO),
1536         LintId::of(methods::ITER_SKIP_NEXT),
1537         LintId::of(methods::MANUAL_SATURATING_ARITHMETIC),
1538         LintId::of(methods::MAP_COLLECT_RESULT_UNIT),
1539         LintId::of(methods::NEW_RET_NO_SELF),
1540         LintId::of(methods::OK_EXPECT),
1541         LintId::of(methods::OPTION_MAP_OR_NONE),
1542         LintId::of(methods::RESULT_MAP_OR_INTO_OPTION),
1543         LintId::of(methods::SHOULD_IMPLEMENT_TRAIT),
1544         LintId::of(methods::SINGLE_CHAR_ADD_STR),
1545         LintId::of(methods::STRING_EXTEND_CHARS),
1546         LintId::of(methods::UNNECESSARY_FOLD),
1547         LintId::of(methods::UNNECESSARY_LAZY_EVALUATIONS),
1548         LintId::of(methods::UNWRAP_OR_ELSE_DEFAULT),
1549         LintId::of(methods::WRONG_SELF_CONVENTION),
1550         LintId::of(misc::TOPLEVEL_REF_ARG),
1551         LintId::of(misc::ZERO_PTR),
1552         LintId::of(misc_early::BUILTIN_TYPE_SHADOW),
1553         LintId::of(misc_early::DOUBLE_NEG),
1554         LintId::of(misc_early::DUPLICATE_UNDERSCORE_ARGUMENT),
1555         LintId::of(misc_early::MIXED_CASE_HEX_LITERALS),
1556         LintId::of(misc_early::REDUNDANT_PATTERN),
1557         LintId::of(mut_mutex_lock::MUT_MUTEX_LOCK),
1558         LintId::of(mut_reference::UNNECESSARY_MUT_PASSED),
1559         LintId::of(needless_borrow::NEEDLESS_BORROW),
1560         LintId::of(neg_multiply::NEG_MULTIPLY),
1561         LintId::of(new_without_default::NEW_WITHOUT_DEFAULT),
1562         LintId::of(non_copy_const::BORROW_INTERIOR_MUTABLE_CONST),
1563         LintId::of(non_copy_const::DECLARE_INTERIOR_MUTABLE_CONST),
1564         LintId::of(non_expressive_names::JUST_UNDERSCORES_AND_DIGITS),
1565         LintId::of(non_expressive_names::MANY_SINGLE_CHAR_NAMES),
1566         LintId::of(ptr::CMP_NULL),
1567         LintId::of(ptr::PTR_ARG),
1568         LintId::of(ptr_eq::PTR_EQ),
1569         LintId::of(question_mark::QUESTION_MARK),
1570         LintId::of(ranges::MANUAL_RANGE_CONTAINS),
1571         LintId::of(redundant_field_names::REDUNDANT_FIELD_NAMES),
1572         LintId::of(redundant_static_lifetimes::REDUNDANT_STATIC_LIFETIMES),
1573         LintId::of(returns::LET_AND_RETURN),
1574         LintId::of(returns::NEEDLESS_RETURN),
1575         LintId::of(self_named_constructors::SELF_NAMED_CONSTRUCTORS),
1576         LintId::of(single_component_path_imports::SINGLE_COMPONENT_PATH_IMPORTS),
1577         LintId::of(tabs_in_doc_comments::TABS_IN_DOC_COMMENTS),
1578         LintId::of(to_digit_is_some::TO_DIGIT_IS_SOME),
1579         LintId::of(try_err::TRY_ERR),
1580         LintId::of(unsafe_removed_from_name::UNSAFE_REMOVED_FROM_NAME),
1581         LintId::of(unused_unit::UNUSED_UNIT),
1582         LintId::of(upper_case_acronyms::UPPER_CASE_ACRONYMS),
1583         LintId::of(write::PRINTLN_EMPTY_STRING),
1584         LintId::of(write::PRINT_LITERAL),
1585         LintId::of(write::PRINT_WITH_NEWLINE),
1586         LintId::of(write::WRITELN_EMPTY_STRING),
1587         LintId::of(write::WRITE_LITERAL),
1588         LintId::of(write::WRITE_WITH_NEWLINE),
1589     ]);
1590
1591     store.register_group(true, "clippy::complexity", Some("clippy_complexity"), vec![
1592         LintId::of(attrs::DEPRECATED_CFG_ATTR),
1593         LintId::of(booleans::NONMINIMAL_BOOL),
1594         LintId::of(casts::CHAR_LIT_AS_U8),
1595         LintId::of(casts::UNNECESSARY_CAST),
1596         LintId::of(double_comparison::DOUBLE_COMPARISONS),
1597         LintId::of(double_parens::DOUBLE_PARENS),
1598         LintId::of(duration_subsec::DURATION_SUBSEC),
1599         LintId::of(eval_order_dependence::DIVERGING_SUB_EXPRESSION),
1600         LintId::of(explicit_write::EXPLICIT_WRITE),
1601         LintId::of(format::USELESS_FORMAT),
1602         LintId::of(functions::TOO_MANY_ARGUMENTS),
1603         LintId::of(get_last_with_len::GET_LAST_WITH_LEN),
1604         LintId::of(identity_op::IDENTITY_OP),
1605         LintId::of(int_plus_one::INT_PLUS_ONE),
1606         LintId::of(lifetimes::EXTRA_UNUSED_LIFETIMES),
1607         LintId::of(lifetimes::NEEDLESS_LIFETIMES),
1608         LintId::of(loops::EXPLICIT_COUNTER_LOOP),
1609         LintId::of(loops::MANUAL_FLATTEN),
1610         LintId::of(loops::SINGLE_ELEMENT_LOOP),
1611         LintId::of(loops::WHILE_LET_LOOP),
1612         LintId::of(manual_strip::MANUAL_STRIP),
1613         LintId::of(manual_unwrap_or::MANUAL_UNWRAP_OR),
1614         LintId::of(map_unit_fn::OPTION_MAP_UNIT_FN),
1615         LintId::of(map_unit_fn::RESULT_MAP_UNIT_FN),
1616         LintId::of(matches::MATCH_AS_REF),
1617         LintId::of(matches::MATCH_SINGLE_BINDING),
1618         LintId::of(matches::WILDCARD_IN_OR_PATTERNS),
1619         LintId::of(methods::BIND_INSTEAD_OF_MAP),
1620         LintId::of(methods::CLONE_ON_COPY),
1621         LintId::of(methods::FILTER_MAP_IDENTITY),
1622         LintId::of(methods::FILTER_NEXT),
1623         LintId::of(methods::FLAT_MAP_IDENTITY),
1624         LintId::of(methods::INSPECT_FOR_EACH),
1625         LintId::of(methods::ITER_COUNT),
1626         LintId::of(methods::MANUAL_FILTER_MAP),
1627         LintId::of(methods::MANUAL_FIND_MAP),
1628         LintId::of(methods::MANUAL_SPLIT_ONCE),
1629         LintId::of(methods::MAP_IDENTITY),
1630         LintId::of(methods::OPTION_AS_REF_DEREF),
1631         LintId::of(methods::OPTION_FILTER_MAP),
1632         LintId::of(methods::SEARCH_IS_SOME),
1633         LintId::of(methods::SKIP_WHILE_NEXT),
1634         LintId::of(methods::UNNECESSARY_FILTER_MAP),
1635         LintId::of(methods::USELESS_ASREF),
1636         LintId::of(misc::SHORT_CIRCUIT_STATEMENT),
1637         LintId::of(misc_early::UNNEEDED_WILDCARD_PATTERN),
1638         LintId::of(misc_early::ZERO_PREFIXED_LITERAL),
1639         LintId::of(needless_arbitrary_self_type::NEEDLESS_ARBITRARY_SELF_TYPE),
1640         LintId::of(needless_bool::BOOL_COMPARISON),
1641         LintId::of(needless_bool::NEEDLESS_BOOL),
1642         LintId::of(needless_borrowed_ref::NEEDLESS_BORROWED_REFERENCE),
1643         LintId::of(needless_question_mark::NEEDLESS_QUESTION_MARK),
1644         LintId::of(needless_update::NEEDLESS_UPDATE),
1645         LintId::of(neg_cmp_op_on_partial_ord::NEG_CMP_OP_ON_PARTIAL_ORD),
1646         LintId::of(no_effect::NO_EFFECT),
1647         LintId::of(no_effect::UNNECESSARY_OPERATION),
1648         LintId::of(overflow_check_conditional::OVERFLOW_CHECK_CONDITIONAL),
1649         LintId::of(partialeq_ne_impl::PARTIALEQ_NE_IMPL),
1650         LintId::of(precedence::PRECEDENCE),
1651         LintId::of(ptr_offset_with_cast::PTR_OFFSET_WITH_CAST),
1652         LintId::of(ranges::RANGE_ZIP_WITH_LEN),
1653         LintId::of(redundant_closure_call::REDUNDANT_CLOSURE_CALL),
1654         LintId::of(redundant_slicing::REDUNDANT_SLICING),
1655         LintId::of(reference::DEREF_ADDROF),
1656         LintId::of(reference::REF_IN_DEREF),
1657         LintId::of(repeat_once::REPEAT_ONCE),
1658         LintId::of(strings::STRING_FROM_UTF8_AS_BYTES),
1659         LintId::of(strlen_on_c_strings::STRLEN_ON_C_STRINGS),
1660         LintId::of(swap::MANUAL_SWAP),
1661         LintId::of(temporary_assignment::TEMPORARY_ASSIGNMENT),
1662         LintId::of(transmute::CROSSPOINTER_TRANSMUTE),
1663         LintId::of(transmute::TRANSMUTES_EXPRESSIBLE_AS_PTR_CASTS),
1664         LintId::of(transmute::TRANSMUTE_BYTES_TO_STR),
1665         LintId::of(transmute::TRANSMUTE_FLOAT_TO_INT),
1666         LintId::of(transmute::TRANSMUTE_INT_TO_BOOL),
1667         LintId::of(transmute::TRANSMUTE_INT_TO_CHAR),
1668         LintId::of(transmute::TRANSMUTE_INT_TO_FLOAT),
1669         LintId::of(transmute::TRANSMUTE_PTR_TO_REF),
1670         LintId::of(types::BORROWED_BOX),
1671         LintId::of(types::TYPE_COMPLEXITY),
1672         LintId::of(types::VEC_BOX),
1673         LintId::of(unit_types::UNIT_ARG),
1674         LintId::of(unnecessary_sort_by::UNNECESSARY_SORT_BY),
1675         LintId::of(unwrap::UNNECESSARY_UNWRAP),
1676         LintId::of(useless_conversion::USELESS_CONVERSION),
1677         LintId::of(zero_div_zero::ZERO_DIVIDED_BY_ZERO),
1678     ]);
1679
1680     store.register_group(true, "clippy::correctness", Some("clippy_correctness"), vec![
1681         LintId::of(absurd_extreme_comparisons::ABSURD_EXTREME_COMPARISONS),
1682         LintId::of(approx_const::APPROX_CONSTANT),
1683         LintId::of(async_yields_async::ASYNC_YIELDS_ASYNC),
1684         LintId::of(atomic_ordering::INVALID_ATOMIC_ORDERING),
1685         LintId::of(attrs::DEPRECATED_SEMVER),
1686         LintId::of(attrs::MISMATCHED_TARGET_OS),
1687         LintId::of(attrs::USELESS_ATTRIBUTE),
1688         LintId::of(bit_mask::BAD_BIT_MASK),
1689         LintId::of(bit_mask::INEFFECTIVE_BIT_MASK),
1690         LintId::of(booleans::LOGIC_BUG),
1691         LintId::of(casts::CAST_REF_TO_MUT),
1692         LintId::of(copies::IFS_SAME_COND),
1693         LintId::of(copies::IF_SAME_THEN_ELSE),
1694         LintId::of(derive::DERIVE_HASH_XOR_EQ),
1695         LintId::of(derive::DERIVE_ORD_XOR_PARTIAL_ORD),
1696         LintId::of(drop_forget_ref::DROP_COPY),
1697         LintId::of(drop_forget_ref::DROP_REF),
1698         LintId::of(drop_forget_ref::FORGET_COPY),
1699         LintId::of(drop_forget_ref::FORGET_REF),
1700         LintId::of(enum_clike::ENUM_CLIKE_UNPORTABLE_VARIANT),
1701         LintId::of(eq_op::EQ_OP),
1702         LintId::of(erasing_op::ERASING_OP),
1703         LintId::of(formatting::POSSIBLE_MISSING_COMMA),
1704         LintId::of(functions::NOT_UNSAFE_PTR_ARG_DEREF),
1705         LintId::of(if_let_mutex::IF_LET_MUTEX),
1706         LintId::of(indexing_slicing::OUT_OF_BOUNDS_INDEXING),
1707         LintId::of(infinite_iter::INFINITE_ITER),
1708         LintId::of(inherent_to_string::INHERENT_TO_STRING_SHADOW_DISPLAY),
1709         LintId::of(inline_fn_without_body::INLINE_FN_WITHOUT_BODY),
1710         LintId::of(let_underscore::LET_UNDERSCORE_LOCK),
1711         LintId::of(literal_representation::MISTYPED_LITERAL_SUFFIXES),
1712         LintId::of(loops::ITER_NEXT_LOOP),
1713         LintId::of(loops::NEVER_LOOP),
1714         LintId::of(loops::WHILE_IMMUTABLE_CONDITION),
1715         LintId::of(mem_discriminant::MEM_DISCRIMINANT_NON_ENUM),
1716         LintId::of(mem_replace::MEM_REPLACE_WITH_UNINIT),
1717         LintId::of(methods::CLONE_DOUBLE_REF),
1718         LintId::of(methods::ITERATOR_STEP_BY_ZERO),
1719         LintId::of(methods::SUSPICIOUS_SPLITN),
1720         LintId::of(methods::UNINIT_ASSUMED_INIT),
1721         LintId::of(methods::ZST_OFFSET),
1722         LintId::of(minmax::MIN_MAX),
1723         LintId::of(misc::CMP_NAN),
1724         LintId::of(misc::FLOAT_CMP),
1725         LintId::of(misc::MODULO_ONE),
1726         LintId::of(non_octal_unix_permissions::NON_OCTAL_UNIX_PERMISSIONS),
1727         LintId::of(open_options::NONSENSICAL_OPEN_OPTIONS),
1728         LintId::of(option_env_unwrap::OPTION_ENV_UNWRAP),
1729         LintId::of(ptr::INVALID_NULL_PTR_USAGE),
1730         LintId::of(ptr::MUT_FROM_REF),
1731         LintId::of(ranges::REVERSED_EMPTY_RANGES),
1732         LintId::of(regex::INVALID_REGEX),
1733         LintId::of(self_assignment::SELF_ASSIGNMENT),
1734         LintId::of(serde_api::SERDE_API_MISUSE),
1735         LintId::of(size_of_in_element_count::SIZE_OF_IN_ELEMENT_COUNT),
1736         LintId::of(swap::ALMOST_SWAPPED),
1737         LintId::of(to_string_in_display::TO_STRING_IN_DISPLAY),
1738         LintId::of(transmute::UNSOUND_COLLECTION_TRANSMUTE),
1739         LintId::of(transmute::WRONG_TRANSMUTE),
1740         LintId::of(transmuting_null::TRANSMUTING_NULL),
1741         LintId::of(undropped_manually_drops::UNDROPPED_MANUALLY_DROPS),
1742         LintId::of(unicode::INVISIBLE_CHARACTERS),
1743         LintId::of(unit_return_expecting_ord::UNIT_RETURN_EXPECTING_ORD),
1744         LintId::of(unit_types::UNIT_CMP),
1745         LintId::of(unnamed_address::FN_ADDRESS_COMPARISONS),
1746         LintId::of(unnamed_address::VTABLE_ADDRESS_COMPARISONS),
1747         LintId::of(unused_io_amount::UNUSED_IO_AMOUNT),
1748         LintId::of(unwrap::PANICKING_UNWRAP),
1749         LintId::of(vec_resize_to_zero::VEC_RESIZE_TO_ZERO),
1750     ]);
1751
1752     store.register_group(true, "clippy::suspicious", None, vec![
1753         LintId::of(assign_ops::MISREFACTORED_ASSIGN_OP),
1754         LintId::of(attrs::BLANKET_CLIPPY_RESTRICTION_LINTS),
1755         LintId::of(eval_order_dependence::EVAL_ORDER_DEPENDENCE),
1756         LintId::of(float_equality_without_abs::FLOAT_EQUALITY_WITHOUT_ABS),
1757         LintId::of(formatting::SUSPICIOUS_ASSIGNMENT_FORMATTING),
1758         LintId::of(formatting::SUSPICIOUS_ELSE_FORMATTING),
1759         LintId::of(formatting::SUSPICIOUS_UNARY_OP_FORMATTING),
1760         LintId::of(loops::EMPTY_LOOP),
1761         LintId::of(loops::FOR_LOOPS_OVER_FALLIBLES),
1762         LintId::of(loops::MUT_RANGE_BOUND),
1763         LintId::of(methods::SUSPICIOUS_MAP),
1764         LintId::of(mut_key::MUTABLE_KEY_TYPE),
1765         LintId::of(suspicious_trait_impl::SUSPICIOUS_ARITHMETIC_IMPL),
1766         LintId::of(suspicious_trait_impl::SUSPICIOUS_OP_ASSIGN_IMPL),
1767     ]);
1768
1769     store.register_group(true, "clippy::perf", Some("clippy_perf"), vec![
1770         LintId::of(entry::MAP_ENTRY),
1771         LintId::of(escape::BOXED_LOCAL),
1772         LintId::of(large_const_arrays::LARGE_CONST_ARRAYS),
1773         LintId::of(large_enum_variant::LARGE_ENUM_VARIANT),
1774         LintId::of(loops::MANUAL_MEMCPY),
1775         LintId::of(loops::NEEDLESS_COLLECT),
1776         LintId::of(methods::EXPECT_FUN_CALL),
1777         LintId::of(methods::EXTEND_WITH_DRAIN),
1778         LintId::of(methods::ITER_NTH),
1779         LintId::of(methods::MANUAL_STR_REPEAT),
1780         LintId::of(methods::OR_FUN_CALL),
1781         LintId::of(methods::SINGLE_CHAR_PATTERN),
1782         LintId::of(misc::CMP_OWNED),
1783         LintId::of(mutex_atomic::MUTEX_ATOMIC),
1784         LintId::of(redundant_clone::REDUNDANT_CLONE),
1785         LintId::of(slow_vector_initialization::SLOW_VECTOR_INITIALIZATION),
1786         LintId::of(stable_sort_primitive::STABLE_SORT_PRIMITIVE),
1787         LintId::of(types::BOX_VEC),
1788         LintId::of(types::REDUNDANT_ALLOCATION),
1789         LintId::of(vec::USELESS_VEC),
1790         LintId::of(vec_init_then_push::VEC_INIT_THEN_PUSH),
1791     ]);
1792
1793     store.register_group(true, "clippy::cargo", Some("clippy_cargo"), vec![
1794         LintId::of(cargo_common_metadata::CARGO_COMMON_METADATA),
1795         LintId::of(feature_name::NEGATIVE_FEATURE_NAMES),
1796         LintId::of(feature_name::REDUNDANT_FEATURE_NAMES),
1797         LintId::of(multiple_crate_versions::MULTIPLE_CRATE_VERSIONS),
1798         LintId::of(wildcard_dependencies::WILDCARD_DEPENDENCIES),
1799     ]);
1800
1801     store.register_group(true, "clippy::nursery", Some("clippy_nursery"), vec![
1802         LintId::of(attrs::EMPTY_LINE_AFTER_OUTER_ATTR),
1803         LintId::of(cognitive_complexity::COGNITIVE_COMPLEXITY),
1804         LintId::of(copies::BRANCHES_SHARING_CODE),
1805         LintId::of(disallowed_method::DISALLOWED_METHOD),
1806         LintId::of(disallowed_type::DISALLOWED_TYPE),
1807         LintId::of(fallible_impl_from::FALLIBLE_IMPL_FROM),
1808         LintId::of(floating_point_arithmetic::IMPRECISE_FLOPS),
1809         LintId::of(floating_point_arithmetic::SUBOPTIMAL_FLOPS),
1810         LintId::of(future_not_send::FUTURE_NOT_SEND),
1811         LintId::of(let_if_seq::USELESS_LET_IF_SEQ),
1812         LintId::of(missing_const_for_fn::MISSING_CONST_FOR_FN),
1813         LintId::of(mutable_debug_assertion::DEBUG_ASSERT_WITH_MUT_CALL),
1814         LintId::of(mutex_atomic::MUTEX_INTEGER),
1815         LintId::of(nonstandard_macro_braces::NONSTANDARD_MACRO_BRACES),
1816         LintId::of(option_if_let_else::OPTION_IF_LET_ELSE),
1817         LintId::of(path_buf_push_overwrite::PATH_BUF_PUSH_OVERWRITE),
1818         LintId::of(redundant_pub_crate::REDUNDANT_PUB_CRATE),
1819         LintId::of(regex::TRIVIAL_REGEX),
1820         LintId::of(strings::STRING_LIT_AS_BYTES),
1821         LintId::of(suspicious_operation_groupings::SUSPICIOUS_OPERATION_GROUPINGS),
1822         LintId::of(transmute::USELESS_TRANSMUTE),
1823         LintId::of(use_self::USE_SELF),
1824     ]);
1825
1826     #[cfg(feature = "metadata-collector-lint")]
1827     {
1828         if std::env::var("ENABLE_METADATA_COLLECTION").eq(&Ok("1".to_string())) {
1829             store.register_late_pass(|| box utils::internal_lints::metadata_collector::MetadataCollector::new());
1830             return;
1831         }
1832     }
1833
1834     // all the internal lints
1835     #[cfg(feature = "internal-lints")]
1836     {
1837         store.register_early_pass(|| box utils::internal_lints::ClippyLintsInternal);
1838         store.register_early_pass(|| box utils::internal_lints::ProduceIce);
1839         store.register_late_pass(|| box utils::inspector::DeepCodeInspector);
1840         store.register_late_pass(|| box utils::internal_lints::CollapsibleCalls);
1841         store.register_late_pass(|| box utils::internal_lints::CompilerLintFunctions::new());
1842         store.register_late_pass(|| box utils::internal_lints::IfChainStyle);
1843         store.register_late_pass(|| box utils::internal_lints::InvalidPaths);
1844         store.register_late_pass(|| box utils::internal_lints::InterningDefinedSymbol::default());
1845         store.register_late_pass(|| box utils::internal_lints::LintWithoutLintPass::default());
1846         store.register_late_pass(|| box utils::internal_lints::MatchTypeOnDiagItem);
1847         store.register_late_pass(|| box utils::internal_lints::OuterExpnDataPass);
1848     }
1849
1850     store.register_late_pass(|| box utils::author::Author);
1851     store.register_late_pass(|| box await_holding_invalid::AwaitHolding);
1852     store.register_late_pass(|| box serde_api::SerdeApi);
1853     let vec_box_size_threshold = conf.vec_box_size_threshold;
1854     let type_complexity_threshold = conf.type_complexity_threshold;
1855     let avoid_breaking_exported_api = conf.avoid_breaking_exported_api;
1856     store.register_late_pass(move || box types::Types::new(
1857         vec_box_size_threshold,
1858         type_complexity_threshold,
1859         avoid_breaking_exported_api,
1860     ));
1861     store.register_late_pass(|| box booleans::NonminimalBool);
1862     store.register_late_pass(|| box needless_bitwise_bool::NeedlessBitwiseBool);
1863     store.register_late_pass(|| box eq_op::EqOp);
1864     store.register_late_pass(|| box enum_clike::UnportableVariant);
1865     store.register_late_pass(|| box float_literal::FloatLiteral);
1866     let verbose_bit_mask_threshold = conf.verbose_bit_mask_threshold;
1867     store.register_late_pass(move || box bit_mask::BitMask::new(verbose_bit_mask_threshold));
1868     store.register_late_pass(|| box ptr::Ptr);
1869     store.register_late_pass(|| box ptr_eq::PtrEq);
1870     store.register_late_pass(|| box needless_bool::NeedlessBool);
1871     store.register_late_pass(|| box needless_bool::BoolComparison);
1872     store.register_late_pass(|| box needless_for_each::NeedlessForEach);
1873     store.register_late_pass(|| box approx_const::ApproxConstant);
1874     store.register_late_pass(|| box misc::MiscLints);
1875     store.register_late_pass(|| box eta_reduction::EtaReduction);
1876     store.register_late_pass(|| box identity_op::IdentityOp);
1877     store.register_late_pass(|| box erasing_op::ErasingOp);
1878     store.register_late_pass(|| box mut_mut::MutMut);
1879     store.register_late_pass(|| box mut_reference::UnnecessaryMutPassed);
1880     store.register_late_pass(|| box len_zero::LenZero);
1881     store.register_late_pass(|| box attrs::Attributes);
1882     store.register_late_pass(|| box blocks_in_if_conditions::BlocksInIfConditions);
1883     store.register_late_pass(|| box collapsible_match::CollapsibleMatch);
1884     store.register_late_pass(|| box unicode::Unicode);
1885     store.register_late_pass(|| box unit_return_expecting_ord::UnitReturnExpectingOrd);
1886     store.register_late_pass(|| box strings::StringAdd);
1887     store.register_late_pass(|| box implicit_return::ImplicitReturn);
1888     store.register_late_pass(|| box implicit_saturating_sub::ImplicitSaturatingSub);
1889     store.register_late_pass(|| box default_numeric_fallback::DefaultNumericFallback);
1890     store.register_late_pass(|| box inconsistent_struct_constructor::InconsistentStructConstructor);
1891     store.register_late_pass(|| box non_octal_unix_permissions::NonOctalUnixPermissions);
1892     store.register_early_pass(|| box unnecessary_self_imports::UnnecessarySelfImports);
1893
1894     let msrv = conf.msrv.as_ref().and_then(|s| {
1895         parse_msrv(s, None, None).or_else(|| {
1896             sess.err(&format!("error reading Clippy's configuration file. `{}` is not a valid Rust version", s));
1897             None
1898         })
1899     });
1900
1901     let avoid_breaking_exported_api = conf.avoid_breaking_exported_api;
1902     store.register_late_pass(move || box methods::Methods::new(avoid_breaking_exported_api, msrv));
1903     store.register_late_pass(move || box matches::Matches::new(msrv));
1904     store.register_early_pass(move || box manual_non_exhaustive::ManualNonExhaustive::new(msrv));
1905     store.register_late_pass(move || box manual_strip::ManualStrip::new(msrv));
1906     store.register_early_pass(move || box redundant_static_lifetimes::RedundantStaticLifetimes::new(msrv));
1907     store.register_early_pass(move || box redundant_field_names::RedundantFieldNames::new(msrv));
1908     store.register_late_pass(move || box checked_conversions::CheckedConversions::new(msrv));
1909     store.register_late_pass(move || box mem_replace::MemReplace::new(msrv));
1910     store.register_late_pass(move || box ranges::Ranges::new(msrv));
1911     store.register_late_pass(move || box from_over_into::FromOverInto::new(msrv));
1912     store.register_late_pass(move || box use_self::UseSelf::new(msrv));
1913     store.register_late_pass(move || box missing_const_for_fn::MissingConstForFn::new(msrv));
1914     store.register_late_pass(move || box needless_question_mark::NeedlessQuestionMark);
1915     store.register_late_pass(move || box casts::Casts::new(msrv));
1916     store.register_early_pass(move || box unnested_or_patterns::UnnestedOrPatterns::new(msrv));
1917
1918     store.register_late_pass(|| box size_of_in_element_count::SizeOfInElementCount);
1919     store.register_late_pass(|| box map_clone::MapClone);
1920     store.register_late_pass(|| box map_err_ignore::MapErrIgnore);
1921     store.register_late_pass(|| box shadow::Shadow);
1922     store.register_late_pass(|| box unit_types::UnitTypes);
1923     store.register_late_pass(|| box loops::Loops);
1924     store.register_late_pass(|| box main_recursion::MainRecursion::default());
1925     store.register_late_pass(|| box lifetimes::Lifetimes);
1926     store.register_late_pass(|| box entry::HashMapPass);
1927     store.register_late_pass(|| box minmax::MinMaxPass);
1928     store.register_late_pass(|| box open_options::OpenOptions);
1929     store.register_late_pass(|| box zero_div_zero::ZeroDiv);
1930     store.register_late_pass(|| box mutex_atomic::Mutex);
1931     store.register_late_pass(|| box needless_update::NeedlessUpdate);
1932     store.register_late_pass(|| box needless_borrow::NeedlessBorrow::default());
1933     store.register_late_pass(|| box needless_borrowed_ref::NeedlessBorrowedRef);
1934     store.register_late_pass(|| box no_effect::NoEffect);
1935     store.register_late_pass(|| box temporary_assignment::TemporaryAssignment);
1936     store.register_late_pass(|| box transmute::Transmute);
1937     let cognitive_complexity_threshold = conf.cognitive_complexity_threshold;
1938     store.register_late_pass(move || box cognitive_complexity::CognitiveComplexity::new(cognitive_complexity_threshold));
1939     let too_large_for_stack = conf.too_large_for_stack;
1940     store.register_late_pass(move || box escape::BoxedLocal{too_large_for_stack});
1941     store.register_late_pass(move || box vec::UselessVec{too_large_for_stack});
1942     store.register_late_pass(|| box panic_unimplemented::PanicUnimplemented);
1943     store.register_late_pass(|| box strings::StringLitAsBytes);
1944     store.register_late_pass(|| box derive::Derive);
1945     store.register_late_pass(|| box get_last_with_len::GetLastWithLen);
1946     store.register_late_pass(|| box drop_forget_ref::DropForgetRef);
1947     store.register_late_pass(|| box empty_enum::EmptyEnum);
1948     store.register_late_pass(|| box absurd_extreme_comparisons::AbsurdExtremeComparisons);
1949     store.register_late_pass(|| box invalid_upcast_comparisons::InvalidUpcastComparisons);
1950     store.register_late_pass(|| box regex::Regex::default());
1951     store.register_late_pass(|| box copies::CopyAndPaste);
1952     store.register_late_pass(|| box copy_iterator::CopyIterator);
1953     store.register_late_pass(|| box format::UselessFormat);
1954     store.register_late_pass(|| box swap::Swap);
1955     store.register_late_pass(|| box overflow_check_conditional::OverflowCheckConditional);
1956     store.register_late_pass(|| box new_without_default::NewWithoutDefault::default());
1957     let blacklisted_names = conf.blacklisted_names.iter().cloned().collect::<FxHashSet<_>>();
1958     store.register_late_pass(move || box blacklisted_name::BlacklistedName::new(blacklisted_names.clone()));
1959     let too_many_arguments_threshold = conf.too_many_arguments_threshold;
1960     let too_many_lines_threshold = conf.too_many_lines_threshold;
1961     store.register_late_pass(move || box functions::Functions::new(too_many_arguments_threshold, too_many_lines_threshold));
1962     let doc_valid_idents = conf.doc_valid_idents.iter().cloned().collect::<FxHashSet<_>>();
1963     store.register_late_pass(move || box doc::DocMarkdown::new(doc_valid_idents.clone()));
1964     store.register_late_pass(|| box neg_multiply::NegMultiply);
1965     store.register_late_pass(|| box mem_discriminant::MemDiscriminant);
1966     store.register_late_pass(|| box mem_forget::MemForget);
1967     store.register_late_pass(|| box arithmetic::Arithmetic::default());
1968     store.register_late_pass(|| box assign_ops::AssignOps);
1969     store.register_late_pass(|| box let_if_seq::LetIfSeq);
1970     store.register_late_pass(|| box eval_order_dependence::EvalOrderDependence);
1971     store.register_late_pass(|| box missing_doc::MissingDoc::new());
1972     store.register_late_pass(|| box missing_inline::MissingInline);
1973     store.register_late_pass(move || box exhaustive_items::ExhaustiveItems);
1974     store.register_late_pass(|| box if_let_some_result::OkIfLet);
1975     store.register_late_pass(|| box partialeq_ne_impl::PartialEqNeImpl);
1976     store.register_late_pass(|| box unused_io_amount::UnusedIoAmount);
1977     let enum_variant_size_threshold = conf.enum_variant_size_threshold;
1978     store.register_late_pass(move || box large_enum_variant::LargeEnumVariant::new(enum_variant_size_threshold));
1979     store.register_late_pass(|| box explicit_write::ExplicitWrite);
1980     store.register_late_pass(|| box needless_pass_by_value::NeedlessPassByValue);
1981     let pass_by_ref_or_value = pass_by_ref_or_value::PassByRefOrValue::new(
1982         conf.trivial_copy_size_limit,
1983         conf.pass_by_value_size_limit,
1984         conf.avoid_breaking_exported_api,
1985         &sess.target,
1986     );
1987     store.register_late_pass(move || box pass_by_ref_or_value);
1988     store.register_late_pass(|| box ref_option_ref::RefOptionRef);
1989     store.register_late_pass(|| box try_err::TryErr);
1990     store.register_late_pass(|| box bytecount::ByteCount);
1991     store.register_late_pass(|| box infinite_iter::InfiniteIter);
1992     store.register_late_pass(|| box inline_fn_without_body::InlineFnWithoutBody);
1993     store.register_late_pass(|| box useless_conversion::UselessConversion::default());
1994     store.register_late_pass(|| box implicit_hasher::ImplicitHasher);
1995     store.register_late_pass(|| box fallible_impl_from::FallibleImplFrom);
1996     store.register_late_pass(|| box double_comparison::DoubleComparisons);
1997     store.register_late_pass(|| box question_mark::QuestionMark);
1998     store.register_early_pass(|| box suspicious_operation_groupings::SuspiciousOperationGroupings);
1999     store.register_late_pass(|| box suspicious_trait_impl::SuspiciousImpl);
2000     store.register_late_pass(|| box map_unit_fn::MapUnit);
2001     store.register_late_pass(|| box inherent_impl::MultipleInherentImpl);
2002     store.register_late_pass(|| box neg_cmp_op_on_partial_ord::NoNegCompOpForPartialOrd);
2003     store.register_late_pass(|| box unwrap::Unwrap);
2004     store.register_late_pass(|| box duration_subsec::DurationSubsec);
2005     store.register_late_pass(|| box indexing_slicing::IndexingSlicing);
2006     store.register_late_pass(|| box non_copy_const::NonCopyConst);
2007     store.register_late_pass(|| box ptr_offset_with_cast::PtrOffsetWithCast);
2008     store.register_late_pass(|| box redundant_clone::RedundantClone);
2009     store.register_late_pass(|| box slow_vector_initialization::SlowVectorInit);
2010     store.register_late_pass(|| box unnecessary_sort_by::UnnecessarySortBy);
2011     store.register_late_pass(move || box unnecessary_wraps::UnnecessaryWraps::new(avoid_breaking_exported_api));
2012     store.register_late_pass(|| box assertions_on_constants::AssertionsOnConstants);
2013     store.register_late_pass(|| box transmuting_null::TransmutingNull);
2014     store.register_late_pass(|| box path_buf_push_overwrite::PathBufPushOverwrite);
2015     store.register_late_pass(|| box integer_division::IntegerDivision);
2016     store.register_late_pass(|| box inherent_to_string::InherentToString);
2017     let max_trait_bounds = conf.max_trait_bounds;
2018     store.register_late_pass(move || box trait_bounds::TraitBounds::new(max_trait_bounds));
2019     store.register_late_pass(|| box comparison_chain::ComparisonChain);
2020     store.register_late_pass(|| box mut_key::MutableKeyType);
2021     store.register_late_pass(|| box modulo_arithmetic::ModuloArithmetic);
2022     store.register_early_pass(|| box reference::DerefAddrOf);
2023     store.register_early_pass(|| box reference::RefInDeref);
2024     store.register_early_pass(|| box double_parens::DoubleParens);
2025     store.register_late_pass(|| box to_string_in_display::ToStringInDisplay::new());
2026     store.register_early_pass(|| box unsafe_removed_from_name::UnsafeNameRemoval);
2027     store.register_early_pass(|| box if_not_else::IfNotElse);
2028     store.register_early_pass(|| box else_if_without_else::ElseIfWithoutElse);
2029     store.register_early_pass(|| box int_plus_one::IntPlusOne);
2030     store.register_early_pass(|| box formatting::Formatting);
2031     store.register_early_pass(|| box misc_early::MiscEarlyLints);
2032     store.register_early_pass(|| box redundant_closure_call::RedundantClosureCall);
2033     store.register_late_pass(|| box redundant_closure_call::RedundantClosureCall);
2034     store.register_early_pass(|| box unused_unit::UnusedUnit);
2035     store.register_late_pass(|| box returns::Return);
2036     store.register_early_pass(|| box collapsible_if::CollapsibleIf);
2037     store.register_early_pass(|| box items_after_statements::ItemsAfterStatements);
2038     store.register_early_pass(|| box precedence::Precedence);
2039     store.register_early_pass(|| box needless_continue::NeedlessContinue);
2040     store.register_early_pass(|| box redundant_else::RedundantElse);
2041     store.register_late_pass(|| box create_dir::CreateDir);
2042     store.register_early_pass(|| box needless_arbitrary_self_type::NeedlessArbitrarySelfType);
2043     let cargo_ignore_publish = conf.cargo_ignore_publish;
2044     store.register_late_pass(move || box cargo_common_metadata::CargoCommonMetadata::new(cargo_ignore_publish));
2045     store.register_late_pass(|| box multiple_crate_versions::MultipleCrateVersions);
2046     store.register_late_pass(|| box wildcard_dependencies::WildcardDependencies);
2047     let literal_representation_lint_fraction_readability = conf.unreadable_literal_lint_fractions;
2048     store.register_early_pass(move || box literal_representation::LiteralDigitGrouping::new(literal_representation_lint_fraction_readability));
2049     let literal_representation_threshold = conf.literal_representation_threshold;
2050     store.register_early_pass(move || box literal_representation::DecimalLiteralRepresentation::new(literal_representation_threshold));
2051     let enum_variant_name_threshold = conf.enum_variant_name_threshold;
2052     store.register_late_pass(move || box enum_variants::EnumVariantNames::new(enum_variant_name_threshold, avoid_breaking_exported_api));
2053     store.register_early_pass(|| box tabs_in_doc_comments::TabsInDocComments);
2054     let upper_case_acronyms_aggressive = conf.upper_case_acronyms_aggressive;
2055     store.register_late_pass(move || box upper_case_acronyms::UpperCaseAcronyms::new(avoid_breaking_exported_api, upper_case_acronyms_aggressive));
2056     store.register_late_pass(|| box default::Default::default());
2057     store.register_late_pass(|| box unused_self::UnusedSelf);
2058     store.register_late_pass(|| box mutable_debug_assertion::DebugAssertWithMutCall);
2059     store.register_late_pass(|| box exit::Exit);
2060     store.register_late_pass(|| box to_digit_is_some::ToDigitIsSome);
2061     let array_size_threshold = conf.array_size_threshold;
2062     store.register_late_pass(move || box large_stack_arrays::LargeStackArrays::new(array_size_threshold));
2063     store.register_late_pass(move || box large_const_arrays::LargeConstArrays::new(array_size_threshold));
2064     store.register_late_pass(|| box floating_point_arithmetic::FloatingPointArithmetic);
2065     store.register_early_pass(|| box as_conversions::AsConversions);
2066     store.register_late_pass(|| box let_underscore::LetUnderscore);
2067     store.register_late_pass(|| box atomic_ordering::AtomicOrdering);
2068     store.register_early_pass(|| box single_component_path_imports::SingleComponentPathImports);
2069     let max_fn_params_bools = conf.max_fn_params_bools;
2070     let max_struct_bools = conf.max_struct_bools;
2071     store.register_early_pass(move || box excessive_bools::ExcessiveBools::new(max_struct_bools, max_fn_params_bools));
2072     store.register_early_pass(|| box option_env_unwrap::OptionEnvUnwrap);
2073     let warn_on_all_wildcard_imports = conf.warn_on_all_wildcard_imports;
2074     store.register_late_pass(move || box wildcard_imports::WildcardImports::new(warn_on_all_wildcard_imports));
2075     store.register_late_pass(|| box verbose_file_reads::VerboseFileReads);
2076     store.register_late_pass(|| box redundant_pub_crate::RedundantPubCrate::default());
2077     store.register_late_pass(|| box unnamed_address::UnnamedAddress);
2078     store.register_late_pass(|| box dereference::Dereferencing::default());
2079     store.register_late_pass(|| box option_if_let_else::OptionIfLetElse);
2080     store.register_late_pass(|| box future_not_send::FutureNotSend);
2081     store.register_late_pass(|| box if_let_mutex::IfLetMutex);
2082     store.register_late_pass(|| box mut_mutex_lock::MutMutexLock);
2083     store.register_late_pass(|| box match_on_vec_items::MatchOnVecItems);
2084     store.register_late_pass(|| box manual_async_fn::ManualAsyncFn);
2085     store.register_late_pass(|| box vec_resize_to_zero::VecResizeToZero);
2086     store.register_late_pass(|| box panic_in_result_fn::PanicInResultFn);
2087     let single_char_binding_names_threshold = conf.single_char_binding_names_threshold;
2088     store.register_early_pass(move || box non_expressive_names::NonExpressiveNames {
2089         single_char_binding_names_threshold,
2090     });
2091     let macro_matcher = conf.standard_macro_braces.iter().cloned().collect::<FxHashSet<_>>();
2092     store.register_early_pass(move || box nonstandard_macro_braces::MacroBraces::new(&macro_matcher));
2093     store.register_late_pass(|| box macro_use::MacroUseImports::default());
2094     store.register_late_pass(|| box pattern_type_mismatch::PatternTypeMismatch);
2095     store.register_late_pass(|| box stable_sort_primitive::StableSortPrimitive);
2096     store.register_late_pass(|| box repeat_once::RepeatOnce);
2097     store.register_late_pass(|| box unwrap_in_result::UnwrapInResult);
2098     store.register_late_pass(|| box self_assignment::SelfAssignment);
2099     store.register_late_pass(|| box manual_unwrap_or::ManualUnwrapOr);
2100     store.register_late_pass(|| box manual_ok_or::ManualOkOr);
2101     store.register_late_pass(|| box float_equality_without_abs::FloatEqualityWithoutAbs);
2102     store.register_late_pass(|| box semicolon_if_nothing_returned::SemicolonIfNothingReturned);
2103     store.register_late_pass(|| box async_yields_async::AsyncYieldsAsync);
2104     let disallowed_methods = conf.disallowed_methods.iter().cloned().collect::<FxHashSet<_>>();
2105     store.register_late_pass(move || box disallowed_method::DisallowedMethod::new(&disallowed_methods));
2106     store.register_early_pass(|| box asm_syntax::InlineAsmX86AttSyntax);
2107     store.register_early_pass(|| box asm_syntax::InlineAsmX86IntelSyntax);
2108     store.register_late_pass(|| box undropped_manually_drops::UndroppedManuallyDrops);
2109     store.register_late_pass(|| box strings::StrToString);
2110     store.register_late_pass(|| box strings::StringToString);
2111     store.register_late_pass(|| box zero_sized_map_values::ZeroSizedMapValues);
2112     store.register_late_pass(|| box vec_init_then_push::VecInitThenPush::default());
2113     store.register_late_pass(|| box case_sensitive_file_extension_comparisons::CaseSensitiveFileExtensionComparisons);
2114     store.register_late_pass(|| box redundant_slicing::RedundantSlicing);
2115     store.register_late_pass(|| box from_str_radix_10::FromStrRadix10);
2116     store.register_late_pass(|| box manual_map::ManualMap);
2117     store.register_late_pass(move || box if_then_some_else_none::IfThenSomeElseNone::new(msrv));
2118     store.register_late_pass(|| box bool_assert_comparison::BoolAssertComparison);
2119     store.register_early_pass(move || box module_style::ModStyle);
2120     store.register_late_pass(|| box unused_async::UnusedAsync);
2121     let disallowed_types = conf.disallowed_types.iter().cloned().collect::<FxHashSet<_>>();
2122     store.register_late_pass(move || box disallowed_type::DisallowedType::new(&disallowed_types));
2123     let import_renames = conf.enforced_import_renames.clone();
2124     store.register_late_pass(move || box missing_enforced_import_rename::ImportRename::new(import_renames.clone()));
2125     let scripts = conf.allowed_scripts.clone();
2126     store.register_early_pass(move || box disallowed_script_idents::DisallowedScriptIdents::new(&scripts));
2127     store.register_late_pass(|| box strlen_on_c_strings::StrlenOnCStrings);
2128     store.register_late_pass(move || box self_named_constructors::SelfNamedConstructors);
2129     store.register_late_pass(move || box feature_name::FeatureName);
2130 }
2131
2132 #[rustfmt::skip]
2133 fn register_removed_non_tool_lints(store: &mut rustc_lint::LintStore) {
2134     store.register_removed(
2135         "should_assert_eq",
2136         "`assert!()` will be more flexible with RFC 2011",
2137     );
2138     store.register_removed(
2139         "extend_from_slice",
2140         "`.extend_from_slice(_)` is a faster way to extend a Vec by a slice",
2141     );
2142     store.register_removed(
2143         "range_step_by_zero",
2144         "`iterator.step_by(0)` panics nowadays",
2145     );
2146     store.register_removed(
2147         "unstable_as_slice",
2148         "`Vec::as_slice` has been stabilized in 1.7",
2149     );
2150     store.register_removed(
2151         "unstable_as_mut_slice",
2152         "`Vec::as_mut_slice` has been stabilized in 1.7",
2153     );
2154     store.register_removed(
2155         "misaligned_transmute",
2156         "this lint has been split into cast_ptr_alignment and transmute_ptr_to_ptr",
2157     );
2158     store.register_removed(
2159         "assign_ops",
2160         "using compound assignment operators (e.g., `+=`) is harmless",
2161     );
2162     store.register_removed(
2163         "if_let_redundant_pattern_matching",
2164         "this lint has been changed to redundant_pattern_matching",
2165     );
2166     store.register_removed(
2167         "unsafe_vector_initialization",
2168         "the replacement suggested by this lint had substantially different behavior",
2169     );
2170     store.register_removed(
2171         "reverse_range_loop",
2172         "this lint is now included in reversed_empty_ranges",
2173     );
2174 }
2175
2176 /// Register renamed lints.
2177 ///
2178 /// Used in `./src/driver.rs`.
2179 pub fn register_renamed(ls: &mut rustc_lint::LintStore) {
2180     ls.register_renamed("clippy::stutter", "clippy::module_name_repetitions");
2181     ls.register_renamed("clippy::new_without_default_derive", "clippy::new_without_default");
2182     ls.register_renamed("clippy::cyclomatic_complexity", "clippy::cognitive_complexity");
2183     ls.register_renamed("clippy::const_static_lifetime", "clippy::redundant_static_lifetimes");
2184     ls.register_renamed("clippy::option_and_then_some", "clippy::bind_instead_of_map");
2185     ls.register_renamed("clippy::block_in_if_condition_expr", "clippy::blocks_in_if_conditions");
2186     ls.register_renamed("clippy::block_in_if_condition_stmt", "clippy::blocks_in_if_conditions");
2187     ls.register_renamed("clippy::option_map_unwrap_or", "clippy::map_unwrap_or");
2188     ls.register_renamed("clippy::option_map_unwrap_or_else", "clippy::map_unwrap_or");
2189     ls.register_renamed("clippy::result_map_unwrap_or_else", "clippy::map_unwrap_or");
2190     ls.register_renamed("clippy::option_unwrap_used", "clippy::unwrap_used");
2191     ls.register_renamed("clippy::result_unwrap_used", "clippy::unwrap_used");
2192     ls.register_renamed("clippy::option_expect_used", "clippy::expect_used");
2193     ls.register_renamed("clippy::result_expect_used", "clippy::expect_used");
2194     ls.register_renamed("clippy::for_loop_over_option", "clippy::for_loops_over_fallibles");
2195     ls.register_renamed("clippy::for_loop_over_result", "clippy::for_loops_over_fallibles");
2196     ls.register_renamed("clippy::identity_conversion", "clippy::useless_conversion");
2197     ls.register_renamed("clippy::zero_width_space", "clippy::invisible_characters");
2198     ls.register_renamed("clippy::single_char_push_str", "clippy::single_char_add_str");
2199
2200     // uplifted lints
2201     ls.register_renamed("clippy::invalid_ref", "invalid_value");
2202     ls.register_renamed("clippy::into_iter_on_array", "array_into_iter");
2203     ls.register_renamed("clippy::unused_label", "unused_labels");
2204     ls.register_renamed("clippy::drop_bounds", "drop_bounds");
2205     ls.register_renamed("clippy::temporary_cstring_as_ptr", "temporary_cstring_as_ptr");
2206     ls.register_renamed("clippy::panic_params", "non_fmt_panics");
2207     ls.register_renamed("clippy::unknown_clippy_lints", "unknown_lints");
2208 }
2209
2210 // only exists to let the dogfood integration test works.
2211 // Don't run clippy as an executable directly
2212 #[allow(dead_code)]
2213 fn main() {
2214     panic!("Please use the cargo-clippy executable");
2215 }