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