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