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