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