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