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