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