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