1 // error-pattern:cargo-clippy
3 #![feature(box_syntax)]
4 #![feature(rustc_private)]
5 #![feature(slice_patterns)]
6 #![feature(stmt_expr_attributes)]
7 #![feature(range_contains)]
8 #![allow(clippy::missing_docs_in_private_items)]
9 #![recursion_limit = "256"]
10 #![warn(rust_2018_idioms, trivial_casts, trivial_numeric_casts)]
11 #![feature(crate_visibility_modifier)]
13 // FIXME: switch to something more ergonomic here, once available.
14 // (currently there is no way to opt into sysroot crates w/o `extern crate`)
15 #[allow(unused_extern_crates)]
16 extern crate fmt_macros;
17 #[allow(unused_extern_crates)]
19 #[allow(unused_extern_crates)]
20 extern crate rustc_data_structures;
21 #[allow(unused_extern_crates)]
22 extern crate rustc_errors;
23 #[allow(unused_extern_crates)]
24 extern crate rustc_mir;
25 #[allow(unused_extern_crates)]
26 extern crate rustc_plugin;
27 #[allow(unused_extern_crates)]
28 extern crate rustc_target;
29 #[allow(unused_extern_crates)]
30 extern crate rustc_typeck;
31 #[allow(unused_extern_crates)]
33 #[allow(unused_extern_crates)]
34 extern crate syntax_pos;
38 /// Macro used to declare a Clippy lint.
40 /// Every lint declaration consists of 4 parts:
42 /// 1. The documentation, which is used for the website
43 /// 2. The `LINT_NAME`. See [lint naming][lint_naming] on lint naming conventions.
44 /// 3. The `lint_level`, which is a mapping from *one* of our lint groups to `Allow`, `Warn` or
45 /// `Deny`. The lint level here has nothing to do with what lint groups the lint is a part of.
46 /// 4. The `description` that contains a short explanation on what's wrong with code where the
47 /// lint is triggered.
49 /// Currently the categories `style`, `correctness`, `complexity` and `perf` are enabled by default.
50 /// As said in the README.md of this repository, if the lint level mapping changes, please update
56 /// # #![feature(rustc_private)]
57 /// # #[allow(unused_extern_crates)]
58 /// # extern crate rustc;
60 /// # use clippy_lints::declare_clippy_lint;
61 /// use rustc::declare_tool_lint;
63 /// declare_clippy_lint! {
64 /// /// **What it does:** Checks for ... (describe what the lint matches).
66 /// /// **Why is this bad?** Supply the reason for linting the code.
68 /// /// **Known problems:** None. (Or describe where it could go wrong.)
74 /// /// Insert a short example of code that triggers the lint
77 /// /// Insert a short example of improved code that doesn't trigger the lint
84 /// [lint_naming]: https://rust-lang.github.io/rfcs/0344-conventions-galore.html#lints
86 macro_rules! declare_clippy_lint {
87 { $(#[$attr:meta])* pub $name:tt, style, $description:tt } => {
89 $(#[$attr])* pub clippy::$name, Warn, $description, report_in_external_macro: true
92 { $(#[$attr:meta])* pub $name:tt, correctness, $description:tt } => {
94 $(#[$attr])* pub clippy::$name, Deny, $description, report_in_external_macro: true
97 { $(#[$attr:meta])* pub $name:tt, complexity, $description:tt } => {
99 pub clippy::$name, Warn, $description, report_in_external_macro: true
102 { $(#[$attr:meta])* pub $name:tt, perf, $description:tt } => {
104 pub clippy::$name, Warn, $description, report_in_external_macro: true
107 { $(#[$attr:meta])* pub $name:tt, pedantic, $description:tt } => {
109 pub clippy::$name, Allow, $description, report_in_external_macro: true
112 { $(#[$attr:meta])* pub $name:tt, restriction, $description:tt } => {
114 pub clippy::$name, Allow, $description, report_in_external_macro: true
117 { $(#[$attr:meta])* pub $name:tt, cargo, $description:tt } => {
119 pub clippy::$name, Allow, $description, report_in_external_macro: true
122 { $(#[$attr:meta])* pub $name:tt, nursery, $description:tt } => {
124 pub clippy::$name, Allow, $description, report_in_external_macro: true
127 { $(#[$attr:meta])* pub $name:tt, internal, $description:tt } => {
129 pub clippy::$name, Allow, $description, report_in_external_macro: true
132 { $(#[$attr:meta])* pub $name:tt, internal_warn, $description:tt } => {
134 pub clippy::$name, Warn, $description, report_in_external_macro: true
143 // begin lints modules, do not remove this comment, it’s used in `update_lints`
144 pub mod approx_const;
146 pub mod assertions_on_constants;
150 pub mod blacklisted_name;
151 pub mod block_in_if_condition;
154 pub mod cargo_common_metadata;
155 pub mod cognitive_complexity;
156 pub mod collapsible_if;
157 pub mod const_static_lifetime;
159 pub mod copy_iterator;
161 pub mod default_trait_access;
164 pub mod double_comparison;
165 pub mod double_parens;
167 pub mod drop_forget_ref;
168 pub mod duration_subsec;
169 pub mod else_if_without_else;
173 pub mod enum_glob_use;
174 pub mod enum_variants;
178 pub mod eta_reduction;
179 pub mod eval_order_dependence;
180 pub mod excessive_precision;
181 pub mod explicit_write;
182 pub mod fallible_impl_from;
186 pub mod identity_conversion;
189 pub mod implicit_return;
190 pub mod indexing_slicing;
191 pub mod infallible_destructuring_match;
192 pub mod infinite_iter;
193 pub mod inherent_impl;
194 pub mod inline_fn_without_body;
195 pub mod int_plus_one;
197 pub mod items_after_statements;
198 pub mod large_enum_variant;
202 pub mod literal_representation;
207 pub mod mem_discriminant;
214 pub mod missing_const_for_fn;
216 pub mod missing_inline;
217 pub mod multiple_crate_versions;
219 pub mod mut_reference;
220 pub mod mutex_atomic;
221 pub mod needless_bool;
222 pub mod needless_borrow;
223 pub mod needless_borrowed_ref;
224 pub mod needless_continue;
225 pub mod needless_pass_by_value;
226 pub mod needless_update;
227 pub mod neg_cmp_op_on_partial_ord;
228 pub mod neg_multiply;
229 pub mod new_without_default;
231 pub mod non_copy_const;
232 pub mod non_expressive_names;
234 pub mod open_options;
235 pub mod overflow_check_conditional;
236 pub mod panic_unimplemented;
237 pub mod partialeq_ne_impl;
240 pub mod ptr_offset_with_cast;
241 pub mod question_mark;
243 pub mod redundant_clone;
244 pub mod redundant_field_names;
245 pub mod redundant_pattern_matching;
248 pub mod replace_consts;
252 pub mod slow_vector_initialization;
254 pub mod suspicious_trait_impl;
256 pub mod temporary_assignment;
258 pub mod trivially_copy_pass_by_ref;
261 pub mod unsafe_removed_from_name;
262 pub mod unused_io_amount;
263 pub mod unused_label;
267 pub mod wildcard_dependencies;
269 pub mod zero_div_zero;
270 // end lints modules, do not remove this comment, it’s used in `update_lints`
272 pub use crate::utils::conf::Conf;
275 crate use syntax::ast::Name;
278 /// Register all pre expansion lints
280 /// Pre-expansion lints run before any macro expansion has happened.
282 /// Note that due to the architechture of the compiler, currently `cfg_attr` attributes on crate
283 /// level (i.e `#![cfg_attr(...)]`) will still be expanded even when using a pre-expansion pass.
285 /// Used in `./src/driver.rs`.
286 pub fn register_pre_expansion_lints(
287 session: &rustc::session::Session,
288 store: &mut rustc::lint::LintStore,
291 store.register_pre_expansion_pass(Some(session), true, false, box write::Pass);
292 store.register_pre_expansion_pass(
296 box redundant_field_names::RedundantFieldNames,
298 store.register_pre_expansion_pass(
302 box non_expressive_names::NonExpressiveNames {
303 single_char_binding_names_threshold: conf.single_char_binding_names_threshold,
306 store.register_pre_expansion_pass(Some(session), true, false, box attrs::CfgAttrPass);
307 store.register_pre_expansion_pass(Some(session), true, false, box dbg_macro::Pass);
311 pub fn read_conf(reg: &rustc_plugin::Registry<'_>) -> Conf {
312 match utils::conf::file_from_args(reg.args()) {
314 // if the user specified a file, it must exist, otherwise default to `clippy.toml` but
315 // do not require the file to exist
316 let file_name = if let Some(file_name) = file_name {
319 match utils::conf::lookup_conf_file() {
323 .struct_err(&format!("error finding Clippy's configuration file: {}", error))
330 let file_name = file_name.map(|file_name| {
331 if file_name.is_relative() {
333 .local_crate_source_file
335 .and_then(|file| std::path::Path::new(&file).parent().map(std::path::Path::to_path_buf))
343 let (conf, errors) = utils::conf::read(file_name.as_ref().map(std::convert::AsRef::as_ref));
345 // all conf errors are non-fatal, we just use the default conf in case of error
346 for error in errors {
348 .struct_err(&format!(
349 "error reading Clippy's configuration file `{}`: {}",
350 file_name.as_ref().and_then(|p| p.to_str()).unwrap_or(""),
358 Err((err, span)) => {
360 .struct_span_err(span, err)
361 .span_note(span, "Clippy will use default configuration")
363 toml::from_str("").expect("we never error on empty config files")
368 /// Register all lints and lint groups with the rustc plugin registry
370 /// Used in `./src/driver.rs`.
371 #[allow(clippy::too_many_lines)]
373 pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
374 let mut store = reg.sess.lint_store.borrow_mut();
375 // begin deprecated lints, do not remove this comment, it’s used in `update_lints`
376 store.register_removed(
378 "`assert!()` will be more flexible with RFC 2011",
380 store.register_removed(
382 "`.extend_from_slice(_)` is a faster way to extend a Vec by a slice",
384 store.register_removed(
385 "range_step_by_zero",
386 "`iterator.step_by(0)` panics nowadays",
388 store.register_removed(
390 "`Vec::as_slice` has been stabilized in 1.7",
392 store.register_removed(
393 "unstable_as_mut_slice",
394 "`Vec::as_mut_slice` has been stabilized in 1.7",
396 store.register_removed(
398 "using `str::to_string` is common even today and specialization will likely happen soon",
400 store.register_removed(
402 "using `string::to_string` is common even today and specialization will likely happen soon",
404 store.register_removed(
405 "misaligned_transmute",
406 "this lint has been split into cast_ptr_alignment and transmute_ptr_to_ptr",
408 store.register_removed(
410 "using compound assignment operators (e.g. `+=`) is harmless",
412 store.register_removed(
413 "if_let_redundant_pattern_matching",
414 "this lint has been changed to redundant_pattern_matching",
416 store.register_removed(
417 "unsafe_vector_initialization",
418 "the replacement suggested by this lint had substantially different behavior",
420 // end deprecated lints, do not remove this comment, it’s used in `update_lints`
422 reg.register_late_lint_pass(box serde_api::Serde);
423 reg.register_early_lint_pass(box utils::internal_lints::Clippy);
424 reg.register_late_lint_pass(box utils::internal_lints::CompilerLintFunctions::new());
425 reg.register_early_lint_pass(box utils::internal_lints::DefaultHashTypes::default());
426 reg.register_late_lint_pass(box utils::internal_lints::LintWithoutLintPass::default());
427 reg.register_late_lint_pass(box utils::inspector::Pass);
428 reg.register_late_lint_pass(box utils::author::Pass);
429 reg.register_late_lint_pass(box types::TypePass);
430 reg.register_late_lint_pass(box booleans::NonminimalBool);
431 reg.register_late_lint_pass(box eq_op::EqOp);
432 reg.register_early_lint_pass(box enum_variants::EnumVariantNames::new(conf.enum_variant_name_threshold));
433 reg.register_late_lint_pass(box enum_glob_use::EnumGlobUse);
434 reg.register_late_lint_pass(box enum_clike::UnportableVariant);
435 reg.register_late_lint_pass(box excessive_precision::ExcessivePrecision);
436 reg.register_late_lint_pass(box bit_mask::BitMask::new(conf.verbose_bit_mask_threshold));
437 reg.register_late_lint_pass(box ptr::PointerPass);
438 reg.register_late_lint_pass(box needless_bool::NeedlessBool);
439 reg.register_late_lint_pass(box needless_bool::BoolComparison);
440 reg.register_late_lint_pass(box approx_const::Pass);
441 reg.register_late_lint_pass(box misc::Pass);
442 reg.register_early_lint_pass(box precedence::Precedence);
443 reg.register_early_lint_pass(box needless_continue::NeedlessContinue);
444 reg.register_late_lint_pass(box eta_reduction::EtaPass);
445 reg.register_late_lint_pass(box identity_op::IdentityOp);
446 reg.register_late_lint_pass(box erasing_op::ErasingOp);
447 reg.register_early_lint_pass(box items_after_statements::ItemsAfterStatements);
448 reg.register_late_lint_pass(box mut_mut::MutMut);
449 reg.register_late_lint_pass(box mut_reference::UnnecessaryMutPassed);
450 reg.register_late_lint_pass(box len_zero::LenZero);
451 reg.register_late_lint_pass(box attrs::AttrPass);
452 reg.register_early_lint_pass(box collapsible_if::CollapsibleIf);
453 reg.register_late_lint_pass(box block_in_if_condition::BlockInIfCondition);
454 reg.register_late_lint_pass(box unicode::Unicode);
455 reg.register_late_lint_pass(box strings::StringAdd);
456 reg.register_early_lint_pass(box returns::ReturnPass);
457 reg.register_late_lint_pass(box implicit_return::Pass);
458 reg.register_late_lint_pass(box methods::Pass);
459 reg.register_late_lint_pass(box map_clone::Pass);
460 reg.register_late_lint_pass(box shadow::Pass);
461 reg.register_late_lint_pass(box types::LetPass);
462 reg.register_late_lint_pass(box types::UnitCmp);
463 reg.register_late_lint_pass(box loops::Pass);
464 reg.register_late_lint_pass(box lifetimes::LifetimePass);
465 reg.register_late_lint_pass(box entry::HashMapLint);
466 reg.register_late_lint_pass(box ranges::Pass);
467 reg.register_late_lint_pass(box types::CastPass);
468 reg.register_late_lint_pass(box types::TypeComplexityPass::new(conf.type_complexity_threshold));
469 reg.register_late_lint_pass(box matches::MatchPass);
470 reg.register_late_lint_pass(box minmax::MinMaxPass);
471 reg.register_late_lint_pass(box open_options::NonSensical);
472 reg.register_late_lint_pass(box zero_div_zero::Pass);
473 reg.register_late_lint_pass(box mutex_atomic::MutexAtomic);
474 reg.register_late_lint_pass(box needless_update::Pass);
475 reg.register_late_lint_pass(box needless_borrow::NeedlessBorrow::default());
476 reg.register_late_lint_pass(box needless_borrowed_ref::NeedlessBorrowedRef);
477 reg.register_late_lint_pass(box no_effect::Pass);
478 reg.register_late_lint_pass(box temporary_assignment::Pass);
479 reg.register_late_lint_pass(box transmute::Transmute);
480 reg.register_late_lint_pass(
481 box cognitive_complexity::CognitiveComplexity::new(conf.cognitive_complexity_threshold)
483 reg.register_late_lint_pass(box escape::Pass{too_large_for_stack: conf.too_large_for_stack});
484 reg.register_early_lint_pass(box misc_early::MiscEarly);
485 reg.register_late_lint_pass(box panic_unimplemented::Pass);
486 reg.register_late_lint_pass(box strings::StringLitAsBytes);
487 reg.register_late_lint_pass(box derive::Derive);
488 reg.register_late_lint_pass(box types::CharLitAsU8);
489 reg.register_late_lint_pass(box vec::Pass);
490 reg.register_late_lint_pass(box drop_bounds::Pass);
491 reg.register_late_lint_pass(box drop_forget_ref::Pass);
492 reg.register_late_lint_pass(box empty_enum::EmptyEnum);
493 reg.register_late_lint_pass(box types::AbsurdExtremeComparisons);
494 reg.register_late_lint_pass(box types::InvalidUpcastComparisons);
495 reg.register_late_lint_pass(box regex::Pass::default());
496 reg.register_late_lint_pass(box copies::CopyAndPaste);
497 reg.register_late_lint_pass(box copy_iterator::CopyIterator);
498 reg.register_late_lint_pass(box format::Pass);
499 reg.register_early_lint_pass(box formatting::Formatting);
500 reg.register_late_lint_pass(box swap::Swap);
501 reg.register_early_lint_pass(box if_not_else::IfNotElse);
502 reg.register_early_lint_pass(box else_if_without_else::ElseIfWithoutElse);
503 reg.register_early_lint_pass(box int_plus_one::IntPlusOne);
504 reg.register_late_lint_pass(box overflow_check_conditional::OverflowCheckConditional);
505 reg.register_late_lint_pass(box unused_label::UnusedLabel);
506 reg.register_late_lint_pass(box new_without_default::NewWithoutDefault::default());
507 reg.register_late_lint_pass(box blacklisted_name::BlackListedName::new(
508 conf.blacklisted_names.iter().cloned().collect()
510 reg.register_late_lint_pass(box functions::Functions::new(conf.too_many_arguments_threshold, conf.too_many_lines_threshold));
511 reg.register_early_lint_pass(box doc::Doc::new(conf.doc_valid_idents.iter().cloned().collect()));
512 reg.register_late_lint_pass(box neg_multiply::NegMultiply);
513 reg.register_early_lint_pass(box unsafe_removed_from_name::UnsafeNameRemoval);
514 reg.register_late_lint_pass(box mem_discriminant::MemDiscriminant);
515 reg.register_late_lint_pass(box mem_forget::MemForget);
516 reg.register_late_lint_pass(box mem_replace::MemReplace);
517 reg.register_late_lint_pass(box arithmetic::Arithmetic::default());
518 reg.register_late_lint_pass(box assign_ops::AssignOps);
519 reg.register_late_lint_pass(box let_if_seq::LetIfSeq);
520 reg.register_late_lint_pass(box eval_order_dependence::EvalOrderDependence);
521 reg.register_late_lint_pass(box missing_doc::MissingDoc::new());
522 reg.register_late_lint_pass(box missing_inline::MissingInline);
523 reg.register_late_lint_pass(box ok_if_let::Pass);
524 reg.register_late_lint_pass(box redundant_pattern_matching::Pass);
525 reg.register_late_lint_pass(box partialeq_ne_impl::Pass);
526 reg.register_early_lint_pass(box reference::Pass);
527 reg.register_early_lint_pass(box reference::DerefPass);
528 reg.register_early_lint_pass(box double_parens::DoubleParens);
529 reg.register_late_lint_pass(box unused_io_amount::UnusedIoAmount);
530 reg.register_late_lint_pass(box large_enum_variant::LargeEnumVariant::new(conf.enum_variant_size_threshold));
531 reg.register_late_lint_pass(box explicit_write::Pass);
532 reg.register_late_lint_pass(box needless_pass_by_value::NeedlessPassByValue);
533 reg.register_late_lint_pass(box trivially_copy_pass_by_ref::TriviallyCopyPassByRef::new(
534 conf.trivial_copy_size_limit,
537 reg.register_early_lint_pass(box literal_representation::LiteralDigitGrouping);
538 reg.register_early_lint_pass(box literal_representation::LiteralRepresentation::new(
539 conf.literal_representation_threshold
541 reg.register_late_lint_pass(box use_self::UseSelf);
542 reg.register_late_lint_pass(box bytecount::ByteCount);
543 reg.register_late_lint_pass(box infinite_iter::Pass);
544 reg.register_late_lint_pass(box inline_fn_without_body::Pass);
545 reg.register_late_lint_pass(box invalid_ref::InvalidRef);
546 reg.register_late_lint_pass(box identity_conversion::IdentityConversion::default());
547 reg.register_late_lint_pass(box types::ImplicitHasher);
548 reg.register_early_lint_pass(box const_static_lifetime::StaticConst);
549 reg.register_late_lint_pass(box fallible_impl_from::FallibleImplFrom);
550 reg.register_late_lint_pass(box replace_consts::ReplaceConsts);
551 reg.register_late_lint_pass(box types::UnitArg);
552 reg.register_late_lint_pass(box double_comparison::Pass);
553 reg.register_late_lint_pass(box question_mark::Pass);
554 reg.register_late_lint_pass(box suspicious_trait_impl::SuspiciousImpl);
555 reg.register_early_lint_pass(box cargo_common_metadata::Pass);
556 reg.register_early_lint_pass(box multiple_crate_versions::Pass);
557 reg.register_early_lint_pass(box wildcard_dependencies::Pass);
558 reg.register_late_lint_pass(box map_unit_fn::Pass);
559 reg.register_late_lint_pass(box infallible_destructuring_match::Pass);
560 reg.register_late_lint_pass(box inherent_impl::Pass::default());
561 reg.register_late_lint_pass(box neg_cmp_op_on_partial_ord::NoNegCompOpForPartialOrd);
562 reg.register_late_lint_pass(box unwrap::Pass);
563 reg.register_late_lint_pass(box duration_subsec::DurationSubsec);
564 reg.register_late_lint_pass(box default_trait_access::DefaultTraitAccess);
565 reg.register_late_lint_pass(box indexing_slicing::IndexingSlicing);
566 reg.register_late_lint_pass(box non_copy_const::NonCopyConst);
567 reg.register_late_lint_pass(box ptr_offset_with_cast::Pass);
568 reg.register_late_lint_pass(box redundant_clone::RedundantClone);
569 reg.register_late_lint_pass(box slow_vector_initialization::Pass);
570 reg.register_late_lint_pass(box types::RefToMut);
571 reg.register_late_lint_pass(box assertions_on_constants::AssertionsOnConstants);
572 reg.register_late_lint_pass(box missing_const_for_fn::MissingConstForFn);
574 reg.register_lint_group("clippy::restriction", Some("clippy_restriction"), vec![
575 arithmetic::FLOAT_ARITHMETIC,
576 arithmetic::INTEGER_ARITHMETIC,
577 dbg_macro::DBG_MACRO,
578 else_if_without_else::ELSE_IF_WITHOUT_ELSE,
579 implicit_return::IMPLICIT_RETURN,
580 indexing_slicing::INDEXING_SLICING,
581 inherent_impl::MULTIPLE_INHERENT_IMPL,
582 literal_representation::DECIMAL_LITERAL_REPRESENTATION,
583 matches::WILDCARD_ENUM_MATCH_ARM,
584 mem_forget::MEM_FORGET,
585 methods::CLONE_ON_REF_PTR,
586 methods::OPTION_UNWRAP_USED,
587 methods::RESULT_UNWRAP_USED,
588 methods::WRONG_PUB_SELF_CONVENTION,
589 misc::FLOAT_CMP_CONST,
590 missing_doc::MISSING_DOCS_IN_PRIVATE_ITEMS,
591 missing_inline::MISSING_INLINE_IN_PUBLIC_ITEMS,
592 panic_unimplemented::UNIMPLEMENTED,
593 shadow::SHADOW_REUSE,
600 reg.register_lint_group("clippy::pedantic", Some("clippy_pedantic"), vec![
601 attrs::INLINE_ALWAYS,
602 copies::MATCH_SAME_ARMS,
603 copy_iterator::COPY_ITERATOR,
604 default_trait_access::DEFAULT_TRAIT_ACCESS,
605 derive::EXPL_IMPL_CLONE_ON_COPY,
607 empty_enum::EMPTY_ENUM,
608 enum_glob_use::ENUM_GLOB_USE,
609 enum_variants::MODULE_NAME_REPETITIONS,
610 enum_variants::PUB_ENUM_VARIANT_NAMES,
611 functions::TOO_MANY_LINES,
612 if_not_else::IF_NOT_ELSE,
613 infinite_iter::MAYBE_INFINITE_ITER,
614 items_after_statements::ITEMS_AFTER_STATEMENTS,
615 literal_representation::LARGE_DIGIT_GROUPS,
616 loops::EXPLICIT_INTO_ITER_LOOP,
617 loops::EXPLICIT_ITER_LOOP,
618 matches::SINGLE_MATCH_ELSE,
620 methods::MAP_FLATTEN,
621 methods::OPTION_MAP_UNWRAP_OR,
622 methods::OPTION_MAP_UNWRAP_OR_ELSE,
623 methods::RESULT_MAP_UNWRAP_OR_ELSE,
624 misc::USED_UNDERSCORE_BINDING,
625 misc_early::UNSEPARATED_LITERAL_SUFFIX,
627 needless_continue::NEEDLESS_CONTINUE,
628 needless_pass_by_value::NEEDLESS_PASS_BY_VALUE,
629 non_expressive_names::SIMILAR_NAMES,
630 replace_consts::REPLACE_CONSTS,
631 shadow::SHADOW_UNRELATED,
632 strings::STRING_ADD_ASSIGN,
633 types::CAST_POSSIBLE_TRUNCATION,
634 types::CAST_POSSIBLE_WRAP,
635 types::CAST_PRECISION_LOSS,
636 types::CAST_SIGN_LOSS,
637 types::INVALID_UPCAST_COMPARISONS,
639 unicode::NON_ASCII_LITERAL,
640 unicode::UNICODE_NOT_NFC,
644 reg.register_lint_group("clippy::internal", Some("clippy_internal"), vec![
645 utils::internal_lints::CLIPPY_LINTS_INTERNAL,
646 utils::internal_lints::COMPILER_LINT_FUNCTIONS,
647 utils::internal_lints::DEFAULT_HASH_TYPES,
648 utils::internal_lints::LINT_WITHOUT_LINT_PASS,
651 reg.register_lint_group("clippy::all", Some("clippy"), vec![
652 approx_const::APPROX_CONSTANT,
653 assertions_on_constants::ASSERTIONS_ON_CONSTANTS,
654 assign_ops::ASSIGN_OP_PATTERN,
655 assign_ops::MISREFACTORED_ASSIGN_OP,
656 attrs::DEPRECATED_CFG_ATTR,
657 attrs::DEPRECATED_SEMVER,
658 attrs::UNKNOWN_CLIPPY_LINTS,
659 attrs::USELESS_ATTRIBUTE,
660 bit_mask::BAD_BIT_MASK,
661 bit_mask::INEFFECTIVE_BIT_MASK,
662 bit_mask::VERBOSE_BIT_MASK,
663 blacklisted_name::BLACKLISTED_NAME,
664 block_in_if_condition::BLOCK_IN_IF_CONDITION_EXPR,
665 block_in_if_condition::BLOCK_IN_IF_CONDITION_STMT,
667 booleans::NONMINIMAL_BOOL,
668 bytecount::NAIVE_BYTECOUNT,
669 cognitive_complexity::COGNITIVE_COMPLEXITY,
670 collapsible_if::COLLAPSIBLE_IF,
671 const_static_lifetime::CONST_STATIC_LIFETIME,
672 copies::IFS_SAME_COND,
673 copies::IF_SAME_THEN_ELSE,
674 derive::DERIVE_HASH_XOR_EQ,
675 double_comparison::DOUBLE_COMPARISONS,
676 double_parens::DOUBLE_PARENS,
677 drop_bounds::DROP_BOUNDS,
678 drop_forget_ref::DROP_COPY,
679 drop_forget_ref::DROP_REF,
680 drop_forget_ref::FORGET_COPY,
681 drop_forget_ref::FORGET_REF,
682 duration_subsec::DURATION_SUBSEC,
684 enum_clike::ENUM_CLIKE_UNPORTABLE_VARIANT,
685 enum_variants::ENUM_VARIANT_NAMES,
686 enum_variants::MODULE_INCEPTION,
689 erasing_op::ERASING_OP,
691 eta_reduction::REDUNDANT_CLOSURE,
692 eval_order_dependence::DIVERGING_SUB_EXPRESSION,
693 eval_order_dependence::EVAL_ORDER_DEPENDENCE,
694 excessive_precision::EXCESSIVE_PRECISION,
695 explicit_write::EXPLICIT_WRITE,
696 format::USELESS_FORMAT,
697 formatting::POSSIBLE_MISSING_COMMA,
698 formatting::SUSPICIOUS_ASSIGNMENT_FORMATTING,
699 formatting::SUSPICIOUS_ELSE_FORMATTING,
700 functions::NOT_UNSAFE_PTR_ARG_DEREF,
701 functions::TOO_MANY_ARGUMENTS,
702 identity_conversion::IDENTITY_CONVERSION,
703 identity_op::IDENTITY_OP,
704 indexing_slicing::OUT_OF_BOUNDS_INDEXING,
705 infallible_destructuring_match::INFALLIBLE_DESTRUCTURING_MATCH,
706 infinite_iter::INFINITE_ITER,
707 inline_fn_without_body::INLINE_FN_WITHOUT_BODY,
708 int_plus_one::INT_PLUS_ONE,
709 invalid_ref::INVALID_REF,
710 large_enum_variant::LARGE_ENUM_VARIANT,
711 len_zero::LEN_WITHOUT_IS_EMPTY,
713 let_if_seq::USELESS_LET_IF_SEQ,
714 lifetimes::EXTRA_UNUSED_LIFETIMES,
715 lifetimes::NEEDLESS_LIFETIMES,
716 literal_representation::INCONSISTENT_DIGIT_GROUPING,
717 literal_representation::MISTYPED_LITERAL_SUFFIXES,
718 literal_representation::UNREADABLE_LITERAL,
720 loops::EXPLICIT_COUNTER_LOOP,
722 loops::FOR_LOOP_OVER_OPTION,
723 loops::FOR_LOOP_OVER_RESULT,
724 loops::ITER_NEXT_LOOP,
725 loops::MANUAL_MEMCPY,
726 loops::MUT_RANGE_BOUND,
727 loops::NEEDLESS_COLLECT,
728 loops::NEEDLESS_RANGE_LOOP,
730 loops::REVERSE_RANGE_LOOP,
731 loops::UNUSED_COLLECT,
732 loops::WHILE_IMMUTABLE_CONDITION,
733 loops::WHILE_LET_LOOP,
734 loops::WHILE_LET_ON_ITERATOR,
735 map_clone::MAP_CLONE,
736 map_unit_fn::OPTION_MAP_UNIT_FN,
737 map_unit_fn::RESULT_MAP_UNIT_FN,
738 matches::MATCH_AS_REF,
740 matches::MATCH_OVERLAPPING_ARM,
741 matches::MATCH_REF_PATS,
742 matches::MATCH_WILD_ERR_ARM,
743 matches::SINGLE_MATCH,
744 mem_discriminant::MEM_DISCRIMINANT_NON_ENUM,
745 mem_replace::MEM_REPLACE_OPTION_WITH_NONE,
746 methods::CHARS_LAST_CMP,
747 methods::CHARS_NEXT_CMP,
748 methods::CLONE_DOUBLE_REF,
749 methods::CLONE_ON_COPY,
750 methods::EXPECT_FUN_CALL,
751 methods::FILTER_NEXT,
753 methods::INTO_ITER_ON_ARRAY,
754 methods::INTO_ITER_ON_REF,
755 methods::ITER_CLONED_COLLECT,
757 methods::ITER_SKIP_NEXT,
758 methods::NEW_RET_NO_SELF,
760 methods::OPTION_MAP_OR_NONE,
761 methods::OR_FUN_CALL,
762 methods::SEARCH_IS_SOME,
763 methods::SHOULD_IMPLEMENT_TRAIT,
764 methods::SINGLE_CHAR_PATTERN,
765 methods::STRING_EXTEND_CHARS,
766 methods::TEMPORARY_CSTRING_AS_PTR,
767 methods::UNNECESSARY_FILTER_MAP,
768 methods::UNNECESSARY_FOLD,
769 methods::USELESS_ASREF,
770 methods::WRONG_SELF_CONVENTION,
776 misc::REDUNDANT_PATTERN,
777 misc::SHORT_CIRCUIT_STATEMENT,
778 misc::TOPLEVEL_REF_ARG,
780 misc_early::BUILTIN_TYPE_SHADOW,
781 misc_early::DOUBLE_NEG,
782 misc_early::DUPLICATE_UNDERSCORE_ARGUMENT,
783 misc_early::MIXED_CASE_HEX_LITERALS,
784 misc_early::REDUNDANT_CLOSURE_CALL,
785 misc_early::UNNEEDED_FIELD_PATTERN,
786 misc_early::ZERO_PREFIXED_LITERAL,
787 mut_reference::UNNECESSARY_MUT_PASSED,
788 mutex_atomic::MUTEX_ATOMIC,
789 needless_bool::BOOL_COMPARISON,
790 needless_bool::NEEDLESS_BOOL,
791 needless_borrowed_ref::NEEDLESS_BORROWED_REFERENCE,
792 needless_update::NEEDLESS_UPDATE,
793 neg_cmp_op_on_partial_ord::NEG_CMP_OP_ON_PARTIAL_ORD,
794 neg_multiply::NEG_MULTIPLY,
795 new_without_default::NEW_WITHOUT_DEFAULT,
796 no_effect::NO_EFFECT,
797 no_effect::UNNECESSARY_OPERATION,
798 non_copy_const::BORROW_INTERIOR_MUTABLE_CONST,
799 non_copy_const::DECLARE_INTERIOR_MUTABLE_CONST,
800 non_expressive_names::JUST_UNDERSCORES_AND_DIGITS,
801 non_expressive_names::MANY_SINGLE_CHAR_NAMES,
802 ok_if_let::IF_LET_SOME_RESULT,
803 open_options::NONSENSICAL_OPEN_OPTIONS,
804 overflow_check_conditional::OVERFLOW_CHECK_CONDITIONAL,
805 panic_unimplemented::PANIC_PARAMS,
806 partialeq_ne_impl::PARTIALEQ_NE_IMPL,
807 precedence::PRECEDENCE,
811 ptr_offset_with_cast::PTR_OFFSET_WITH_CAST,
812 question_mark::QUESTION_MARK,
813 ranges::ITERATOR_STEP_BY_ZERO,
814 ranges::RANGE_MINUS_ONE,
815 ranges::RANGE_PLUS_ONE,
816 ranges::RANGE_ZIP_WITH_LEN,
817 redundant_field_names::REDUNDANT_FIELD_NAMES,
818 redundant_pattern_matching::REDUNDANT_PATTERN_MATCHING,
819 reference::DEREF_ADDROF,
820 reference::REF_IN_DEREF,
821 regex::INVALID_REGEX,
823 regex::TRIVIAL_REGEX,
824 returns::LET_AND_RETURN,
825 returns::NEEDLESS_RETURN,
826 returns::UNUSED_UNIT,
827 serde_api::SERDE_API_MISUSE,
828 slow_vector_initialization::SLOW_VECTOR_INITIALIZATION,
829 strings::STRING_LIT_AS_BYTES,
830 suspicious_trait_impl::SUSPICIOUS_ARITHMETIC_IMPL,
831 suspicious_trait_impl::SUSPICIOUS_OP_ASSIGN_IMPL,
832 swap::ALMOST_SWAPPED,
834 temporary_assignment::TEMPORARY_ASSIGNMENT,
835 transmute::CROSSPOINTER_TRANSMUTE,
836 transmute::TRANSMUTE_BYTES_TO_STR,
837 transmute::TRANSMUTE_INT_TO_BOOL,
838 transmute::TRANSMUTE_INT_TO_CHAR,
839 transmute::TRANSMUTE_INT_TO_FLOAT,
840 transmute::TRANSMUTE_PTR_TO_PTR,
841 transmute::TRANSMUTE_PTR_TO_REF,
842 transmute::USELESS_TRANSMUTE,
843 transmute::WRONG_TRANSMUTE,
844 trivially_copy_pass_by_ref::TRIVIALLY_COPY_PASS_BY_REF,
845 types::ABSURD_EXTREME_COMPARISONS,
848 types::CAST_LOSSLESS,
849 types::CAST_PTR_ALIGNMENT,
850 types::CAST_REF_TO_MUT,
851 types::CHAR_LIT_AS_U8,
852 types::FN_TO_NUMERIC_CAST,
853 types::FN_TO_NUMERIC_CAST_WITH_TRUNCATION,
854 types::IMPLICIT_HASHER,
855 types::LET_UNIT_VALUE,
856 types::OPTION_OPTION,
857 types::TYPE_COMPLEXITY,
860 types::UNNECESSARY_CAST,
862 unicode::ZERO_WIDTH_SPACE,
863 unsafe_removed_from_name::UNSAFE_REMOVED_FROM_NAME,
864 unused_io_amount::UNUSED_IO_AMOUNT,
865 unused_label::UNUSED_LABEL,
867 write::PRINTLN_EMPTY_STRING,
868 write::PRINT_LITERAL,
869 write::PRINT_WITH_NEWLINE,
870 write::WRITELN_EMPTY_STRING,
871 write::WRITE_LITERAL,
872 write::WRITE_WITH_NEWLINE,
873 zero_div_zero::ZERO_DIVIDED_BY_ZERO,
876 reg.register_lint_group("clippy::style", Some("clippy_style"), vec![
877 assertions_on_constants::ASSERTIONS_ON_CONSTANTS,
878 assign_ops::ASSIGN_OP_PATTERN,
879 attrs::UNKNOWN_CLIPPY_LINTS,
880 bit_mask::VERBOSE_BIT_MASK,
881 blacklisted_name::BLACKLISTED_NAME,
882 block_in_if_condition::BLOCK_IN_IF_CONDITION_EXPR,
883 block_in_if_condition::BLOCK_IN_IF_CONDITION_STMT,
884 collapsible_if::COLLAPSIBLE_IF,
885 const_static_lifetime::CONST_STATIC_LIFETIME,
886 enum_variants::ENUM_VARIANT_NAMES,
887 enum_variants::MODULE_INCEPTION,
889 eta_reduction::REDUNDANT_CLOSURE,
890 excessive_precision::EXCESSIVE_PRECISION,
891 formatting::SUSPICIOUS_ASSIGNMENT_FORMATTING,
892 formatting::SUSPICIOUS_ELSE_FORMATTING,
893 infallible_destructuring_match::INFALLIBLE_DESTRUCTURING_MATCH,
894 len_zero::LEN_WITHOUT_IS_EMPTY,
896 let_if_seq::USELESS_LET_IF_SEQ,
897 literal_representation::INCONSISTENT_DIGIT_GROUPING,
898 literal_representation::UNREADABLE_LITERAL,
901 loops::NEEDLESS_RANGE_LOOP,
902 loops::WHILE_LET_ON_ITERATOR,
903 map_clone::MAP_CLONE,
905 matches::MATCH_OVERLAPPING_ARM,
906 matches::MATCH_REF_PATS,
907 matches::MATCH_WILD_ERR_ARM,
908 matches::SINGLE_MATCH,
909 mem_replace::MEM_REPLACE_OPTION_WITH_NONE,
910 methods::CHARS_LAST_CMP,
912 methods::INTO_ITER_ON_REF,
913 methods::ITER_CLONED_COLLECT,
914 methods::ITER_SKIP_NEXT,
915 methods::NEW_RET_NO_SELF,
917 methods::OPTION_MAP_OR_NONE,
918 methods::SHOULD_IMPLEMENT_TRAIT,
919 methods::STRING_EXTEND_CHARS,
920 methods::UNNECESSARY_FOLD,
921 methods::WRONG_SELF_CONVENTION,
922 misc::REDUNDANT_PATTERN,
923 misc::TOPLEVEL_REF_ARG,
925 misc_early::BUILTIN_TYPE_SHADOW,
926 misc_early::DOUBLE_NEG,
927 misc_early::DUPLICATE_UNDERSCORE_ARGUMENT,
928 misc_early::MIXED_CASE_HEX_LITERALS,
929 misc_early::UNNEEDED_FIELD_PATTERN,
930 mut_reference::UNNECESSARY_MUT_PASSED,
931 neg_multiply::NEG_MULTIPLY,
932 new_without_default::NEW_WITHOUT_DEFAULT,
933 non_expressive_names::JUST_UNDERSCORES_AND_DIGITS,
934 non_expressive_names::MANY_SINGLE_CHAR_NAMES,
935 ok_if_let::IF_LET_SOME_RESULT,
936 panic_unimplemented::PANIC_PARAMS,
939 question_mark::QUESTION_MARK,
940 redundant_field_names::REDUNDANT_FIELD_NAMES,
941 redundant_pattern_matching::REDUNDANT_PATTERN_MATCHING,
943 regex::TRIVIAL_REGEX,
944 returns::LET_AND_RETURN,
945 returns::NEEDLESS_RETURN,
946 returns::UNUSED_UNIT,
947 strings::STRING_LIT_AS_BYTES,
948 types::FN_TO_NUMERIC_CAST,
949 types::FN_TO_NUMERIC_CAST_WITH_TRUNCATION,
950 types::IMPLICIT_HASHER,
951 types::LET_UNIT_VALUE,
952 unsafe_removed_from_name::UNSAFE_REMOVED_FROM_NAME,
953 write::PRINTLN_EMPTY_STRING,
954 write::PRINT_LITERAL,
955 write::PRINT_WITH_NEWLINE,
956 write::WRITELN_EMPTY_STRING,
957 write::WRITE_LITERAL,
958 write::WRITE_WITH_NEWLINE,
961 reg.register_lint_group("clippy::complexity", Some("clippy_complexity"), vec![
962 assign_ops::MISREFACTORED_ASSIGN_OP,
963 attrs::DEPRECATED_CFG_ATTR,
964 booleans::NONMINIMAL_BOOL,
965 cognitive_complexity::COGNITIVE_COMPLEXITY,
966 double_comparison::DOUBLE_COMPARISONS,
967 double_parens::DOUBLE_PARENS,
968 duration_subsec::DURATION_SUBSEC,
969 eval_order_dependence::DIVERGING_SUB_EXPRESSION,
970 eval_order_dependence::EVAL_ORDER_DEPENDENCE,
971 explicit_write::EXPLICIT_WRITE,
972 format::USELESS_FORMAT,
973 functions::TOO_MANY_ARGUMENTS,
974 identity_conversion::IDENTITY_CONVERSION,
975 identity_op::IDENTITY_OP,
976 int_plus_one::INT_PLUS_ONE,
977 lifetimes::EXTRA_UNUSED_LIFETIMES,
978 lifetimes::NEEDLESS_LIFETIMES,
979 loops::EXPLICIT_COUNTER_LOOP,
980 loops::MUT_RANGE_BOUND,
981 loops::WHILE_LET_LOOP,
982 map_unit_fn::OPTION_MAP_UNIT_FN,
983 map_unit_fn::RESULT_MAP_UNIT_FN,
984 matches::MATCH_AS_REF,
985 methods::CHARS_NEXT_CMP,
986 methods::CLONE_ON_COPY,
987 methods::FILTER_NEXT,
988 methods::SEARCH_IS_SOME,
989 methods::UNNECESSARY_FILTER_MAP,
990 methods::USELESS_ASREF,
991 misc::SHORT_CIRCUIT_STATEMENT,
992 misc_early::REDUNDANT_CLOSURE_CALL,
993 misc_early::ZERO_PREFIXED_LITERAL,
994 needless_bool::BOOL_COMPARISON,
995 needless_bool::NEEDLESS_BOOL,
996 needless_borrowed_ref::NEEDLESS_BORROWED_REFERENCE,
997 needless_update::NEEDLESS_UPDATE,
998 neg_cmp_op_on_partial_ord::NEG_CMP_OP_ON_PARTIAL_ORD,
999 no_effect::NO_EFFECT,
1000 no_effect::UNNECESSARY_OPERATION,
1001 overflow_check_conditional::OVERFLOW_CHECK_CONDITIONAL,
1002 partialeq_ne_impl::PARTIALEQ_NE_IMPL,
1003 precedence::PRECEDENCE,
1004 ptr_offset_with_cast::PTR_OFFSET_WITH_CAST,
1005 ranges::RANGE_MINUS_ONE,
1006 ranges::RANGE_PLUS_ONE,
1007 ranges::RANGE_ZIP_WITH_LEN,
1008 reference::DEREF_ADDROF,
1009 reference::REF_IN_DEREF,
1011 temporary_assignment::TEMPORARY_ASSIGNMENT,
1012 transmute::CROSSPOINTER_TRANSMUTE,
1013 transmute::TRANSMUTE_BYTES_TO_STR,
1014 transmute::TRANSMUTE_INT_TO_BOOL,
1015 transmute::TRANSMUTE_INT_TO_CHAR,
1016 transmute::TRANSMUTE_INT_TO_FLOAT,
1017 transmute::TRANSMUTE_PTR_TO_PTR,
1018 transmute::TRANSMUTE_PTR_TO_REF,
1019 transmute::USELESS_TRANSMUTE,
1020 types::BORROWED_BOX,
1021 types::CAST_LOSSLESS,
1022 types::CHAR_LIT_AS_U8,
1023 types::OPTION_OPTION,
1024 types::TYPE_COMPLEXITY,
1026 types::UNNECESSARY_CAST,
1028 unused_label::UNUSED_LABEL,
1029 zero_div_zero::ZERO_DIVIDED_BY_ZERO,
1032 reg.register_lint_group("clippy::correctness", Some("clippy_correctness"), vec![
1033 approx_const::APPROX_CONSTANT,
1034 attrs::DEPRECATED_SEMVER,
1035 attrs::USELESS_ATTRIBUTE,
1036 bit_mask::BAD_BIT_MASK,
1037 bit_mask::INEFFECTIVE_BIT_MASK,
1038 booleans::LOGIC_BUG,
1039 copies::IFS_SAME_COND,
1040 copies::IF_SAME_THEN_ELSE,
1041 derive::DERIVE_HASH_XOR_EQ,
1042 drop_bounds::DROP_BOUNDS,
1043 drop_forget_ref::DROP_COPY,
1044 drop_forget_ref::DROP_REF,
1045 drop_forget_ref::FORGET_COPY,
1046 drop_forget_ref::FORGET_REF,
1047 enum_clike::ENUM_CLIKE_UNPORTABLE_VARIANT,
1049 erasing_op::ERASING_OP,
1050 formatting::POSSIBLE_MISSING_COMMA,
1051 functions::NOT_UNSAFE_PTR_ARG_DEREF,
1052 indexing_slicing::OUT_OF_BOUNDS_INDEXING,
1053 infinite_iter::INFINITE_ITER,
1054 inline_fn_without_body::INLINE_FN_WITHOUT_BODY,
1055 invalid_ref::INVALID_REF,
1056 literal_representation::MISTYPED_LITERAL_SUFFIXES,
1057 loops::FOR_LOOP_OVER_OPTION,
1058 loops::FOR_LOOP_OVER_RESULT,
1059 loops::ITER_NEXT_LOOP,
1061 loops::REVERSE_RANGE_LOOP,
1062 loops::WHILE_IMMUTABLE_CONDITION,
1063 mem_discriminant::MEM_DISCRIMINANT_NON_ENUM,
1064 methods::CLONE_DOUBLE_REF,
1065 methods::INTO_ITER_ON_ARRAY,
1066 methods::TEMPORARY_CSTRING_AS_PTR,
1071 non_copy_const::BORROW_INTERIOR_MUTABLE_CONST,
1072 non_copy_const::DECLARE_INTERIOR_MUTABLE_CONST,
1073 open_options::NONSENSICAL_OPEN_OPTIONS,
1075 ranges::ITERATOR_STEP_BY_ZERO,
1076 regex::INVALID_REGEX,
1077 serde_api::SERDE_API_MISUSE,
1078 suspicious_trait_impl::SUSPICIOUS_ARITHMETIC_IMPL,
1079 suspicious_trait_impl::SUSPICIOUS_OP_ASSIGN_IMPL,
1080 swap::ALMOST_SWAPPED,
1081 transmute::WRONG_TRANSMUTE,
1082 types::ABSURD_EXTREME_COMPARISONS,
1083 types::CAST_PTR_ALIGNMENT,
1084 types::CAST_REF_TO_MUT,
1086 unicode::ZERO_WIDTH_SPACE,
1087 unused_io_amount::UNUSED_IO_AMOUNT,
1090 reg.register_lint_group("clippy::perf", Some("clippy_perf"), vec![
1091 bytecount::NAIVE_BYTECOUNT,
1093 escape::BOXED_LOCAL,
1094 large_enum_variant::LARGE_ENUM_VARIANT,
1095 loops::MANUAL_MEMCPY,
1096 loops::NEEDLESS_COLLECT,
1097 loops::UNUSED_COLLECT,
1098 methods::EXPECT_FUN_CALL,
1100 methods::OR_FUN_CALL,
1101 methods::SINGLE_CHAR_PATTERN,
1103 mutex_atomic::MUTEX_ATOMIC,
1104 slow_vector_initialization::SLOW_VECTOR_INITIALIZATION,
1105 trivially_copy_pass_by_ref::TRIVIALLY_COPY_PASS_BY_REF,
1110 reg.register_lint_group("clippy::cargo", Some("clippy_cargo"), vec![
1111 cargo_common_metadata::CARGO_COMMON_METADATA,
1112 multiple_crate_versions::MULTIPLE_CRATE_VERSIONS,
1113 wildcard_dependencies::WILDCARD_DEPENDENCIES,
1116 reg.register_lint_group("clippy::nursery", Some("clippy_nursery"), vec![
1117 attrs::EMPTY_LINE_AFTER_OUTER_ATTR,
1118 fallible_impl_from::FALLIBLE_IMPL_FROM,
1119 missing_const_for_fn::MISSING_CONST_FOR_FN,
1120 mutex_atomic::MUTEX_INTEGER,
1121 needless_borrow::NEEDLESS_BORROW,
1122 redundant_clone::REDUNDANT_CLONE,
1123 unwrap::PANICKING_UNWRAP,
1124 unwrap::UNNECESSARY_UNWRAP,
1128 /// Register renamed lints.
1130 /// Used in `./src/driver.rs`.
1131 pub fn register_renamed(ls: &mut rustc::lint::LintStore) {
1132 ls.register_renamed("clippy::stutter", "clippy::module_name_repetitions");
1133 ls.register_renamed("clippy::new_without_default_derive", "clippy::new_without_default");
1134 ls.register_renamed("clippy::cyclomatic_complexity", "clippy::cognitive_complexity");
1137 // only exists to let the dogfood integration test works.
1138 // Don't run clippy as an executable directly
1141 panic!("Please use the cargo-clippy executable");