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