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