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