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