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