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