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