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