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