]> git.lizzy.rs Git - rust.git/blob - clippy_lints/src/lib.rs
Merge commit '7ea7cd165ad6705603852771bf82cc2fd6560db5' into clippyup2
[rust.git] / clippy_lints / src / lib.rs
1 // error-pattern:cargo-clippy
2
3 #![feature(box_syntax)]
4 #![feature(box_patterns)]
5 #![feature(or_patterns)]
6 #![feature(rustc_private)]
7 #![feature(stmt_expr_attributes)]
8 #![allow(clippy::missing_docs_in_private_items, clippy::must_use_candidate)]
9 #![recursion_limit = "512"]
10 #![warn(rust_2018_idioms, trivial_casts, trivial_numeric_casts)]
11 #![deny(rustc::internal)]
12 #![cfg_attr(feature = "deny-warnings", deny(warnings))]
13 #![feature(crate_visibility_modifier)]
14 #![feature(concat_idents)]
15
16 // FIXME: switch to something more ergonomic here, once available.
17 // (Currently there is no way to opt into sysroot crates without `extern crate`.)
18 #[allow(unused_extern_crates)]
19 extern crate fmt_macros;
20 #[allow(unused_extern_crates)]
21 extern crate rustc_ast;
22 #[allow(unused_extern_crates)]
23 extern crate rustc_ast_pretty;
24 #[allow(unused_extern_crates)]
25 extern crate rustc_attr;
26 #[allow(unused_extern_crates)]
27 extern crate rustc_data_structures;
28 #[allow(unused_extern_crates)]
29 extern crate rustc_driver;
30 #[allow(unused_extern_crates)]
31 extern crate rustc_errors;
32 #[allow(unused_extern_crates)]
33 extern crate rustc_hir;
34 #[allow(unused_extern_crates)]
35 extern crate rustc_hir_pretty;
36 #[allow(unused_extern_crates)]
37 extern crate rustc_index;
38 #[allow(unused_extern_crates)]
39 extern crate rustc_infer;
40 #[allow(unused_extern_crates)]
41 extern crate rustc_lexer;
42 #[allow(unused_extern_crates)]
43 extern crate rustc_lint;
44 #[allow(unused_extern_crates)]
45 extern crate rustc_middle;
46 #[allow(unused_extern_crates)]
47 extern crate rustc_mir;
48 #[allow(unused_extern_crates)]
49 extern crate rustc_parse;
50 #[allow(unused_extern_crates)]
51 extern crate rustc_session;
52 #[allow(unused_extern_crates)]
53 extern crate rustc_span;
54 #[allow(unused_extern_crates)]
55 extern crate rustc_target;
56 #[allow(unused_extern_crates)]
57 extern crate rustc_trait_selection;
58 #[allow(unused_extern_crates)]
59 extern crate rustc_typeck;
60
61 use rustc_data_structures::fx::FxHashSet;
62 use rustc_lint::LintId;
63 use rustc_session::Session;
64
65 /// Macro used to declare a Clippy lint.
66 ///
67 /// Every lint declaration consists of 4 parts:
68 ///
69 /// 1. The documentation, which is used for the website
70 /// 2. The `LINT_NAME`. See [lint naming][lint_naming] on lint naming conventions.
71 /// 3. The `lint_level`, which is a mapping from *one* of our lint groups to `Allow`, `Warn` or
72 ///    `Deny`. The lint level here has nothing to do with what lint groups the lint is a part of.
73 /// 4. The `description` that contains a short explanation on what's wrong with code where the
74 ///    lint is triggered.
75 ///
76 /// Currently the categories `style`, `correctness`, `complexity` and `perf` are enabled by default.
77 /// As said in the README.md of this repository, if the lint level mapping changes, please update
78 /// README.md.
79 ///
80 /// # Example
81 ///
82 /// ```
83 /// # #![feature(rustc_private)]
84 /// # #[allow(unused_extern_crates)]
85 /// # extern crate rustc_middle;
86 /// # #[allow(unused_extern_crates)]
87 /// # extern crate rustc_session;
88 /// # #[macro_use]
89 /// # use clippy_lints::declare_clippy_lint;
90 /// use rustc_session::declare_tool_lint;
91 ///
92 /// declare_clippy_lint! {
93 ///     /// **What it does:** Checks for ... (describe what the lint matches).
94 ///     ///
95 ///     /// **Why is this bad?** Supply the reason for linting the code.
96 ///     ///
97 ///     /// **Known problems:** None. (Or describe where it could go wrong.)
98 ///     ///
99 ///     /// **Example:**
100 ///     ///
101 ///     /// ```rust
102 ///     /// // Bad
103 ///     /// Insert a short example of code that triggers the lint
104 ///     ///
105 ///     /// // Good
106 ///     /// Insert a short example of improved code that doesn't trigger the lint
107 ///     /// ```
108 ///     pub LINT_NAME,
109 ///     pedantic,
110 ///     "description"
111 /// }
112 /// ```
113 /// [lint_naming]: https://rust-lang.github.io/rfcs/0344-conventions-galore.html#lints
114 #[macro_export]
115 macro_rules! declare_clippy_lint {
116     { $(#[$attr:meta])* pub $name:tt, style, $description:tt } => {
117         declare_tool_lint! {
118             $(#[$attr])* pub clippy::$name, Warn, $description, report_in_external_macro: true
119         }
120     };
121     { $(#[$attr:meta])* pub $name:tt, correctness, $description:tt } => {
122         declare_tool_lint! {
123             $(#[$attr])* pub clippy::$name, Deny, $description, report_in_external_macro: true
124         }
125     };
126     { $(#[$attr:meta])* pub $name:tt, complexity, $description:tt } => {
127         declare_tool_lint! {
128             $(#[$attr])* pub clippy::$name, Warn, $description, report_in_external_macro: true
129         }
130     };
131     { $(#[$attr:meta])* pub $name:tt, perf, $description:tt } => {
132         declare_tool_lint! {
133             $(#[$attr])* pub clippy::$name, Warn, $description, report_in_external_macro: true
134         }
135     };
136     { $(#[$attr:meta])* pub $name:tt, pedantic, $description:tt } => {
137         declare_tool_lint! {
138             $(#[$attr])* pub clippy::$name, Allow, $description, report_in_external_macro: true
139         }
140     };
141     { $(#[$attr:meta])* pub $name:tt, restriction, $description:tt } => {
142         declare_tool_lint! {
143             $(#[$attr])* pub clippy::$name, Allow, $description, report_in_external_macro: true
144         }
145     };
146     { $(#[$attr:meta])* pub $name:tt, cargo, $description:tt } => {
147         declare_tool_lint! {
148             $(#[$attr])* pub clippy::$name, Allow, $description, report_in_external_macro: true
149         }
150     };
151     { $(#[$attr:meta])* pub $name:tt, nursery, $description:tt } => {
152         declare_tool_lint! {
153             $(#[$attr])* pub clippy::$name, Allow, $description, report_in_external_macro: true
154         }
155     };
156     { $(#[$attr:meta])* pub $name:tt, internal, $description:tt } => {
157         declare_tool_lint! {
158             $(#[$attr])* pub clippy::$name, Allow, $description, report_in_external_macro: true
159         }
160     };
161     { $(#[$attr:meta])* pub $name:tt, internal_warn, $description:tt } => {
162         declare_tool_lint! {
163             $(#[$attr])* pub clippy::$name, Warn, $description, report_in_external_macro: true
164         }
165     };
166 }
167
168 mod consts;
169 #[macro_use]
170 mod utils;
171
172 // begin lints modules, do not remove this comment, it’s used in `update_lints`
173 mod approx_const;
174 mod arithmetic;
175 mod as_conversions;
176 mod assertions_on_constants;
177 mod assign_ops;
178 mod atomic_ordering;
179 mod attrs;
180 mod await_holding_lock;
181 mod bit_mask;
182 mod blacklisted_name;
183 mod blocks_in_if_conditions;
184 mod booleans;
185 mod bytecount;
186 mod cargo_common_metadata;
187 mod checked_conversions;
188 mod cognitive_complexity;
189 mod collapsible_if;
190 mod comparison_chain;
191 mod copies;
192 mod copy_iterator;
193 mod dbg_macro;
194 mod default_trait_access;
195 mod dereference;
196 mod derive;
197 mod doc;
198 mod double_comparison;
199 mod double_parens;
200 mod drop_bounds;
201 mod drop_forget_ref;
202 mod duration_subsec;
203 mod else_if_without_else;
204 mod empty_enum;
205 mod entry;
206 mod enum_clike;
207 mod enum_variants;
208 mod eq_op;
209 mod erasing_op;
210 mod escape;
211 mod eta_reduction;
212 mod eval_order_dependence;
213 mod excessive_bools;
214 mod exit;
215 mod explicit_write;
216 mod fallible_impl_from;
217 mod float_literal;
218 mod floating_point_arithmetic;
219 mod format;
220 mod formatting;
221 mod functions;
222 mod future_not_send;
223 mod get_last_with_len;
224 mod identity_op;
225 mod if_let_mutex;
226 mod if_let_some_result;
227 mod if_not_else;
228 mod implicit_return;
229 mod implicit_saturating_sub;
230 mod indexing_slicing;
231 mod infinite_iter;
232 mod inherent_impl;
233 mod inherent_to_string;
234 mod inline_fn_without_body;
235 mod int_plus_one;
236 mod integer_division;
237 mod items_after_statements;
238 mod large_const_arrays;
239 mod large_enum_variant;
240 mod large_stack_arrays;
241 mod len_zero;
242 mod let_if_seq;
243 mod let_underscore;
244 mod lifetimes;
245 mod literal_representation;
246 mod loops;
247 mod macro_use;
248 mod main_recursion;
249 mod manual_async_fn;
250 mod manual_non_exhaustive;
251 mod map_clone;
252 mod map_unit_fn;
253 mod match_on_vec_items;
254 mod matches;
255 mod mem_discriminant;
256 mod mem_forget;
257 mod mem_replace;
258 mod methods;
259 mod minmax;
260 mod misc;
261 mod misc_early;
262 mod missing_const_for_fn;
263 mod missing_doc;
264 mod missing_inline;
265 mod modulo_arithmetic;
266 mod multiple_crate_versions;
267 mod mut_key;
268 mod mut_mut;
269 mod mut_reference;
270 mod mutable_debug_assertion;
271 mod mutex_atomic;
272 mod needless_bool;
273 mod needless_borrow;
274 mod needless_borrowed_ref;
275 mod needless_continue;
276 mod needless_pass_by_value;
277 mod needless_update;
278 mod neg_cmp_op_on_partial_ord;
279 mod neg_multiply;
280 mod new_without_default;
281 mod no_effect;
282 mod non_copy_const;
283 mod non_expressive_names;
284 mod open_options;
285 mod option_env_unwrap;
286 mod overflow_check_conditional;
287 mod panic_unimplemented;
288 mod partialeq_ne_impl;
289 mod path_buf_push_overwrite;
290 mod precedence;
291 mod ptr;
292 mod ptr_offset_with_cast;
293 mod question_mark;
294 mod ranges;
295 mod redundant_clone;
296 mod redundant_field_names;
297 mod redundant_pattern_matching;
298 mod redundant_pub_crate;
299 mod redundant_static_lifetimes;
300 mod reference;
301 mod regex;
302 mod returns;
303 mod serde_api;
304 mod shadow;
305 mod single_component_path_imports;
306 mod slow_vector_initialization;
307 mod strings;
308 mod suspicious_trait_impl;
309 mod swap;
310 mod tabs_in_doc_comments;
311 mod temporary_assignment;
312 mod to_digit_is_some;
313 mod trait_bounds;
314 mod transmute;
315 mod transmuting_null;
316 mod trivially_copy_pass_by_ref;
317 mod try_err;
318 mod types;
319 mod unicode;
320 mod unnamed_address;
321 mod unsafe_removed_from_name;
322 mod unused_io_amount;
323 mod unused_self;
324 mod unwrap;
325 mod use_self;
326 mod useless_conversion;
327 mod vec;
328 mod verbose_file_reads;
329 mod wildcard_dependencies;
330 mod wildcard_imports;
331 mod write;
332 mod zero_div_zero;
333 // end lints modules, do not remove this comment, it’s used in `update_lints`
334
335 pub use crate::utils::conf::Conf;
336
337 mod reexport {
338     pub use rustc_span::Symbol as Name;
339 }
340
341 /// Register all pre expansion lints
342 ///
343 /// Pre-expansion lints run before any macro expansion has happened.
344 ///
345 /// Note that due to the architecture of the compiler, currently `cfg_attr` attributes on crate
346 /// level (i.e `#![cfg_attr(...)]`) will still be expanded even when using a pre-expansion pass.
347 ///
348 /// Used in `./src/driver.rs`.
349 pub fn register_pre_expansion_lints(store: &mut rustc_lint::LintStore) {
350     store.register_pre_expansion_pass(|| box write::Write::default());
351     store.register_pre_expansion_pass(|| box attrs::EarlyAttributes);
352     store.register_pre_expansion_pass(|| box dbg_macro::DbgMacro);
353 }
354
355 #[doc(hidden)]
356 pub fn read_conf(args: &[rustc_ast::ast::NestedMetaItem], sess: &Session) -> Conf {
357     use std::path::Path;
358     match utils::conf::file_from_args(args) {
359         Ok(file_name) => {
360             // if the user specified a file, it must exist, otherwise default to `clippy.toml` but
361             // do not require the file to exist
362             let file_name = match file_name {
363                 Some(file_name) => file_name,
364                 None => match utils::conf::lookup_conf_file() {
365                     Ok(Some(path)) => path,
366                     Ok(None) => return Conf::default(),
367                     Err(error) => {
368                         sess.struct_err(&format!("error finding Clippy's configuration file: {}", error))
369                             .emit();
370                         return Conf::default();
371                     },
372                 },
373             };
374
375             let file_name = if file_name.is_relative() {
376                 sess.local_crate_source_file
377                     .as_deref()
378                     .and_then(Path::parent)
379                     .unwrap_or_else(|| Path::new(""))
380                     .join(file_name)
381             } else {
382                 file_name
383             };
384
385             let (conf, errors) = utils::conf::read(&file_name);
386
387             // all conf errors are non-fatal, we just use the default conf in case of error
388             for error in errors {
389                 sess.struct_err(&format!(
390                     "error reading Clippy's configuration file `{}`: {}",
391                     file_name.display(),
392                     error
393                 ))
394                 .emit();
395             }
396
397             conf
398         },
399         Err((err, span)) => {
400             sess.struct_span_err(span, err)
401                 .span_note(span, "Clippy will use default configuration")
402                 .emit();
403             Conf::default()
404         },
405     }
406 }
407
408 /// Register all lints and lint groups with the rustc plugin registry
409 ///
410 /// Used in `./src/driver.rs`.
411 #[allow(clippy::too_many_lines)]
412 #[rustfmt::skip]
413 pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf: &Conf) {
414     register_removed_non_tool_lints(store);
415
416     // begin deprecated lints, do not remove this comment, it’s used in `update_lints`
417     store.register_removed(
418         "clippy::should_assert_eq",
419         "`assert!()` will be more flexible with RFC 2011",
420     );
421     store.register_removed(
422         "clippy::extend_from_slice",
423         "`.extend_from_slice(_)` is a faster way to extend a Vec by a slice",
424     );
425     store.register_removed(
426         "clippy::range_step_by_zero",
427         "`iterator.step_by(0)` panics nowadays",
428     );
429     store.register_removed(
430         "clippy::unstable_as_slice",
431         "`Vec::as_slice` has been stabilized in 1.7",
432     );
433     store.register_removed(
434         "clippy::unstable_as_mut_slice",
435         "`Vec::as_mut_slice` has been stabilized in 1.7",
436     );
437     store.register_removed(
438         "clippy::str_to_string",
439         "using `str::to_string` is common even today and specialization will likely happen soon",
440     );
441     store.register_removed(
442         "clippy::string_to_string",
443         "using `string::to_string` is common even today and specialization will likely happen soon",
444     );
445     store.register_removed(
446         "clippy::misaligned_transmute",
447         "this lint has been split into cast_ptr_alignment and transmute_ptr_to_ptr",
448     );
449     store.register_removed(
450         "clippy::assign_ops",
451         "using compound assignment operators (e.g., `+=`) is harmless",
452     );
453     store.register_removed(
454         "clippy::if_let_redundant_pattern_matching",
455         "this lint has been changed to redundant_pattern_matching",
456     );
457     store.register_removed(
458         "clippy::unsafe_vector_initialization",
459         "the replacement suggested by this lint had substantially different behavior",
460     );
461     store.register_removed(
462         "clippy::invalid_ref",
463         "superseded by rustc lint `invalid_value`",
464     );
465     store.register_removed(
466         "clippy::unused_collect",
467         "`collect` has been marked as #[must_use] in rustc and that covers all cases of this lint",
468     );
469     store.register_removed(
470         "clippy::into_iter_on_array",
471         "this lint has been uplifted to rustc and is now called `array_into_iter`",
472     );
473     store.register_removed(
474         "clippy::unused_label",
475         "this lint has been uplifted to rustc and is now called `unused_labels`",
476     );
477     store.register_removed(
478         "clippy::replace_consts",
479         "associated-constants `MIN`/`MAX` of integers are prefer to `{min,max}_value()` and module constants",
480     );
481     // end deprecated lints, do not remove this comment, it’s used in `update_lints`
482
483     // begin register lints, do not remove this comment, it’s used in `update_lints`
484     store.register_lints(&[
485         &approx_const::APPROX_CONSTANT,
486         &arithmetic::FLOAT_ARITHMETIC,
487         &arithmetic::INTEGER_ARITHMETIC,
488         &as_conversions::AS_CONVERSIONS,
489         &assertions_on_constants::ASSERTIONS_ON_CONSTANTS,
490         &assign_ops::ASSIGN_OP_PATTERN,
491         &assign_ops::MISREFACTORED_ASSIGN_OP,
492         &atomic_ordering::INVALID_ATOMIC_ORDERING,
493         &attrs::DEPRECATED_CFG_ATTR,
494         &attrs::DEPRECATED_SEMVER,
495         &attrs::EMPTY_LINE_AFTER_OUTER_ATTR,
496         &attrs::INLINE_ALWAYS,
497         &attrs::MISMATCHED_TARGET_OS,
498         &attrs::UNKNOWN_CLIPPY_LINTS,
499         &attrs::USELESS_ATTRIBUTE,
500         &await_holding_lock::AWAIT_HOLDING_LOCK,
501         &bit_mask::BAD_BIT_MASK,
502         &bit_mask::INEFFECTIVE_BIT_MASK,
503         &bit_mask::VERBOSE_BIT_MASK,
504         &blacklisted_name::BLACKLISTED_NAME,
505         &blocks_in_if_conditions::BLOCKS_IN_IF_CONDITIONS,
506         &booleans::LOGIC_BUG,
507         &booleans::NONMINIMAL_BOOL,
508         &bytecount::NAIVE_BYTECOUNT,
509         &cargo_common_metadata::CARGO_COMMON_METADATA,
510         &checked_conversions::CHECKED_CONVERSIONS,
511         &cognitive_complexity::COGNITIVE_COMPLEXITY,
512         &collapsible_if::COLLAPSIBLE_IF,
513         &comparison_chain::COMPARISON_CHAIN,
514         &copies::IFS_SAME_COND,
515         &copies::IF_SAME_THEN_ELSE,
516         &copies::MATCH_SAME_ARMS,
517         &copies::SAME_FUNCTIONS_IN_IF_CONDITION,
518         &copy_iterator::COPY_ITERATOR,
519         &dbg_macro::DBG_MACRO,
520         &default_trait_access::DEFAULT_TRAIT_ACCESS,
521         &dereference::EXPLICIT_DEREF_METHODS,
522         &derive::DERIVE_HASH_XOR_EQ,
523         &derive::EXPL_IMPL_CLONE_ON_COPY,
524         &derive::UNSAFE_DERIVE_DESERIALIZE,
525         &doc::DOC_MARKDOWN,
526         &doc::MISSING_ERRORS_DOC,
527         &doc::MISSING_SAFETY_DOC,
528         &doc::NEEDLESS_DOCTEST_MAIN,
529         &double_comparison::DOUBLE_COMPARISONS,
530         &double_parens::DOUBLE_PARENS,
531         &drop_bounds::DROP_BOUNDS,
532         &drop_forget_ref::DROP_COPY,
533         &drop_forget_ref::DROP_REF,
534         &drop_forget_ref::FORGET_COPY,
535         &drop_forget_ref::FORGET_REF,
536         &duration_subsec::DURATION_SUBSEC,
537         &else_if_without_else::ELSE_IF_WITHOUT_ELSE,
538         &empty_enum::EMPTY_ENUM,
539         &entry::MAP_ENTRY,
540         &enum_clike::ENUM_CLIKE_UNPORTABLE_VARIANT,
541         &enum_variants::ENUM_VARIANT_NAMES,
542         &enum_variants::MODULE_INCEPTION,
543         &enum_variants::MODULE_NAME_REPETITIONS,
544         &enum_variants::PUB_ENUM_VARIANT_NAMES,
545         &eq_op::EQ_OP,
546         &eq_op::OP_REF,
547         &erasing_op::ERASING_OP,
548         &escape::BOXED_LOCAL,
549         &eta_reduction::REDUNDANT_CLOSURE,
550         &eta_reduction::REDUNDANT_CLOSURE_FOR_METHOD_CALLS,
551         &eval_order_dependence::DIVERGING_SUB_EXPRESSION,
552         &eval_order_dependence::EVAL_ORDER_DEPENDENCE,
553         &excessive_bools::FN_PARAMS_EXCESSIVE_BOOLS,
554         &excessive_bools::STRUCT_EXCESSIVE_BOOLS,
555         &exit::EXIT,
556         &explicit_write::EXPLICIT_WRITE,
557         &fallible_impl_from::FALLIBLE_IMPL_FROM,
558         &float_literal::EXCESSIVE_PRECISION,
559         &float_literal::LOSSY_FLOAT_LITERAL,
560         &floating_point_arithmetic::IMPRECISE_FLOPS,
561         &floating_point_arithmetic::SUBOPTIMAL_FLOPS,
562         &format::USELESS_FORMAT,
563         &formatting::POSSIBLE_MISSING_COMMA,
564         &formatting::SUSPICIOUS_ASSIGNMENT_FORMATTING,
565         &formatting::SUSPICIOUS_ELSE_FORMATTING,
566         &formatting::SUSPICIOUS_UNARY_OP_FORMATTING,
567         &functions::DOUBLE_MUST_USE,
568         &functions::MUST_USE_CANDIDATE,
569         &functions::MUST_USE_UNIT,
570         &functions::NOT_UNSAFE_PTR_ARG_DEREF,
571         &functions::TOO_MANY_ARGUMENTS,
572         &functions::TOO_MANY_LINES,
573         &future_not_send::FUTURE_NOT_SEND,
574         &get_last_with_len::GET_LAST_WITH_LEN,
575         &identity_op::IDENTITY_OP,
576         &if_let_mutex::IF_LET_MUTEX,
577         &if_let_some_result::IF_LET_SOME_RESULT,
578         &if_not_else::IF_NOT_ELSE,
579         &implicit_return::IMPLICIT_RETURN,
580         &implicit_saturating_sub::IMPLICIT_SATURATING_SUB,
581         &indexing_slicing::INDEXING_SLICING,
582         &indexing_slicing::OUT_OF_BOUNDS_INDEXING,
583         &infinite_iter::INFINITE_ITER,
584         &infinite_iter::MAYBE_INFINITE_ITER,
585         &inherent_impl::MULTIPLE_INHERENT_IMPL,
586         &inherent_to_string::INHERENT_TO_STRING,
587         &inherent_to_string::INHERENT_TO_STRING_SHADOW_DISPLAY,
588         &inline_fn_without_body::INLINE_FN_WITHOUT_BODY,
589         &int_plus_one::INT_PLUS_ONE,
590         &integer_division::INTEGER_DIVISION,
591         &items_after_statements::ITEMS_AFTER_STATEMENTS,
592         &large_const_arrays::LARGE_CONST_ARRAYS,
593         &large_enum_variant::LARGE_ENUM_VARIANT,
594         &large_stack_arrays::LARGE_STACK_ARRAYS,
595         &len_zero::LEN_WITHOUT_IS_EMPTY,
596         &len_zero::LEN_ZERO,
597         &let_if_seq::USELESS_LET_IF_SEQ,
598         &let_underscore::LET_UNDERSCORE_LOCK,
599         &let_underscore::LET_UNDERSCORE_MUST_USE,
600         &lifetimes::EXTRA_UNUSED_LIFETIMES,
601         &lifetimes::NEEDLESS_LIFETIMES,
602         &literal_representation::DECIMAL_LITERAL_REPRESENTATION,
603         &literal_representation::INCONSISTENT_DIGIT_GROUPING,
604         &literal_representation::LARGE_DIGIT_GROUPS,
605         &literal_representation::MISTYPED_LITERAL_SUFFIXES,
606         &literal_representation::UNREADABLE_LITERAL,
607         &loops::EMPTY_LOOP,
608         &loops::EXPLICIT_COUNTER_LOOP,
609         &loops::EXPLICIT_INTO_ITER_LOOP,
610         &loops::EXPLICIT_ITER_LOOP,
611         &loops::FOR_KV_MAP,
612         &loops::FOR_LOOPS_OVER_FALLIBLES,
613         &loops::ITER_NEXT_LOOP,
614         &loops::MANUAL_MEMCPY,
615         &loops::MUT_RANGE_BOUND,
616         &loops::NEEDLESS_COLLECT,
617         &loops::NEEDLESS_RANGE_LOOP,
618         &loops::NEVER_LOOP,
619         &loops::WHILE_IMMUTABLE_CONDITION,
620         &loops::WHILE_LET_LOOP,
621         &loops::WHILE_LET_ON_ITERATOR,
622         &macro_use::MACRO_USE_IMPORTS,
623         &main_recursion::MAIN_RECURSION,
624         &manual_async_fn::MANUAL_ASYNC_FN,
625         &manual_non_exhaustive::MANUAL_NON_EXHAUSTIVE,
626         &map_clone::MAP_CLONE,
627         &map_unit_fn::OPTION_MAP_UNIT_FN,
628         &map_unit_fn::RESULT_MAP_UNIT_FN,
629         &match_on_vec_items::MATCH_ON_VEC_ITEMS,
630         &matches::INFALLIBLE_DESTRUCTURING_MATCH,
631         &matches::MATCH_AS_REF,
632         &matches::MATCH_BOOL,
633         &matches::MATCH_OVERLAPPING_ARM,
634         &matches::MATCH_REF_PATS,
635         &matches::MATCH_SINGLE_BINDING,
636         &matches::MATCH_WILDCARD_FOR_SINGLE_VARIANTS,
637         &matches::MATCH_WILD_ERR_ARM,
638         &matches::REST_PAT_IN_FULLY_BOUND_STRUCTS,
639         &matches::SINGLE_MATCH,
640         &matches::SINGLE_MATCH_ELSE,
641         &matches::WILDCARD_ENUM_MATCH_ARM,
642         &matches::WILDCARD_IN_OR_PATTERNS,
643         &mem_discriminant::MEM_DISCRIMINANT_NON_ENUM,
644         &mem_forget::MEM_FORGET,
645         &mem_replace::MEM_REPLACE_OPTION_WITH_NONE,
646         &mem_replace::MEM_REPLACE_WITH_DEFAULT,
647         &mem_replace::MEM_REPLACE_WITH_UNINIT,
648         &methods::BIND_INSTEAD_OF_MAP,
649         &methods::CHARS_LAST_CMP,
650         &methods::CHARS_NEXT_CMP,
651         &methods::CLONE_DOUBLE_REF,
652         &methods::CLONE_ON_COPY,
653         &methods::CLONE_ON_REF_PTR,
654         &methods::EXPECT_FUN_CALL,
655         &methods::EXPECT_USED,
656         &methods::FILETYPE_IS_FILE,
657         &methods::FILTER_MAP,
658         &methods::FILTER_MAP_NEXT,
659         &methods::FILTER_NEXT,
660         &methods::FIND_MAP,
661         &methods::FLAT_MAP_IDENTITY,
662         &methods::GET_UNWRAP,
663         &methods::INEFFICIENT_TO_STRING,
664         &methods::INTO_ITER_ON_REF,
665         &methods::ITERATOR_STEP_BY_ZERO,
666         &methods::ITER_CLONED_COLLECT,
667         &methods::ITER_NTH,
668         &methods::ITER_NTH_ZERO,
669         &methods::ITER_SKIP_NEXT,
670         &methods::MANUAL_SATURATING_ARITHMETIC,
671         &methods::MAP_FLATTEN,
672         &methods::MAP_UNWRAP_OR,
673         &methods::NEW_RET_NO_SELF,
674         &methods::OK_EXPECT,
675         &methods::OPTION_AS_REF_DEREF,
676         &methods::OPTION_MAP_OR_NONE,
677         &methods::OR_FUN_CALL,
678         &methods::RESULT_MAP_OR_INTO_OPTION,
679         &methods::SEARCH_IS_SOME,
680         &methods::SHOULD_IMPLEMENT_TRAIT,
681         &methods::SINGLE_CHAR_PATTERN,
682         &methods::SKIP_WHILE_NEXT,
683         &methods::STRING_EXTEND_CHARS,
684         &methods::SUSPICIOUS_MAP,
685         &methods::TEMPORARY_CSTRING_AS_PTR,
686         &methods::UNINIT_ASSUMED_INIT,
687         &methods::UNNECESSARY_FILTER_MAP,
688         &methods::UNNECESSARY_FOLD,
689         &methods::UNWRAP_USED,
690         &methods::USELESS_ASREF,
691         &methods::WRONG_PUB_SELF_CONVENTION,
692         &methods::WRONG_SELF_CONVENTION,
693         &methods::ZST_OFFSET,
694         &minmax::MIN_MAX,
695         &misc::CMP_NAN,
696         &misc::CMP_OWNED,
697         &misc::FLOAT_CMP,
698         &misc::FLOAT_CMP_CONST,
699         &misc::MODULO_ONE,
700         &misc::SHORT_CIRCUIT_STATEMENT,
701         &misc::TOPLEVEL_REF_ARG,
702         &misc::USED_UNDERSCORE_BINDING,
703         &misc::ZERO_PTR,
704         &misc_early::BUILTIN_TYPE_SHADOW,
705         &misc_early::DOUBLE_NEG,
706         &misc_early::DUPLICATE_UNDERSCORE_ARGUMENT,
707         &misc_early::MIXED_CASE_HEX_LITERALS,
708         &misc_early::REDUNDANT_CLOSURE_CALL,
709         &misc_early::REDUNDANT_PATTERN,
710         &misc_early::UNNEEDED_FIELD_PATTERN,
711         &misc_early::UNNEEDED_WILDCARD_PATTERN,
712         &misc_early::UNSEPARATED_LITERAL_SUFFIX,
713         &misc_early::ZERO_PREFIXED_LITERAL,
714         &missing_const_for_fn::MISSING_CONST_FOR_FN,
715         &missing_doc::MISSING_DOCS_IN_PRIVATE_ITEMS,
716         &missing_inline::MISSING_INLINE_IN_PUBLIC_ITEMS,
717         &modulo_arithmetic::MODULO_ARITHMETIC,
718         &multiple_crate_versions::MULTIPLE_CRATE_VERSIONS,
719         &mut_key::MUTABLE_KEY_TYPE,
720         &mut_mut::MUT_MUT,
721         &mut_reference::UNNECESSARY_MUT_PASSED,
722         &mutable_debug_assertion::DEBUG_ASSERT_WITH_MUT_CALL,
723         &mutex_atomic::MUTEX_ATOMIC,
724         &mutex_atomic::MUTEX_INTEGER,
725         &needless_bool::BOOL_COMPARISON,
726         &needless_bool::NEEDLESS_BOOL,
727         &needless_borrow::NEEDLESS_BORROW,
728         &needless_borrowed_ref::NEEDLESS_BORROWED_REFERENCE,
729         &needless_continue::NEEDLESS_CONTINUE,
730         &needless_pass_by_value::NEEDLESS_PASS_BY_VALUE,
731         &needless_update::NEEDLESS_UPDATE,
732         &neg_cmp_op_on_partial_ord::NEG_CMP_OP_ON_PARTIAL_ORD,
733         &neg_multiply::NEG_MULTIPLY,
734         &new_without_default::NEW_WITHOUT_DEFAULT,
735         &no_effect::NO_EFFECT,
736         &no_effect::UNNECESSARY_OPERATION,
737         &non_copy_const::BORROW_INTERIOR_MUTABLE_CONST,
738         &non_copy_const::DECLARE_INTERIOR_MUTABLE_CONST,
739         &non_expressive_names::JUST_UNDERSCORES_AND_DIGITS,
740         &non_expressive_names::MANY_SINGLE_CHAR_NAMES,
741         &non_expressive_names::SIMILAR_NAMES,
742         &open_options::NONSENSICAL_OPEN_OPTIONS,
743         &option_env_unwrap::OPTION_ENV_UNWRAP,
744         &overflow_check_conditional::OVERFLOW_CHECK_CONDITIONAL,
745         &panic_unimplemented::PANIC,
746         &panic_unimplemented::PANIC_PARAMS,
747         &panic_unimplemented::TODO,
748         &panic_unimplemented::UNIMPLEMENTED,
749         &panic_unimplemented::UNREACHABLE,
750         &partialeq_ne_impl::PARTIALEQ_NE_IMPL,
751         &path_buf_push_overwrite::PATH_BUF_PUSH_OVERWRITE,
752         &precedence::PRECEDENCE,
753         &ptr::CMP_NULL,
754         &ptr::MUT_FROM_REF,
755         &ptr::PTR_ARG,
756         &ptr_offset_with_cast::PTR_OFFSET_WITH_CAST,
757         &question_mark::QUESTION_MARK,
758         &ranges::RANGE_MINUS_ONE,
759         &ranges::RANGE_PLUS_ONE,
760         &ranges::RANGE_ZIP_WITH_LEN,
761         &ranges::REVERSED_EMPTY_RANGES,
762         &redundant_clone::REDUNDANT_CLONE,
763         &redundant_field_names::REDUNDANT_FIELD_NAMES,
764         &redundant_pattern_matching::REDUNDANT_PATTERN_MATCHING,
765         &redundant_pub_crate::REDUNDANT_PUB_CRATE,
766         &redundant_static_lifetimes::REDUNDANT_STATIC_LIFETIMES,
767         &reference::DEREF_ADDROF,
768         &reference::REF_IN_DEREF,
769         &regex::INVALID_REGEX,
770         &regex::REGEX_MACRO,
771         &regex::TRIVIAL_REGEX,
772         &returns::LET_AND_RETURN,
773         &returns::NEEDLESS_RETURN,
774         &returns::UNUSED_UNIT,
775         &serde_api::SERDE_API_MISUSE,
776         &shadow::SHADOW_REUSE,
777         &shadow::SHADOW_SAME,
778         &shadow::SHADOW_UNRELATED,
779         &single_component_path_imports::SINGLE_COMPONENT_PATH_IMPORTS,
780         &slow_vector_initialization::SLOW_VECTOR_INITIALIZATION,
781         &strings::STRING_ADD,
782         &strings::STRING_ADD_ASSIGN,
783         &strings::STRING_LIT_AS_BYTES,
784         &suspicious_trait_impl::SUSPICIOUS_ARITHMETIC_IMPL,
785         &suspicious_trait_impl::SUSPICIOUS_OP_ASSIGN_IMPL,
786         &swap::ALMOST_SWAPPED,
787         &swap::MANUAL_SWAP,
788         &tabs_in_doc_comments::TABS_IN_DOC_COMMENTS,
789         &temporary_assignment::TEMPORARY_ASSIGNMENT,
790         &to_digit_is_some::TO_DIGIT_IS_SOME,
791         &trait_bounds::TYPE_REPETITION_IN_BOUNDS,
792         &transmute::CROSSPOINTER_TRANSMUTE,
793         &transmute::TRANSMUTE_BYTES_TO_STR,
794         &transmute::TRANSMUTE_FLOAT_TO_INT,
795         &transmute::TRANSMUTE_INT_TO_BOOL,
796         &transmute::TRANSMUTE_INT_TO_CHAR,
797         &transmute::TRANSMUTE_INT_TO_FLOAT,
798         &transmute::TRANSMUTE_PTR_TO_PTR,
799         &transmute::TRANSMUTE_PTR_TO_REF,
800         &transmute::UNSOUND_COLLECTION_TRANSMUTE,
801         &transmute::USELESS_TRANSMUTE,
802         &transmute::WRONG_TRANSMUTE,
803         &transmuting_null::TRANSMUTING_NULL,
804         &trivially_copy_pass_by_ref::TRIVIALLY_COPY_PASS_BY_REF,
805         &try_err::TRY_ERR,
806         &types::ABSURD_EXTREME_COMPARISONS,
807         &types::BORROWED_BOX,
808         &types::BOX_VEC,
809         &types::CAST_LOSSLESS,
810         &types::CAST_POSSIBLE_TRUNCATION,
811         &types::CAST_POSSIBLE_WRAP,
812         &types::CAST_PRECISION_LOSS,
813         &types::CAST_PTR_ALIGNMENT,
814         &types::CAST_REF_TO_MUT,
815         &types::CAST_SIGN_LOSS,
816         &types::CHAR_LIT_AS_U8,
817         &types::FN_TO_NUMERIC_CAST,
818         &types::FN_TO_NUMERIC_CAST_WITH_TRUNCATION,
819         &types::IMPLICIT_HASHER,
820         &types::INVALID_UPCAST_COMPARISONS,
821         &types::LET_UNIT_VALUE,
822         &types::LINKEDLIST,
823         &types::OPTION_OPTION,
824         &types::REDUNDANT_ALLOCATION,
825         &types::TYPE_COMPLEXITY,
826         &types::UNIT_ARG,
827         &types::UNIT_CMP,
828         &types::UNNECESSARY_CAST,
829         &types::VEC_BOX,
830         &unicode::NON_ASCII_LITERAL,
831         &unicode::UNICODE_NOT_NFC,
832         &unicode::ZERO_WIDTH_SPACE,
833         &unnamed_address::FN_ADDRESS_COMPARISONS,
834         &unnamed_address::VTABLE_ADDRESS_COMPARISONS,
835         &unsafe_removed_from_name::UNSAFE_REMOVED_FROM_NAME,
836         &unused_io_amount::UNUSED_IO_AMOUNT,
837         &unused_self::UNUSED_SELF,
838         &unwrap::PANICKING_UNWRAP,
839         &unwrap::UNNECESSARY_UNWRAP,
840         &use_self::USE_SELF,
841         &useless_conversion::USELESS_CONVERSION,
842         &utils::internal_lints::CLIPPY_LINTS_INTERNAL,
843         &utils::internal_lints::COLLAPSIBLE_SPAN_LINT_CALLS,
844         &utils::internal_lints::COMPILER_LINT_FUNCTIONS,
845         &utils::internal_lints::DEFAULT_LINT,
846         &utils::internal_lints::LINT_WITHOUT_LINT_PASS,
847         &utils::internal_lints::OUTER_EXPN_EXPN_DATA,
848         &utils::internal_lints::PRODUCE_ICE,
849         &vec::USELESS_VEC,
850         &verbose_file_reads::VERBOSE_FILE_READS,
851         &wildcard_dependencies::WILDCARD_DEPENDENCIES,
852         &wildcard_imports::ENUM_GLOB_USE,
853         &wildcard_imports::WILDCARD_IMPORTS,
854         &write::PRINTLN_EMPTY_STRING,
855         &write::PRINT_LITERAL,
856         &write::PRINT_STDOUT,
857         &write::PRINT_WITH_NEWLINE,
858         &write::USE_DEBUG,
859         &write::WRITELN_EMPTY_STRING,
860         &write::WRITE_LITERAL,
861         &write::WRITE_WITH_NEWLINE,
862         &zero_div_zero::ZERO_DIVIDED_BY_ZERO,
863     ]);
864     // end register lints, do not remove this comment, it’s used in `update_lints`
865
866     store.register_late_pass(|| box await_holding_lock::AwaitHoldingLock);
867     store.register_late_pass(|| box serde_api::SerdeAPI);
868     store.register_late_pass(|| box utils::internal_lints::CompilerLintFunctions::new());
869     store.register_late_pass(|| box utils::internal_lints::LintWithoutLintPass::default());
870     store.register_late_pass(|| box utils::internal_lints::OuterExpnDataPass);
871     store.register_late_pass(|| box utils::inspector::DeepCodeInspector);
872     store.register_late_pass(|| box utils::author::Author);
873     let vec_box_size_threshold = conf.vec_box_size_threshold;
874     store.register_late_pass(move || box types::Types::new(vec_box_size_threshold));
875     store.register_late_pass(|| box booleans::NonminimalBool);
876     store.register_late_pass(|| box eq_op::EqOp);
877     store.register_late_pass(|| box enum_clike::UnportableVariant);
878     store.register_late_pass(|| box float_literal::FloatLiteral);
879     let verbose_bit_mask_threshold = conf.verbose_bit_mask_threshold;
880     store.register_late_pass(move || box bit_mask::BitMask::new(verbose_bit_mask_threshold));
881     store.register_late_pass(|| box ptr::Ptr);
882     store.register_late_pass(|| box needless_bool::NeedlessBool);
883     store.register_late_pass(|| box needless_bool::BoolComparison);
884     store.register_late_pass(|| box approx_const::ApproxConstant);
885     store.register_late_pass(|| box misc::MiscLints);
886     store.register_late_pass(|| box eta_reduction::EtaReduction);
887     store.register_late_pass(|| box identity_op::IdentityOp);
888     store.register_late_pass(|| box erasing_op::ErasingOp);
889     store.register_late_pass(|| box mut_mut::MutMut);
890     store.register_late_pass(|| box mut_reference::UnnecessaryMutPassed);
891     store.register_late_pass(|| box len_zero::LenZero);
892     store.register_late_pass(|| box attrs::Attributes);
893     store.register_late_pass(|| box blocks_in_if_conditions::BlocksInIfConditions);
894     store.register_late_pass(|| box unicode::Unicode);
895     store.register_late_pass(|| box strings::StringAdd);
896     store.register_late_pass(|| box implicit_return::ImplicitReturn);
897     store.register_late_pass(|| box implicit_saturating_sub::ImplicitSaturatingSub);
898     store.register_late_pass(|| box methods::Methods);
899     store.register_late_pass(|| box map_clone::MapClone);
900     store.register_late_pass(|| box shadow::Shadow);
901     store.register_late_pass(|| box types::LetUnitValue);
902     store.register_late_pass(|| box types::UnitCmp);
903     store.register_late_pass(|| box loops::Loops);
904     store.register_late_pass(|| box main_recursion::MainRecursion::default());
905     store.register_late_pass(|| box lifetimes::Lifetimes);
906     store.register_late_pass(|| box entry::HashMapPass);
907     store.register_late_pass(|| box ranges::Ranges);
908     store.register_late_pass(|| box types::Casts);
909     let type_complexity_threshold = conf.type_complexity_threshold;
910     store.register_late_pass(move || box types::TypeComplexity::new(type_complexity_threshold));
911     store.register_late_pass(|| box matches::Matches::default());
912     store.register_late_pass(|| box minmax::MinMaxPass);
913     store.register_late_pass(|| box open_options::OpenOptions);
914     store.register_late_pass(|| box zero_div_zero::ZeroDiv);
915     store.register_late_pass(|| box mutex_atomic::Mutex);
916     store.register_late_pass(|| box needless_update::NeedlessUpdate);
917     store.register_late_pass(|| box needless_borrow::NeedlessBorrow::default());
918     store.register_late_pass(|| box needless_borrowed_ref::NeedlessBorrowedRef);
919     store.register_late_pass(|| box no_effect::NoEffect);
920     store.register_late_pass(|| box temporary_assignment::TemporaryAssignment);
921     store.register_late_pass(|| box transmute::Transmute);
922     let cognitive_complexity_threshold = conf.cognitive_complexity_threshold;
923     store.register_late_pass(move || box cognitive_complexity::CognitiveComplexity::new(cognitive_complexity_threshold));
924     let too_large_for_stack = conf.too_large_for_stack;
925     store.register_late_pass(move || box escape::BoxedLocal{too_large_for_stack});
926     store.register_late_pass(|| box panic_unimplemented::PanicUnimplemented);
927     store.register_late_pass(|| box strings::StringLitAsBytes);
928     store.register_late_pass(|| box derive::Derive);
929     store.register_late_pass(|| box types::CharLitAsU8);
930     store.register_late_pass(|| box vec::UselessVec);
931     store.register_late_pass(|| box drop_bounds::DropBounds);
932     store.register_late_pass(|| box get_last_with_len::GetLastWithLen);
933     store.register_late_pass(|| box drop_forget_ref::DropForgetRef);
934     store.register_late_pass(|| box empty_enum::EmptyEnum);
935     store.register_late_pass(|| box types::AbsurdExtremeComparisons);
936     store.register_late_pass(|| box types::InvalidUpcastComparisons);
937     store.register_late_pass(|| box regex::Regex::default());
938     store.register_late_pass(|| box copies::CopyAndPaste);
939     store.register_late_pass(|| box copy_iterator::CopyIterator);
940     store.register_late_pass(|| box format::UselessFormat);
941     store.register_late_pass(|| box swap::Swap);
942     store.register_late_pass(|| box overflow_check_conditional::OverflowCheckConditional);
943     store.register_late_pass(|| box new_without_default::NewWithoutDefault::default());
944     let blacklisted_names = conf.blacklisted_names.iter().cloned().collect::<FxHashSet<_>>();
945     store.register_late_pass(move || box blacklisted_name::BlacklistedName::new(blacklisted_names.clone()));
946     let too_many_arguments_threshold1 = conf.too_many_arguments_threshold;
947     let too_many_lines_threshold2 = conf.too_many_lines_threshold;
948     store.register_late_pass(move || box functions::Functions::new(too_many_arguments_threshold1, too_many_lines_threshold2));
949     let doc_valid_idents = conf.doc_valid_idents.iter().cloned().collect::<FxHashSet<_>>();
950     store.register_late_pass(move || box doc::DocMarkdown::new(doc_valid_idents.clone()));
951     store.register_late_pass(|| box neg_multiply::NegMultiply);
952     store.register_late_pass(|| box mem_discriminant::MemDiscriminant);
953     store.register_late_pass(|| box mem_forget::MemForget);
954     store.register_late_pass(|| box mem_replace::MemReplace);
955     store.register_late_pass(|| box arithmetic::Arithmetic::default());
956     store.register_late_pass(|| box assign_ops::AssignOps);
957     store.register_late_pass(|| box let_if_seq::LetIfSeq);
958     store.register_late_pass(|| box eval_order_dependence::EvalOrderDependence);
959     store.register_late_pass(|| box missing_doc::MissingDoc::new());
960     store.register_late_pass(|| box missing_inline::MissingInline);
961     store.register_late_pass(|| box if_let_some_result::OkIfLet);
962     store.register_late_pass(|| box redundant_pattern_matching::RedundantPatternMatching);
963     store.register_late_pass(|| box partialeq_ne_impl::PartialEqNeImpl);
964     store.register_late_pass(|| box unused_io_amount::UnusedIoAmount);
965     let enum_variant_size_threshold = conf.enum_variant_size_threshold;
966     store.register_late_pass(move || box large_enum_variant::LargeEnumVariant::new(enum_variant_size_threshold));
967     store.register_late_pass(|| box explicit_write::ExplicitWrite);
968     store.register_late_pass(|| box needless_pass_by_value::NeedlessPassByValue);
969     let trivially_copy_pass_by_ref = trivially_copy_pass_by_ref::TriviallyCopyPassByRef::new(
970         conf.trivial_copy_size_limit,
971         &sess.target,
972     );
973     store.register_late_pass(move || box trivially_copy_pass_by_ref);
974     store.register_late_pass(|| box try_err::TryErr);
975     store.register_late_pass(|| box use_self::UseSelf);
976     store.register_late_pass(|| box bytecount::ByteCount);
977     store.register_late_pass(|| box infinite_iter::InfiniteIter);
978     store.register_late_pass(|| box inline_fn_without_body::InlineFnWithoutBody);
979     store.register_late_pass(|| box useless_conversion::UselessConversion::default());
980     store.register_late_pass(|| box types::ImplicitHasher);
981     store.register_late_pass(|| box fallible_impl_from::FallibleImplFrom);
982     store.register_late_pass(|| box types::UnitArg);
983     store.register_late_pass(|| box double_comparison::DoubleComparisons);
984     store.register_late_pass(|| box question_mark::QuestionMark);
985     store.register_late_pass(|| box suspicious_trait_impl::SuspiciousImpl);
986     store.register_late_pass(|| box map_unit_fn::MapUnit);
987     store.register_late_pass(|| box inherent_impl::MultipleInherentImpl::default());
988     store.register_late_pass(|| box neg_cmp_op_on_partial_ord::NoNegCompOpForPartialOrd);
989     store.register_late_pass(|| box unwrap::Unwrap);
990     store.register_late_pass(|| box duration_subsec::DurationSubsec);
991     store.register_late_pass(|| box default_trait_access::DefaultTraitAccess);
992     store.register_late_pass(|| box indexing_slicing::IndexingSlicing);
993     store.register_late_pass(|| box non_copy_const::NonCopyConst);
994     store.register_late_pass(|| box ptr_offset_with_cast::PtrOffsetWithCast);
995     store.register_late_pass(|| box redundant_clone::RedundantClone);
996     store.register_late_pass(|| box slow_vector_initialization::SlowVectorInit);
997     store.register_late_pass(|| box types::RefToMut);
998     store.register_late_pass(|| box assertions_on_constants::AssertionsOnConstants);
999     store.register_late_pass(|| box missing_const_for_fn::MissingConstForFn);
1000     store.register_late_pass(|| box transmuting_null::TransmutingNull);
1001     store.register_late_pass(|| box path_buf_push_overwrite::PathBufPushOverwrite);
1002     store.register_late_pass(|| box checked_conversions::CheckedConversions);
1003     store.register_late_pass(|| box integer_division::IntegerDivision);
1004     store.register_late_pass(|| box inherent_to_string::InherentToString);
1005     store.register_late_pass(|| box trait_bounds::TraitBounds);
1006     store.register_late_pass(|| box comparison_chain::ComparisonChain);
1007     store.register_late_pass(|| box mut_key::MutableKeyType);
1008     store.register_late_pass(|| box modulo_arithmetic::ModuloArithmetic);
1009     store.register_early_pass(|| box reference::DerefAddrOf);
1010     store.register_early_pass(|| box reference::RefInDeref);
1011     store.register_early_pass(|| box double_parens::DoubleParens);
1012     store.register_early_pass(|| box unsafe_removed_from_name::UnsafeNameRemoval);
1013     store.register_early_pass(|| box if_not_else::IfNotElse);
1014     store.register_early_pass(|| box else_if_without_else::ElseIfWithoutElse);
1015     store.register_early_pass(|| box int_plus_one::IntPlusOne);
1016     store.register_early_pass(|| box formatting::Formatting);
1017     store.register_early_pass(|| box misc_early::MiscEarlyLints);
1018     store.register_early_pass(|| box returns::Return);
1019     store.register_early_pass(|| box collapsible_if::CollapsibleIf);
1020     store.register_early_pass(|| box items_after_statements::ItemsAfterStatements);
1021     store.register_early_pass(|| box precedence::Precedence);
1022     store.register_early_pass(|| box needless_continue::NeedlessContinue);
1023     store.register_early_pass(|| box redundant_static_lifetimes::RedundantStaticLifetimes);
1024     store.register_late_pass(|| box cargo_common_metadata::CargoCommonMetadata);
1025     store.register_late_pass(|| box multiple_crate_versions::MultipleCrateVersions);
1026     store.register_late_pass(|| box wildcard_dependencies::WildcardDependencies);
1027     store.register_early_pass(|| box literal_representation::LiteralDigitGrouping);
1028     let literal_representation_threshold = conf.literal_representation_threshold;
1029     store.register_early_pass(move || box literal_representation::DecimalLiteralRepresentation::new(literal_representation_threshold));
1030     store.register_early_pass(|| box utils::internal_lints::ClippyLintsInternal);
1031     let enum_variant_name_threshold = conf.enum_variant_name_threshold;
1032     store.register_early_pass(move || box enum_variants::EnumVariantNames::new(enum_variant_name_threshold));
1033     store.register_early_pass(|| box tabs_in_doc_comments::TabsInDocComments);
1034     store.register_late_pass(|| box unused_self::UnusedSelf);
1035     store.register_late_pass(|| box mutable_debug_assertion::DebugAssertWithMutCall);
1036     store.register_late_pass(|| box exit::Exit);
1037     store.register_late_pass(|| box to_digit_is_some::ToDigitIsSome);
1038     let array_size_threshold = conf.array_size_threshold;
1039     store.register_late_pass(move || box large_stack_arrays::LargeStackArrays::new(array_size_threshold));
1040     store.register_late_pass(move || box large_const_arrays::LargeConstArrays::new(array_size_threshold));
1041     store.register_late_pass(move || box floating_point_arithmetic::FloatingPointArithmetic);
1042     store.register_early_pass(|| box as_conversions::AsConversions);
1043     store.register_early_pass(|| box utils::internal_lints::ProduceIce);
1044     store.register_late_pass(|| box let_underscore::LetUnderscore);
1045     store.register_late_pass(|| box atomic_ordering::AtomicOrdering);
1046     store.register_early_pass(|| box single_component_path_imports::SingleComponentPathImports);
1047     let max_fn_params_bools = conf.max_fn_params_bools;
1048     let max_struct_bools = conf.max_struct_bools;
1049     store.register_early_pass(move || box excessive_bools::ExcessiveBools::new(max_struct_bools, max_fn_params_bools));
1050     store.register_early_pass(|| box option_env_unwrap::OptionEnvUnwrap);
1051     let warn_on_all_wildcard_imports = conf.warn_on_all_wildcard_imports;
1052     store.register_late_pass(move || box wildcard_imports::WildcardImports::new(warn_on_all_wildcard_imports));
1053     store.register_early_pass(|| box macro_use::MacroUseImports);
1054     store.register_late_pass(|| box verbose_file_reads::VerboseFileReads);
1055     store.register_late_pass(|| box redundant_pub_crate::RedundantPubCrate::default());
1056     store.register_late_pass(|| box unnamed_address::UnnamedAddress);
1057     store.register_late_pass(|| box dereference::Dereferencing);
1058     store.register_late_pass(|| box future_not_send::FutureNotSend);
1059     store.register_late_pass(|| box utils::internal_lints::CollapsibleCalls);
1060     store.register_late_pass(|| box if_let_mutex::IfLetMutex);
1061     store.register_late_pass(|| box match_on_vec_items::MatchOnVecItems);
1062     store.register_early_pass(|| box manual_non_exhaustive::ManualNonExhaustive);
1063     store.register_late_pass(|| box manual_async_fn::ManualAsyncFn);
1064     store.register_early_pass(|| box redundant_field_names::RedundantFieldNames);
1065     let single_char_binding_names_threshold = conf.single_char_binding_names_threshold;
1066     store.register_early_pass(move || box non_expressive_names::NonExpressiveNames {
1067         single_char_binding_names_threshold,
1068     });
1069
1070     store.register_group(true, "clippy::restriction", Some("clippy_restriction"), vec![
1071         LintId::of(&arithmetic::FLOAT_ARITHMETIC),
1072         LintId::of(&arithmetic::INTEGER_ARITHMETIC),
1073         LintId::of(&as_conversions::AS_CONVERSIONS),
1074         LintId::of(&dbg_macro::DBG_MACRO),
1075         LintId::of(&else_if_without_else::ELSE_IF_WITHOUT_ELSE),
1076         LintId::of(&exit::EXIT),
1077         LintId::of(&float_literal::LOSSY_FLOAT_LITERAL),
1078         LintId::of(&implicit_return::IMPLICIT_RETURN),
1079         LintId::of(&indexing_slicing::INDEXING_SLICING),
1080         LintId::of(&inherent_impl::MULTIPLE_INHERENT_IMPL),
1081         LintId::of(&integer_division::INTEGER_DIVISION),
1082         LintId::of(&let_underscore::LET_UNDERSCORE_MUST_USE),
1083         LintId::of(&literal_representation::DECIMAL_LITERAL_REPRESENTATION),
1084         LintId::of(&matches::REST_PAT_IN_FULLY_BOUND_STRUCTS),
1085         LintId::of(&matches::WILDCARD_ENUM_MATCH_ARM),
1086         LintId::of(&mem_forget::MEM_FORGET),
1087         LintId::of(&methods::CLONE_ON_REF_PTR),
1088         LintId::of(&methods::EXPECT_USED),
1089         LintId::of(&methods::FILETYPE_IS_FILE),
1090         LintId::of(&methods::GET_UNWRAP),
1091         LintId::of(&methods::UNWRAP_USED),
1092         LintId::of(&methods::WRONG_PUB_SELF_CONVENTION),
1093         LintId::of(&misc::FLOAT_CMP_CONST),
1094         LintId::of(&misc_early::UNNEEDED_FIELD_PATTERN),
1095         LintId::of(&missing_doc::MISSING_DOCS_IN_PRIVATE_ITEMS),
1096         LintId::of(&missing_inline::MISSING_INLINE_IN_PUBLIC_ITEMS),
1097         LintId::of(&modulo_arithmetic::MODULO_ARITHMETIC),
1098         LintId::of(&panic_unimplemented::PANIC),
1099         LintId::of(&panic_unimplemented::TODO),
1100         LintId::of(&panic_unimplemented::UNIMPLEMENTED),
1101         LintId::of(&panic_unimplemented::UNREACHABLE),
1102         LintId::of(&shadow::SHADOW_REUSE),
1103         LintId::of(&shadow::SHADOW_SAME),
1104         LintId::of(&strings::STRING_ADD),
1105         LintId::of(&verbose_file_reads::VERBOSE_FILE_READS),
1106         LintId::of(&write::PRINT_STDOUT),
1107         LintId::of(&write::USE_DEBUG),
1108     ]);
1109
1110     store.register_group(true, "clippy::pedantic", Some("clippy_pedantic"), vec![
1111         LintId::of(&attrs::INLINE_ALWAYS),
1112         LintId::of(&await_holding_lock::AWAIT_HOLDING_LOCK),
1113         LintId::of(&checked_conversions::CHECKED_CONVERSIONS),
1114         LintId::of(&copies::MATCH_SAME_ARMS),
1115         LintId::of(&copies::SAME_FUNCTIONS_IN_IF_CONDITION),
1116         LintId::of(&copy_iterator::COPY_ITERATOR),
1117         LintId::of(&default_trait_access::DEFAULT_TRAIT_ACCESS),
1118         LintId::of(&dereference::EXPLICIT_DEREF_METHODS),
1119         LintId::of(&derive::EXPL_IMPL_CLONE_ON_COPY),
1120         LintId::of(&derive::UNSAFE_DERIVE_DESERIALIZE),
1121         LintId::of(&doc::DOC_MARKDOWN),
1122         LintId::of(&doc::MISSING_ERRORS_DOC),
1123         LintId::of(&empty_enum::EMPTY_ENUM),
1124         LintId::of(&enum_variants::MODULE_NAME_REPETITIONS),
1125         LintId::of(&enum_variants::PUB_ENUM_VARIANT_NAMES),
1126         LintId::of(&eta_reduction::REDUNDANT_CLOSURE_FOR_METHOD_CALLS),
1127         LintId::of(&excessive_bools::FN_PARAMS_EXCESSIVE_BOOLS),
1128         LintId::of(&excessive_bools::STRUCT_EXCESSIVE_BOOLS),
1129         LintId::of(&functions::MUST_USE_CANDIDATE),
1130         LintId::of(&functions::TOO_MANY_LINES),
1131         LintId::of(&if_not_else::IF_NOT_ELSE),
1132         LintId::of(&implicit_saturating_sub::IMPLICIT_SATURATING_SUB),
1133         LintId::of(&infinite_iter::MAYBE_INFINITE_ITER),
1134         LintId::of(&items_after_statements::ITEMS_AFTER_STATEMENTS),
1135         LintId::of(&large_stack_arrays::LARGE_STACK_ARRAYS),
1136         LintId::of(&literal_representation::LARGE_DIGIT_GROUPS),
1137         LintId::of(&literal_representation::UNREADABLE_LITERAL),
1138         LintId::of(&loops::EXPLICIT_INTO_ITER_LOOP),
1139         LintId::of(&loops::EXPLICIT_ITER_LOOP),
1140         LintId::of(&macro_use::MACRO_USE_IMPORTS),
1141         LintId::of(&match_on_vec_items::MATCH_ON_VEC_ITEMS),
1142         LintId::of(&matches::MATCH_BOOL),
1143         LintId::of(&matches::MATCH_WILDCARD_FOR_SINGLE_VARIANTS),
1144         LintId::of(&matches::MATCH_WILD_ERR_ARM),
1145         LintId::of(&matches::SINGLE_MATCH_ELSE),
1146         LintId::of(&methods::FILTER_MAP),
1147         LintId::of(&methods::FILTER_MAP_NEXT),
1148         LintId::of(&methods::FIND_MAP),
1149         LintId::of(&methods::INEFFICIENT_TO_STRING),
1150         LintId::of(&methods::MAP_FLATTEN),
1151         LintId::of(&methods::MAP_UNWRAP_OR),
1152         LintId::of(&misc::USED_UNDERSCORE_BINDING),
1153         LintId::of(&misc_early::UNSEPARATED_LITERAL_SUFFIX),
1154         LintId::of(&mut_mut::MUT_MUT),
1155         LintId::of(&needless_continue::NEEDLESS_CONTINUE),
1156         LintId::of(&needless_pass_by_value::NEEDLESS_PASS_BY_VALUE),
1157         LintId::of(&non_expressive_names::SIMILAR_NAMES),
1158         LintId::of(&ranges::RANGE_PLUS_ONE),
1159         LintId::of(&shadow::SHADOW_UNRELATED),
1160         LintId::of(&strings::STRING_ADD_ASSIGN),
1161         LintId::of(&trait_bounds::TYPE_REPETITION_IN_BOUNDS),
1162         LintId::of(&trivially_copy_pass_by_ref::TRIVIALLY_COPY_PASS_BY_REF),
1163         LintId::of(&types::CAST_LOSSLESS),
1164         LintId::of(&types::CAST_POSSIBLE_TRUNCATION),
1165         LintId::of(&types::CAST_POSSIBLE_WRAP),
1166         LintId::of(&types::CAST_PRECISION_LOSS),
1167         LintId::of(&types::CAST_SIGN_LOSS),
1168         LintId::of(&types::IMPLICIT_HASHER),
1169         LintId::of(&types::INVALID_UPCAST_COMPARISONS),
1170         LintId::of(&types::LET_UNIT_VALUE),
1171         LintId::of(&types::LINKEDLIST),
1172         LintId::of(&types::OPTION_OPTION),
1173         LintId::of(&unicode::NON_ASCII_LITERAL),
1174         LintId::of(&unicode::UNICODE_NOT_NFC),
1175         LintId::of(&unused_self::UNUSED_SELF),
1176         LintId::of(&wildcard_imports::ENUM_GLOB_USE),
1177         LintId::of(&wildcard_imports::WILDCARD_IMPORTS),
1178     ]);
1179
1180     store.register_group(true, "clippy::internal", Some("clippy_internal"), vec![
1181         LintId::of(&utils::internal_lints::CLIPPY_LINTS_INTERNAL),
1182         LintId::of(&utils::internal_lints::COLLAPSIBLE_SPAN_LINT_CALLS),
1183         LintId::of(&utils::internal_lints::COMPILER_LINT_FUNCTIONS),
1184         LintId::of(&utils::internal_lints::DEFAULT_LINT),
1185         LintId::of(&utils::internal_lints::LINT_WITHOUT_LINT_PASS),
1186         LintId::of(&utils::internal_lints::OUTER_EXPN_EXPN_DATA),
1187         LintId::of(&utils::internal_lints::PRODUCE_ICE),
1188     ]);
1189
1190     store.register_group(true, "clippy::all", Some("clippy"), vec![
1191         LintId::of(&approx_const::APPROX_CONSTANT),
1192         LintId::of(&assertions_on_constants::ASSERTIONS_ON_CONSTANTS),
1193         LintId::of(&assign_ops::ASSIGN_OP_PATTERN),
1194         LintId::of(&assign_ops::MISREFACTORED_ASSIGN_OP),
1195         LintId::of(&atomic_ordering::INVALID_ATOMIC_ORDERING),
1196         LintId::of(&attrs::DEPRECATED_CFG_ATTR),
1197         LintId::of(&attrs::DEPRECATED_SEMVER),
1198         LintId::of(&attrs::MISMATCHED_TARGET_OS),
1199         LintId::of(&attrs::UNKNOWN_CLIPPY_LINTS),
1200         LintId::of(&attrs::USELESS_ATTRIBUTE),
1201         LintId::of(&bit_mask::BAD_BIT_MASK),
1202         LintId::of(&bit_mask::INEFFECTIVE_BIT_MASK),
1203         LintId::of(&bit_mask::VERBOSE_BIT_MASK),
1204         LintId::of(&blacklisted_name::BLACKLISTED_NAME),
1205         LintId::of(&blocks_in_if_conditions::BLOCKS_IN_IF_CONDITIONS),
1206         LintId::of(&booleans::LOGIC_BUG),
1207         LintId::of(&booleans::NONMINIMAL_BOOL),
1208         LintId::of(&bytecount::NAIVE_BYTECOUNT),
1209         LintId::of(&collapsible_if::COLLAPSIBLE_IF),
1210         LintId::of(&comparison_chain::COMPARISON_CHAIN),
1211         LintId::of(&copies::IFS_SAME_COND),
1212         LintId::of(&copies::IF_SAME_THEN_ELSE),
1213         LintId::of(&derive::DERIVE_HASH_XOR_EQ),
1214         LintId::of(&doc::MISSING_SAFETY_DOC),
1215         LintId::of(&doc::NEEDLESS_DOCTEST_MAIN),
1216         LintId::of(&double_comparison::DOUBLE_COMPARISONS),
1217         LintId::of(&double_parens::DOUBLE_PARENS),
1218         LintId::of(&drop_bounds::DROP_BOUNDS),
1219         LintId::of(&drop_forget_ref::DROP_COPY),
1220         LintId::of(&drop_forget_ref::DROP_REF),
1221         LintId::of(&drop_forget_ref::FORGET_COPY),
1222         LintId::of(&drop_forget_ref::FORGET_REF),
1223         LintId::of(&duration_subsec::DURATION_SUBSEC),
1224         LintId::of(&entry::MAP_ENTRY),
1225         LintId::of(&enum_clike::ENUM_CLIKE_UNPORTABLE_VARIANT),
1226         LintId::of(&enum_variants::ENUM_VARIANT_NAMES),
1227         LintId::of(&enum_variants::MODULE_INCEPTION),
1228         LintId::of(&eq_op::EQ_OP),
1229         LintId::of(&eq_op::OP_REF),
1230         LintId::of(&erasing_op::ERASING_OP),
1231         LintId::of(&escape::BOXED_LOCAL),
1232         LintId::of(&eta_reduction::REDUNDANT_CLOSURE),
1233         LintId::of(&eval_order_dependence::DIVERGING_SUB_EXPRESSION),
1234         LintId::of(&eval_order_dependence::EVAL_ORDER_DEPENDENCE),
1235         LintId::of(&explicit_write::EXPLICIT_WRITE),
1236         LintId::of(&float_literal::EXCESSIVE_PRECISION),
1237         LintId::of(&format::USELESS_FORMAT),
1238         LintId::of(&formatting::POSSIBLE_MISSING_COMMA),
1239         LintId::of(&formatting::SUSPICIOUS_ASSIGNMENT_FORMATTING),
1240         LintId::of(&formatting::SUSPICIOUS_ELSE_FORMATTING),
1241         LintId::of(&formatting::SUSPICIOUS_UNARY_OP_FORMATTING),
1242         LintId::of(&functions::DOUBLE_MUST_USE),
1243         LintId::of(&functions::MUST_USE_UNIT),
1244         LintId::of(&functions::NOT_UNSAFE_PTR_ARG_DEREF),
1245         LintId::of(&functions::TOO_MANY_ARGUMENTS),
1246         LintId::of(&get_last_with_len::GET_LAST_WITH_LEN),
1247         LintId::of(&identity_op::IDENTITY_OP),
1248         LintId::of(&if_let_mutex::IF_LET_MUTEX),
1249         LintId::of(&if_let_some_result::IF_LET_SOME_RESULT),
1250         LintId::of(&indexing_slicing::OUT_OF_BOUNDS_INDEXING),
1251         LintId::of(&infinite_iter::INFINITE_ITER),
1252         LintId::of(&inherent_to_string::INHERENT_TO_STRING),
1253         LintId::of(&inherent_to_string::INHERENT_TO_STRING_SHADOW_DISPLAY),
1254         LintId::of(&inline_fn_without_body::INLINE_FN_WITHOUT_BODY),
1255         LintId::of(&int_plus_one::INT_PLUS_ONE),
1256         LintId::of(&large_const_arrays::LARGE_CONST_ARRAYS),
1257         LintId::of(&large_enum_variant::LARGE_ENUM_VARIANT),
1258         LintId::of(&len_zero::LEN_WITHOUT_IS_EMPTY),
1259         LintId::of(&len_zero::LEN_ZERO),
1260         LintId::of(&let_underscore::LET_UNDERSCORE_LOCK),
1261         LintId::of(&lifetimes::EXTRA_UNUSED_LIFETIMES),
1262         LintId::of(&lifetimes::NEEDLESS_LIFETIMES),
1263         LintId::of(&literal_representation::INCONSISTENT_DIGIT_GROUPING),
1264         LintId::of(&literal_representation::MISTYPED_LITERAL_SUFFIXES),
1265         LintId::of(&loops::EMPTY_LOOP),
1266         LintId::of(&loops::EXPLICIT_COUNTER_LOOP),
1267         LintId::of(&loops::FOR_KV_MAP),
1268         LintId::of(&loops::FOR_LOOPS_OVER_FALLIBLES),
1269         LintId::of(&loops::ITER_NEXT_LOOP),
1270         LintId::of(&loops::MANUAL_MEMCPY),
1271         LintId::of(&loops::MUT_RANGE_BOUND),
1272         LintId::of(&loops::NEEDLESS_COLLECT),
1273         LintId::of(&loops::NEEDLESS_RANGE_LOOP),
1274         LintId::of(&loops::NEVER_LOOP),
1275         LintId::of(&loops::WHILE_IMMUTABLE_CONDITION),
1276         LintId::of(&loops::WHILE_LET_LOOP),
1277         LintId::of(&loops::WHILE_LET_ON_ITERATOR),
1278         LintId::of(&main_recursion::MAIN_RECURSION),
1279         LintId::of(&manual_async_fn::MANUAL_ASYNC_FN),
1280         LintId::of(&manual_non_exhaustive::MANUAL_NON_EXHAUSTIVE),
1281         LintId::of(&map_clone::MAP_CLONE),
1282         LintId::of(&map_unit_fn::OPTION_MAP_UNIT_FN),
1283         LintId::of(&map_unit_fn::RESULT_MAP_UNIT_FN),
1284         LintId::of(&matches::INFALLIBLE_DESTRUCTURING_MATCH),
1285         LintId::of(&matches::MATCH_AS_REF),
1286         LintId::of(&matches::MATCH_OVERLAPPING_ARM),
1287         LintId::of(&matches::MATCH_REF_PATS),
1288         LintId::of(&matches::MATCH_SINGLE_BINDING),
1289         LintId::of(&matches::SINGLE_MATCH),
1290         LintId::of(&matches::WILDCARD_IN_OR_PATTERNS),
1291         LintId::of(&mem_discriminant::MEM_DISCRIMINANT_NON_ENUM),
1292         LintId::of(&mem_replace::MEM_REPLACE_OPTION_WITH_NONE),
1293         LintId::of(&mem_replace::MEM_REPLACE_WITH_DEFAULT),
1294         LintId::of(&mem_replace::MEM_REPLACE_WITH_UNINIT),
1295         LintId::of(&methods::BIND_INSTEAD_OF_MAP),
1296         LintId::of(&methods::CHARS_LAST_CMP),
1297         LintId::of(&methods::CHARS_NEXT_CMP),
1298         LintId::of(&methods::CLONE_DOUBLE_REF),
1299         LintId::of(&methods::CLONE_ON_COPY),
1300         LintId::of(&methods::EXPECT_FUN_CALL),
1301         LintId::of(&methods::FILTER_NEXT),
1302         LintId::of(&methods::FLAT_MAP_IDENTITY),
1303         LintId::of(&methods::INTO_ITER_ON_REF),
1304         LintId::of(&methods::ITERATOR_STEP_BY_ZERO),
1305         LintId::of(&methods::ITER_CLONED_COLLECT),
1306         LintId::of(&methods::ITER_NTH),
1307         LintId::of(&methods::ITER_NTH_ZERO),
1308         LintId::of(&methods::ITER_SKIP_NEXT),
1309         LintId::of(&methods::MANUAL_SATURATING_ARITHMETIC),
1310         LintId::of(&methods::NEW_RET_NO_SELF),
1311         LintId::of(&methods::OK_EXPECT),
1312         LintId::of(&methods::OPTION_AS_REF_DEREF),
1313         LintId::of(&methods::OPTION_MAP_OR_NONE),
1314         LintId::of(&methods::OR_FUN_CALL),
1315         LintId::of(&methods::RESULT_MAP_OR_INTO_OPTION),
1316         LintId::of(&methods::SEARCH_IS_SOME),
1317         LintId::of(&methods::SHOULD_IMPLEMENT_TRAIT),
1318         LintId::of(&methods::SINGLE_CHAR_PATTERN),
1319         LintId::of(&methods::SKIP_WHILE_NEXT),
1320         LintId::of(&methods::STRING_EXTEND_CHARS),
1321         LintId::of(&methods::SUSPICIOUS_MAP),
1322         LintId::of(&methods::TEMPORARY_CSTRING_AS_PTR),
1323         LintId::of(&methods::UNINIT_ASSUMED_INIT),
1324         LintId::of(&methods::UNNECESSARY_FILTER_MAP),
1325         LintId::of(&methods::UNNECESSARY_FOLD),
1326         LintId::of(&methods::USELESS_ASREF),
1327         LintId::of(&methods::WRONG_SELF_CONVENTION),
1328         LintId::of(&methods::ZST_OFFSET),
1329         LintId::of(&minmax::MIN_MAX),
1330         LintId::of(&misc::CMP_NAN),
1331         LintId::of(&misc::CMP_OWNED),
1332         LintId::of(&misc::FLOAT_CMP),
1333         LintId::of(&misc::MODULO_ONE),
1334         LintId::of(&misc::SHORT_CIRCUIT_STATEMENT),
1335         LintId::of(&misc::TOPLEVEL_REF_ARG),
1336         LintId::of(&misc::ZERO_PTR),
1337         LintId::of(&misc_early::BUILTIN_TYPE_SHADOW),
1338         LintId::of(&misc_early::DOUBLE_NEG),
1339         LintId::of(&misc_early::DUPLICATE_UNDERSCORE_ARGUMENT),
1340         LintId::of(&misc_early::MIXED_CASE_HEX_LITERALS),
1341         LintId::of(&misc_early::REDUNDANT_CLOSURE_CALL),
1342         LintId::of(&misc_early::REDUNDANT_PATTERN),
1343         LintId::of(&misc_early::UNNEEDED_WILDCARD_PATTERN),
1344         LintId::of(&misc_early::ZERO_PREFIXED_LITERAL),
1345         LintId::of(&mut_key::MUTABLE_KEY_TYPE),
1346         LintId::of(&mut_reference::UNNECESSARY_MUT_PASSED),
1347         LintId::of(&mutex_atomic::MUTEX_ATOMIC),
1348         LintId::of(&needless_bool::BOOL_COMPARISON),
1349         LintId::of(&needless_bool::NEEDLESS_BOOL),
1350         LintId::of(&needless_borrowed_ref::NEEDLESS_BORROWED_REFERENCE),
1351         LintId::of(&needless_update::NEEDLESS_UPDATE),
1352         LintId::of(&neg_cmp_op_on_partial_ord::NEG_CMP_OP_ON_PARTIAL_ORD),
1353         LintId::of(&neg_multiply::NEG_MULTIPLY),
1354         LintId::of(&new_without_default::NEW_WITHOUT_DEFAULT),
1355         LintId::of(&no_effect::NO_EFFECT),
1356         LintId::of(&no_effect::UNNECESSARY_OPERATION),
1357         LintId::of(&non_copy_const::BORROW_INTERIOR_MUTABLE_CONST),
1358         LintId::of(&non_copy_const::DECLARE_INTERIOR_MUTABLE_CONST),
1359         LintId::of(&non_expressive_names::JUST_UNDERSCORES_AND_DIGITS),
1360         LintId::of(&non_expressive_names::MANY_SINGLE_CHAR_NAMES),
1361         LintId::of(&open_options::NONSENSICAL_OPEN_OPTIONS),
1362         LintId::of(&option_env_unwrap::OPTION_ENV_UNWRAP),
1363         LintId::of(&overflow_check_conditional::OVERFLOW_CHECK_CONDITIONAL),
1364         LintId::of(&panic_unimplemented::PANIC_PARAMS),
1365         LintId::of(&partialeq_ne_impl::PARTIALEQ_NE_IMPL),
1366         LintId::of(&precedence::PRECEDENCE),
1367         LintId::of(&ptr::CMP_NULL),
1368         LintId::of(&ptr::MUT_FROM_REF),
1369         LintId::of(&ptr::PTR_ARG),
1370         LintId::of(&ptr_offset_with_cast::PTR_OFFSET_WITH_CAST),
1371         LintId::of(&question_mark::QUESTION_MARK),
1372         LintId::of(&ranges::RANGE_MINUS_ONE),
1373         LintId::of(&ranges::RANGE_ZIP_WITH_LEN),
1374         LintId::of(&ranges::REVERSED_EMPTY_RANGES),
1375         LintId::of(&redundant_clone::REDUNDANT_CLONE),
1376         LintId::of(&redundant_field_names::REDUNDANT_FIELD_NAMES),
1377         LintId::of(&redundant_pattern_matching::REDUNDANT_PATTERN_MATCHING),
1378         LintId::of(&redundant_static_lifetimes::REDUNDANT_STATIC_LIFETIMES),
1379         LintId::of(&reference::DEREF_ADDROF),
1380         LintId::of(&reference::REF_IN_DEREF),
1381         LintId::of(&regex::INVALID_REGEX),
1382         LintId::of(&regex::REGEX_MACRO),
1383         LintId::of(&regex::TRIVIAL_REGEX),
1384         LintId::of(&returns::LET_AND_RETURN),
1385         LintId::of(&returns::NEEDLESS_RETURN),
1386         LintId::of(&returns::UNUSED_UNIT),
1387         LintId::of(&serde_api::SERDE_API_MISUSE),
1388         LintId::of(&single_component_path_imports::SINGLE_COMPONENT_PATH_IMPORTS),
1389         LintId::of(&slow_vector_initialization::SLOW_VECTOR_INITIALIZATION),
1390         LintId::of(&strings::STRING_LIT_AS_BYTES),
1391         LintId::of(&suspicious_trait_impl::SUSPICIOUS_ARITHMETIC_IMPL),
1392         LintId::of(&suspicious_trait_impl::SUSPICIOUS_OP_ASSIGN_IMPL),
1393         LintId::of(&swap::ALMOST_SWAPPED),
1394         LintId::of(&swap::MANUAL_SWAP),
1395         LintId::of(&tabs_in_doc_comments::TABS_IN_DOC_COMMENTS),
1396         LintId::of(&temporary_assignment::TEMPORARY_ASSIGNMENT),
1397         LintId::of(&to_digit_is_some::TO_DIGIT_IS_SOME),
1398         LintId::of(&transmute::CROSSPOINTER_TRANSMUTE),
1399         LintId::of(&transmute::TRANSMUTE_BYTES_TO_STR),
1400         LintId::of(&transmute::TRANSMUTE_FLOAT_TO_INT),
1401         LintId::of(&transmute::TRANSMUTE_INT_TO_BOOL),
1402         LintId::of(&transmute::TRANSMUTE_INT_TO_CHAR),
1403         LintId::of(&transmute::TRANSMUTE_INT_TO_FLOAT),
1404         LintId::of(&transmute::TRANSMUTE_PTR_TO_PTR),
1405         LintId::of(&transmute::TRANSMUTE_PTR_TO_REF),
1406         LintId::of(&transmute::UNSOUND_COLLECTION_TRANSMUTE),
1407         LintId::of(&transmute::WRONG_TRANSMUTE),
1408         LintId::of(&transmuting_null::TRANSMUTING_NULL),
1409         LintId::of(&try_err::TRY_ERR),
1410         LintId::of(&types::ABSURD_EXTREME_COMPARISONS),
1411         LintId::of(&types::BORROWED_BOX),
1412         LintId::of(&types::BOX_VEC),
1413         LintId::of(&types::CAST_PTR_ALIGNMENT),
1414         LintId::of(&types::CAST_REF_TO_MUT),
1415         LintId::of(&types::CHAR_LIT_AS_U8),
1416         LintId::of(&types::FN_TO_NUMERIC_CAST),
1417         LintId::of(&types::FN_TO_NUMERIC_CAST_WITH_TRUNCATION),
1418         LintId::of(&types::REDUNDANT_ALLOCATION),
1419         LintId::of(&types::TYPE_COMPLEXITY),
1420         LintId::of(&types::UNIT_ARG),
1421         LintId::of(&types::UNIT_CMP),
1422         LintId::of(&types::UNNECESSARY_CAST),
1423         LintId::of(&types::VEC_BOX),
1424         LintId::of(&unicode::ZERO_WIDTH_SPACE),
1425         LintId::of(&unnamed_address::FN_ADDRESS_COMPARISONS),
1426         LintId::of(&unnamed_address::VTABLE_ADDRESS_COMPARISONS),
1427         LintId::of(&unsafe_removed_from_name::UNSAFE_REMOVED_FROM_NAME),
1428         LintId::of(&unused_io_amount::UNUSED_IO_AMOUNT),
1429         LintId::of(&unwrap::PANICKING_UNWRAP),
1430         LintId::of(&unwrap::UNNECESSARY_UNWRAP),
1431         LintId::of(&useless_conversion::USELESS_CONVERSION),
1432         LintId::of(&vec::USELESS_VEC),
1433         LintId::of(&write::PRINTLN_EMPTY_STRING),
1434         LintId::of(&write::PRINT_LITERAL),
1435         LintId::of(&write::PRINT_WITH_NEWLINE),
1436         LintId::of(&write::WRITELN_EMPTY_STRING),
1437         LintId::of(&write::WRITE_LITERAL),
1438         LintId::of(&write::WRITE_WITH_NEWLINE),
1439         LintId::of(&zero_div_zero::ZERO_DIVIDED_BY_ZERO),
1440     ]);
1441
1442     store.register_group(true, "clippy::style", Some("clippy_style"), vec![
1443         LintId::of(&assertions_on_constants::ASSERTIONS_ON_CONSTANTS),
1444         LintId::of(&assign_ops::ASSIGN_OP_PATTERN),
1445         LintId::of(&attrs::UNKNOWN_CLIPPY_LINTS),
1446         LintId::of(&bit_mask::VERBOSE_BIT_MASK),
1447         LintId::of(&blacklisted_name::BLACKLISTED_NAME),
1448         LintId::of(&blocks_in_if_conditions::BLOCKS_IN_IF_CONDITIONS),
1449         LintId::of(&collapsible_if::COLLAPSIBLE_IF),
1450         LintId::of(&comparison_chain::COMPARISON_CHAIN),
1451         LintId::of(&doc::MISSING_SAFETY_DOC),
1452         LintId::of(&doc::NEEDLESS_DOCTEST_MAIN),
1453         LintId::of(&enum_variants::ENUM_VARIANT_NAMES),
1454         LintId::of(&enum_variants::MODULE_INCEPTION),
1455         LintId::of(&eq_op::OP_REF),
1456         LintId::of(&eta_reduction::REDUNDANT_CLOSURE),
1457         LintId::of(&float_literal::EXCESSIVE_PRECISION),
1458         LintId::of(&formatting::SUSPICIOUS_ASSIGNMENT_FORMATTING),
1459         LintId::of(&formatting::SUSPICIOUS_ELSE_FORMATTING),
1460         LintId::of(&formatting::SUSPICIOUS_UNARY_OP_FORMATTING),
1461         LintId::of(&functions::DOUBLE_MUST_USE),
1462         LintId::of(&functions::MUST_USE_UNIT),
1463         LintId::of(&if_let_some_result::IF_LET_SOME_RESULT),
1464         LintId::of(&inherent_to_string::INHERENT_TO_STRING),
1465         LintId::of(&len_zero::LEN_WITHOUT_IS_EMPTY),
1466         LintId::of(&len_zero::LEN_ZERO),
1467         LintId::of(&literal_representation::INCONSISTENT_DIGIT_GROUPING),
1468         LintId::of(&loops::EMPTY_LOOP),
1469         LintId::of(&loops::FOR_KV_MAP),
1470         LintId::of(&loops::NEEDLESS_RANGE_LOOP),
1471         LintId::of(&loops::WHILE_LET_ON_ITERATOR),
1472         LintId::of(&main_recursion::MAIN_RECURSION),
1473         LintId::of(&manual_async_fn::MANUAL_ASYNC_FN),
1474         LintId::of(&manual_non_exhaustive::MANUAL_NON_EXHAUSTIVE),
1475         LintId::of(&map_clone::MAP_CLONE),
1476         LintId::of(&matches::INFALLIBLE_DESTRUCTURING_MATCH),
1477         LintId::of(&matches::MATCH_OVERLAPPING_ARM),
1478         LintId::of(&matches::MATCH_REF_PATS),
1479         LintId::of(&matches::SINGLE_MATCH),
1480         LintId::of(&mem_replace::MEM_REPLACE_OPTION_WITH_NONE),
1481         LintId::of(&mem_replace::MEM_REPLACE_WITH_DEFAULT),
1482         LintId::of(&methods::CHARS_LAST_CMP),
1483         LintId::of(&methods::CHARS_NEXT_CMP),
1484         LintId::of(&methods::INTO_ITER_ON_REF),
1485         LintId::of(&methods::ITER_CLONED_COLLECT),
1486         LintId::of(&methods::ITER_NTH_ZERO),
1487         LintId::of(&methods::ITER_SKIP_NEXT),
1488         LintId::of(&methods::MANUAL_SATURATING_ARITHMETIC),
1489         LintId::of(&methods::NEW_RET_NO_SELF),
1490         LintId::of(&methods::OK_EXPECT),
1491         LintId::of(&methods::OPTION_MAP_OR_NONE),
1492         LintId::of(&methods::RESULT_MAP_OR_INTO_OPTION),
1493         LintId::of(&methods::SHOULD_IMPLEMENT_TRAIT),
1494         LintId::of(&methods::STRING_EXTEND_CHARS),
1495         LintId::of(&methods::UNNECESSARY_FOLD),
1496         LintId::of(&methods::WRONG_SELF_CONVENTION),
1497         LintId::of(&misc::TOPLEVEL_REF_ARG),
1498         LintId::of(&misc::ZERO_PTR),
1499         LintId::of(&misc_early::BUILTIN_TYPE_SHADOW),
1500         LintId::of(&misc_early::DOUBLE_NEG),
1501         LintId::of(&misc_early::DUPLICATE_UNDERSCORE_ARGUMENT),
1502         LintId::of(&misc_early::MIXED_CASE_HEX_LITERALS),
1503         LintId::of(&misc_early::REDUNDANT_PATTERN),
1504         LintId::of(&mut_reference::UNNECESSARY_MUT_PASSED),
1505         LintId::of(&neg_multiply::NEG_MULTIPLY),
1506         LintId::of(&new_without_default::NEW_WITHOUT_DEFAULT),
1507         LintId::of(&non_expressive_names::JUST_UNDERSCORES_AND_DIGITS),
1508         LintId::of(&non_expressive_names::MANY_SINGLE_CHAR_NAMES),
1509         LintId::of(&panic_unimplemented::PANIC_PARAMS),
1510         LintId::of(&ptr::CMP_NULL),
1511         LintId::of(&ptr::PTR_ARG),
1512         LintId::of(&question_mark::QUESTION_MARK),
1513         LintId::of(&redundant_field_names::REDUNDANT_FIELD_NAMES),
1514         LintId::of(&redundant_pattern_matching::REDUNDANT_PATTERN_MATCHING),
1515         LintId::of(&redundant_static_lifetimes::REDUNDANT_STATIC_LIFETIMES),
1516         LintId::of(&regex::REGEX_MACRO),
1517         LintId::of(&regex::TRIVIAL_REGEX),
1518         LintId::of(&returns::LET_AND_RETURN),
1519         LintId::of(&returns::NEEDLESS_RETURN),
1520         LintId::of(&returns::UNUSED_UNIT),
1521         LintId::of(&single_component_path_imports::SINGLE_COMPONENT_PATH_IMPORTS),
1522         LintId::of(&strings::STRING_LIT_AS_BYTES),
1523         LintId::of(&tabs_in_doc_comments::TABS_IN_DOC_COMMENTS),
1524         LintId::of(&to_digit_is_some::TO_DIGIT_IS_SOME),
1525         LintId::of(&try_err::TRY_ERR),
1526         LintId::of(&types::FN_TO_NUMERIC_CAST),
1527         LintId::of(&types::FN_TO_NUMERIC_CAST_WITH_TRUNCATION),
1528         LintId::of(&unsafe_removed_from_name::UNSAFE_REMOVED_FROM_NAME),
1529         LintId::of(&write::PRINTLN_EMPTY_STRING),
1530         LintId::of(&write::PRINT_LITERAL),
1531         LintId::of(&write::PRINT_WITH_NEWLINE),
1532         LintId::of(&write::WRITELN_EMPTY_STRING),
1533         LintId::of(&write::WRITE_LITERAL),
1534         LintId::of(&write::WRITE_WITH_NEWLINE),
1535     ]);
1536
1537     store.register_group(true, "clippy::complexity", Some("clippy_complexity"), vec![
1538         LintId::of(&assign_ops::MISREFACTORED_ASSIGN_OP),
1539         LintId::of(&attrs::DEPRECATED_CFG_ATTR),
1540         LintId::of(&booleans::NONMINIMAL_BOOL),
1541         LintId::of(&double_comparison::DOUBLE_COMPARISONS),
1542         LintId::of(&double_parens::DOUBLE_PARENS),
1543         LintId::of(&duration_subsec::DURATION_SUBSEC),
1544         LintId::of(&eval_order_dependence::DIVERGING_SUB_EXPRESSION),
1545         LintId::of(&eval_order_dependence::EVAL_ORDER_DEPENDENCE),
1546         LintId::of(&explicit_write::EXPLICIT_WRITE),
1547         LintId::of(&format::USELESS_FORMAT),
1548         LintId::of(&functions::TOO_MANY_ARGUMENTS),
1549         LintId::of(&get_last_with_len::GET_LAST_WITH_LEN),
1550         LintId::of(&identity_op::IDENTITY_OP),
1551         LintId::of(&int_plus_one::INT_PLUS_ONE),
1552         LintId::of(&lifetimes::EXTRA_UNUSED_LIFETIMES),
1553         LintId::of(&lifetimes::NEEDLESS_LIFETIMES),
1554         LintId::of(&loops::EXPLICIT_COUNTER_LOOP),
1555         LintId::of(&loops::MUT_RANGE_BOUND),
1556         LintId::of(&loops::WHILE_LET_LOOP),
1557         LintId::of(&map_unit_fn::OPTION_MAP_UNIT_FN),
1558         LintId::of(&map_unit_fn::RESULT_MAP_UNIT_FN),
1559         LintId::of(&matches::MATCH_AS_REF),
1560         LintId::of(&matches::MATCH_SINGLE_BINDING),
1561         LintId::of(&matches::WILDCARD_IN_OR_PATTERNS),
1562         LintId::of(&methods::BIND_INSTEAD_OF_MAP),
1563         LintId::of(&methods::CLONE_ON_COPY),
1564         LintId::of(&methods::FILTER_NEXT),
1565         LintId::of(&methods::FLAT_MAP_IDENTITY),
1566         LintId::of(&methods::OPTION_AS_REF_DEREF),
1567         LintId::of(&methods::SEARCH_IS_SOME),
1568         LintId::of(&methods::SKIP_WHILE_NEXT),
1569         LintId::of(&methods::SUSPICIOUS_MAP),
1570         LintId::of(&methods::UNNECESSARY_FILTER_MAP),
1571         LintId::of(&methods::USELESS_ASREF),
1572         LintId::of(&misc::SHORT_CIRCUIT_STATEMENT),
1573         LintId::of(&misc_early::REDUNDANT_CLOSURE_CALL),
1574         LintId::of(&misc_early::UNNEEDED_WILDCARD_PATTERN),
1575         LintId::of(&misc_early::ZERO_PREFIXED_LITERAL),
1576         LintId::of(&needless_bool::BOOL_COMPARISON),
1577         LintId::of(&needless_bool::NEEDLESS_BOOL),
1578         LintId::of(&needless_borrowed_ref::NEEDLESS_BORROWED_REFERENCE),
1579         LintId::of(&needless_update::NEEDLESS_UPDATE),
1580         LintId::of(&neg_cmp_op_on_partial_ord::NEG_CMP_OP_ON_PARTIAL_ORD),
1581         LintId::of(&no_effect::NO_EFFECT),
1582         LintId::of(&no_effect::UNNECESSARY_OPERATION),
1583         LintId::of(&overflow_check_conditional::OVERFLOW_CHECK_CONDITIONAL),
1584         LintId::of(&partialeq_ne_impl::PARTIALEQ_NE_IMPL),
1585         LintId::of(&precedence::PRECEDENCE),
1586         LintId::of(&ptr_offset_with_cast::PTR_OFFSET_WITH_CAST),
1587         LintId::of(&ranges::RANGE_MINUS_ONE),
1588         LintId::of(&ranges::RANGE_ZIP_WITH_LEN),
1589         LintId::of(&reference::DEREF_ADDROF),
1590         LintId::of(&reference::REF_IN_DEREF),
1591         LintId::of(&swap::MANUAL_SWAP),
1592         LintId::of(&temporary_assignment::TEMPORARY_ASSIGNMENT),
1593         LintId::of(&transmute::CROSSPOINTER_TRANSMUTE),
1594         LintId::of(&transmute::TRANSMUTE_BYTES_TO_STR),
1595         LintId::of(&transmute::TRANSMUTE_FLOAT_TO_INT),
1596         LintId::of(&transmute::TRANSMUTE_INT_TO_BOOL),
1597         LintId::of(&transmute::TRANSMUTE_INT_TO_CHAR),
1598         LintId::of(&transmute::TRANSMUTE_INT_TO_FLOAT),
1599         LintId::of(&transmute::TRANSMUTE_PTR_TO_PTR),
1600         LintId::of(&transmute::TRANSMUTE_PTR_TO_REF),
1601         LintId::of(&types::BORROWED_BOX),
1602         LintId::of(&types::CHAR_LIT_AS_U8),
1603         LintId::of(&types::TYPE_COMPLEXITY),
1604         LintId::of(&types::UNIT_ARG),
1605         LintId::of(&types::UNNECESSARY_CAST),
1606         LintId::of(&types::VEC_BOX),
1607         LintId::of(&unwrap::UNNECESSARY_UNWRAP),
1608         LintId::of(&useless_conversion::USELESS_CONVERSION),
1609         LintId::of(&zero_div_zero::ZERO_DIVIDED_BY_ZERO),
1610     ]);
1611
1612     store.register_group(true, "clippy::correctness", Some("clippy_correctness"), vec![
1613         LintId::of(&approx_const::APPROX_CONSTANT),
1614         LintId::of(&atomic_ordering::INVALID_ATOMIC_ORDERING),
1615         LintId::of(&attrs::DEPRECATED_SEMVER),
1616         LintId::of(&attrs::MISMATCHED_TARGET_OS),
1617         LintId::of(&attrs::USELESS_ATTRIBUTE),
1618         LintId::of(&bit_mask::BAD_BIT_MASK),
1619         LintId::of(&bit_mask::INEFFECTIVE_BIT_MASK),
1620         LintId::of(&booleans::LOGIC_BUG),
1621         LintId::of(&copies::IFS_SAME_COND),
1622         LintId::of(&copies::IF_SAME_THEN_ELSE),
1623         LintId::of(&derive::DERIVE_HASH_XOR_EQ),
1624         LintId::of(&drop_bounds::DROP_BOUNDS),
1625         LintId::of(&drop_forget_ref::DROP_COPY),
1626         LintId::of(&drop_forget_ref::DROP_REF),
1627         LintId::of(&drop_forget_ref::FORGET_COPY),
1628         LintId::of(&drop_forget_ref::FORGET_REF),
1629         LintId::of(&enum_clike::ENUM_CLIKE_UNPORTABLE_VARIANT),
1630         LintId::of(&eq_op::EQ_OP),
1631         LintId::of(&erasing_op::ERASING_OP),
1632         LintId::of(&formatting::POSSIBLE_MISSING_COMMA),
1633         LintId::of(&functions::NOT_UNSAFE_PTR_ARG_DEREF),
1634         LintId::of(&if_let_mutex::IF_LET_MUTEX),
1635         LintId::of(&indexing_slicing::OUT_OF_BOUNDS_INDEXING),
1636         LintId::of(&infinite_iter::INFINITE_ITER),
1637         LintId::of(&inherent_to_string::INHERENT_TO_STRING_SHADOW_DISPLAY),
1638         LintId::of(&inline_fn_without_body::INLINE_FN_WITHOUT_BODY),
1639         LintId::of(&let_underscore::LET_UNDERSCORE_LOCK),
1640         LintId::of(&literal_representation::MISTYPED_LITERAL_SUFFIXES),
1641         LintId::of(&loops::FOR_LOOPS_OVER_FALLIBLES),
1642         LintId::of(&loops::ITER_NEXT_LOOP),
1643         LintId::of(&loops::NEVER_LOOP),
1644         LintId::of(&loops::WHILE_IMMUTABLE_CONDITION),
1645         LintId::of(&mem_discriminant::MEM_DISCRIMINANT_NON_ENUM),
1646         LintId::of(&mem_replace::MEM_REPLACE_WITH_UNINIT),
1647         LintId::of(&methods::CLONE_DOUBLE_REF),
1648         LintId::of(&methods::ITERATOR_STEP_BY_ZERO),
1649         LintId::of(&methods::TEMPORARY_CSTRING_AS_PTR),
1650         LintId::of(&methods::UNINIT_ASSUMED_INIT),
1651         LintId::of(&methods::ZST_OFFSET),
1652         LintId::of(&minmax::MIN_MAX),
1653         LintId::of(&misc::CMP_NAN),
1654         LintId::of(&misc::FLOAT_CMP),
1655         LintId::of(&misc::MODULO_ONE),
1656         LintId::of(&mut_key::MUTABLE_KEY_TYPE),
1657         LintId::of(&non_copy_const::BORROW_INTERIOR_MUTABLE_CONST),
1658         LintId::of(&non_copy_const::DECLARE_INTERIOR_MUTABLE_CONST),
1659         LintId::of(&open_options::NONSENSICAL_OPEN_OPTIONS),
1660         LintId::of(&option_env_unwrap::OPTION_ENV_UNWRAP),
1661         LintId::of(&ptr::MUT_FROM_REF),
1662         LintId::of(&ranges::REVERSED_EMPTY_RANGES),
1663         LintId::of(&regex::INVALID_REGEX),
1664         LintId::of(&serde_api::SERDE_API_MISUSE),
1665         LintId::of(&suspicious_trait_impl::SUSPICIOUS_ARITHMETIC_IMPL),
1666         LintId::of(&suspicious_trait_impl::SUSPICIOUS_OP_ASSIGN_IMPL),
1667         LintId::of(&swap::ALMOST_SWAPPED),
1668         LintId::of(&transmute::UNSOUND_COLLECTION_TRANSMUTE),
1669         LintId::of(&transmute::WRONG_TRANSMUTE),
1670         LintId::of(&transmuting_null::TRANSMUTING_NULL),
1671         LintId::of(&types::ABSURD_EXTREME_COMPARISONS),
1672         LintId::of(&types::CAST_PTR_ALIGNMENT),
1673         LintId::of(&types::CAST_REF_TO_MUT),
1674         LintId::of(&types::UNIT_CMP),
1675         LintId::of(&unicode::ZERO_WIDTH_SPACE),
1676         LintId::of(&unnamed_address::FN_ADDRESS_COMPARISONS),
1677         LintId::of(&unnamed_address::VTABLE_ADDRESS_COMPARISONS),
1678         LintId::of(&unused_io_amount::UNUSED_IO_AMOUNT),
1679         LintId::of(&unwrap::PANICKING_UNWRAP),
1680     ]);
1681
1682     store.register_group(true, "clippy::perf", Some("clippy_perf"), vec![
1683         LintId::of(&bytecount::NAIVE_BYTECOUNT),
1684         LintId::of(&entry::MAP_ENTRY),
1685         LintId::of(&escape::BOXED_LOCAL),
1686         LintId::of(&large_const_arrays::LARGE_CONST_ARRAYS),
1687         LintId::of(&large_enum_variant::LARGE_ENUM_VARIANT),
1688         LintId::of(&loops::MANUAL_MEMCPY),
1689         LintId::of(&loops::NEEDLESS_COLLECT),
1690         LintId::of(&methods::EXPECT_FUN_CALL),
1691         LintId::of(&methods::ITER_NTH),
1692         LintId::of(&methods::OR_FUN_CALL),
1693         LintId::of(&methods::SINGLE_CHAR_PATTERN),
1694         LintId::of(&misc::CMP_OWNED),
1695         LintId::of(&mutex_atomic::MUTEX_ATOMIC),
1696         LintId::of(&redundant_clone::REDUNDANT_CLONE),
1697         LintId::of(&slow_vector_initialization::SLOW_VECTOR_INITIALIZATION),
1698         LintId::of(&types::BOX_VEC),
1699         LintId::of(&types::REDUNDANT_ALLOCATION),
1700         LintId::of(&vec::USELESS_VEC),
1701     ]);
1702
1703     store.register_group(true, "clippy::cargo", Some("clippy_cargo"), vec![
1704         LintId::of(&cargo_common_metadata::CARGO_COMMON_METADATA),
1705         LintId::of(&multiple_crate_versions::MULTIPLE_CRATE_VERSIONS),
1706         LintId::of(&wildcard_dependencies::WILDCARD_DEPENDENCIES),
1707     ]);
1708
1709     store.register_group(true, "clippy::nursery", Some("clippy_nursery"), vec![
1710         LintId::of(&attrs::EMPTY_LINE_AFTER_OUTER_ATTR),
1711         LintId::of(&cognitive_complexity::COGNITIVE_COMPLEXITY),
1712         LintId::of(&fallible_impl_from::FALLIBLE_IMPL_FROM),
1713         LintId::of(&floating_point_arithmetic::IMPRECISE_FLOPS),
1714         LintId::of(&floating_point_arithmetic::SUBOPTIMAL_FLOPS),
1715         LintId::of(&future_not_send::FUTURE_NOT_SEND),
1716         LintId::of(&let_if_seq::USELESS_LET_IF_SEQ),
1717         LintId::of(&missing_const_for_fn::MISSING_CONST_FOR_FN),
1718         LintId::of(&mutable_debug_assertion::DEBUG_ASSERT_WITH_MUT_CALL),
1719         LintId::of(&mutex_atomic::MUTEX_INTEGER),
1720         LintId::of(&needless_borrow::NEEDLESS_BORROW),
1721         LintId::of(&path_buf_push_overwrite::PATH_BUF_PUSH_OVERWRITE),
1722         LintId::of(&redundant_pub_crate::REDUNDANT_PUB_CRATE),
1723         LintId::of(&transmute::USELESS_TRANSMUTE),
1724         LintId::of(&use_self::USE_SELF),
1725     ]);
1726 }
1727
1728 #[rustfmt::skip]
1729 fn register_removed_non_tool_lints(store: &mut rustc_lint::LintStore) {
1730     store.register_removed(
1731         "should_assert_eq",
1732         "`assert!()` will be more flexible with RFC 2011",
1733     );
1734     store.register_removed(
1735         "extend_from_slice",
1736         "`.extend_from_slice(_)` is a faster way to extend a Vec by a slice",
1737     );
1738     store.register_removed(
1739         "range_step_by_zero",
1740         "`iterator.step_by(0)` panics nowadays",
1741     );
1742     store.register_removed(
1743         "unstable_as_slice",
1744         "`Vec::as_slice` has been stabilized in 1.7",
1745     );
1746     store.register_removed(
1747         "unstable_as_mut_slice",
1748         "`Vec::as_mut_slice` has been stabilized in 1.7",
1749     );
1750     store.register_removed(
1751         "str_to_string",
1752         "using `str::to_string` is common even today and specialization will likely happen soon",
1753     );
1754     store.register_removed(
1755         "string_to_string",
1756         "using `string::to_string` is common even today and specialization will likely happen soon",
1757     );
1758     store.register_removed(
1759         "misaligned_transmute",
1760         "this lint has been split into cast_ptr_alignment and transmute_ptr_to_ptr",
1761     );
1762     store.register_removed(
1763         "assign_ops",
1764         "using compound assignment operators (e.g., `+=`) is harmless",
1765     );
1766     store.register_removed(
1767         "if_let_redundant_pattern_matching",
1768         "this lint has been changed to redundant_pattern_matching",
1769     );
1770     store.register_removed(
1771         "unsafe_vector_initialization",
1772         "the replacement suggested by this lint had substantially different behavior",
1773     );
1774     store.register_removed(
1775         "reverse_range_loop",
1776         "this lint is now included in reversed_empty_ranges",
1777     );
1778 }
1779
1780 /// Register renamed lints.
1781 ///
1782 /// Used in `./src/driver.rs`.
1783 pub fn register_renamed(ls: &mut rustc_lint::LintStore) {
1784     ls.register_renamed("clippy::stutter", "clippy::module_name_repetitions");
1785     ls.register_renamed("clippy::new_without_default_derive", "clippy::new_without_default");
1786     ls.register_renamed("clippy::cyclomatic_complexity", "clippy::cognitive_complexity");
1787     ls.register_renamed("clippy::const_static_lifetime", "clippy::redundant_static_lifetimes");
1788     ls.register_renamed("clippy::option_and_then_some", "clippy::bind_instead_of_map");
1789     ls.register_renamed("clippy::block_in_if_condition_expr", "clippy::blocks_in_if_conditions");
1790     ls.register_renamed("clippy::block_in_if_condition_stmt", "clippy::blocks_in_if_conditions");
1791     ls.register_renamed("clippy::option_map_unwrap_or", "clippy::map_unwrap_or");
1792     ls.register_renamed("clippy::option_map_unwrap_or_else", "clippy::map_unwrap_or");
1793     ls.register_renamed("clippy::result_map_unwrap_or_else", "clippy::map_unwrap_or");
1794     ls.register_renamed("clippy::option_unwrap_used", "clippy::unwrap_used");
1795     ls.register_renamed("clippy::result_unwrap_used", "clippy::unwrap_used");
1796     ls.register_renamed("clippy::option_expect_used", "clippy::expect_used");
1797     ls.register_renamed("clippy::result_expect_used", "clippy::expect_used");
1798     ls.register_renamed("clippy::for_loop_over_option", "clippy::for_loops_over_fallibles");
1799     ls.register_renamed("clippy::for_loop_over_result", "clippy::for_loops_over_fallibles");
1800     ls.register_renamed("clippy::identity_conversion", "clippy::useless_conversion");
1801 }
1802
1803 // only exists to let the dogfood integration test works.
1804 // Don't run clippy as an executable directly
1805 #[allow(dead_code)]
1806 fn main() {
1807     panic!("Please use the cargo-clippy executable");
1808 }