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