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