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