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