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