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