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