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