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