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