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