1 // error-pattern:cargo-clippy
3 #![feature(box_syntax)]
4 #![feature(never_type)]
5 #![feature(rustc_private)]
6 #![feature(slice_patterns)]
7 #![feature(stmt_expr_attributes)]
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 without `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 architecture 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,
587 methods::OPTION_UNWRAP_USED,
588 methods::RESULT_UNWRAP_USED,
589 methods::WRONG_PUB_SELF_CONVENTION,
590 misc::FLOAT_CMP_CONST,
591 missing_doc::MISSING_DOCS_IN_PRIVATE_ITEMS,
592 missing_inline::MISSING_INLINE_IN_PUBLIC_ITEMS,
593 panic_unimplemented::UNIMPLEMENTED,
594 shadow::SHADOW_REUSE,
601 reg.register_lint_group("clippy::pedantic", Some("clippy_pedantic"), vec![
602 attrs::INLINE_ALWAYS,
603 copies::MATCH_SAME_ARMS,
604 copy_iterator::COPY_ITERATOR,
605 default_trait_access::DEFAULT_TRAIT_ACCESS,
606 derive::EXPL_IMPL_CLONE_ON_COPY,
608 empty_enum::EMPTY_ENUM,
609 enum_glob_use::ENUM_GLOB_USE,
610 enum_variants::MODULE_NAME_REPETITIONS,
611 enum_variants::PUB_ENUM_VARIANT_NAMES,
612 functions::TOO_MANY_LINES,
613 if_not_else::IF_NOT_ELSE,
614 infinite_iter::MAYBE_INFINITE_ITER,
615 items_after_statements::ITEMS_AFTER_STATEMENTS,
616 literal_representation::LARGE_DIGIT_GROUPS,
617 loops::EXPLICIT_INTO_ITER_LOOP,
618 loops::EXPLICIT_ITER_LOOP,
619 matches::SINGLE_MATCH_ELSE,
621 methods::MAP_FLATTEN,
622 methods::OPTION_MAP_UNWRAP_OR,
623 methods::OPTION_MAP_UNWRAP_OR_ELSE,
624 methods::RESULT_MAP_UNWRAP_OR_ELSE,
625 misc::USED_UNDERSCORE_BINDING,
626 misc_early::UNSEPARATED_LITERAL_SUFFIX,
628 needless_continue::NEEDLESS_CONTINUE,
629 needless_pass_by_value::NEEDLESS_PASS_BY_VALUE,
630 non_expressive_names::SIMILAR_NAMES,
631 replace_consts::REPLACE_CONSTS,
632 shadow::SHADOW_UNRELATED,
633 strings::STRING_ADD_ASSIGN,
634 types::CAST_POSSIBLE_TRUNCATION,
635 types::CAST_POSSIBLE_WRAP,
636 types::CAST_PRECISION_LOSS,
637 types::CAST_SIGN_LOSS,
638 types::INVALID_UPCAST_COMPARISONS,
640 unicode::NON_ASCII_LITERAL,
641 unicode::UNICODE_NOT_NFC,
645 reg.register_lint_group("clippy::internal", Some("clippy_internal"), vec![
646 utils::internal_lints::CLIPPY_LINTS_INTERNAL,
647 utils::internal_lints::COMPILER_LINT_FUNCTIONS,
648 utils::internal_lints::DEFAULT_HASH_TYPES,
649 utils::internal_lints::LINT_WITHOUT_LINT_PASS,
652 reg.register_lint_group("clippy::all", Some("clippy"), vec![
653 approx_const::APPROX_CONSTANT,
654 assertions_on_constants::ASSERTIONS_ON_CONSTANTS,
655 assign_ops::ASSIGN_OP_PATTERN,
656 assign_ops::MISREFACTORED_ASSIGN_OP,
657 attrs::DEPRECATED_CFG_ATTR,
658 attrs::DEPRECATED_SEMVER,
659 attrs::UNKNOWN_CLIPPY_LINTS,
660 attrs::USELESS_ATTRIBUTE,
661 bit_mask::BAD_BIT_MASK,
662 bit_mask::INEFFECTIVE_BIT_MASK,
663 bit_mask::VERBOSE_BIT_MASK,
664 blacklisted_name::BLACKLISTED_NAME,
665 block_in_if_condition::BLOCK_IN_IF_CONDITION_EXPR,
666 block_in_if_condition::BLOCK_IN_IF_CONDITION_STMT,
668 booleans::NONMINIMAL_BOOL,
669 bytecount::NAIVE_BYTECOUNT,
670 cognitive_complexity::COGNITIVE_COMPLEXITY,
671 collapsible_if::COLLAPSIBLE_IF,
672 const_static_lifetime::CONST_STATIC_LIFETIME,
673 copies::IFS_SAME_COND,
674 copies::IF_SAME_THEN_ELSE,
675 derive::DERIVE_HASH_XOR_EQ,
676 double_comparison::DOUBLE_COMPARISONS,
677 double_parens::DOUBLE_PARENS,
678 drop_bounds::DROP_BOUNDS,
679 drop_forget_ref::DROP_COPY,
680 drop_forget_ref::DROP_REF,
681 drop_forget_ref::FORGET_COPY,
682 drop_forget_ref::FORGET_REF,
683 duration_subsec::DURATION_SUBSEC,
685 enum_clike::ENUM_CLIKE_UNPORTABLE_VARIANT,
686 enum_variants::ENUM_VARIANT_NAMES,
687 enum_variants::MODULE_INCEPTION,
690 erasing_op::ERASING_OP,
692 eta_reduction::REDUNDANT_CLOSURE,
693 eval_order_dependence::DIVERGING_SUB_EXPRESSION,
694 eval_order_dependence::EVAL_ORDER_DEPENDENCE,
695 excessive_precision::EXCESSIVE_PRECISION,
696 explicit_write::EXPLICIT_WRITE,
697 format::USELESS_FORMAT,
698 formatting::POSSIBLE_MISSING_COMMA,
699 formatting::SUSPICIOUS_ASSIGNMENT_FORMATTING,
700 formatting::SUSPICIOUS_ELSE_FORMATTING,
701 functions::NOT_UNSAFE_PTR_ARG_DEREF,
702 functions::TOO_MANY_ARGUMENTS,
703 identity_conversion::IDENTITY_CONVERSION,
704 identity_op::IDENTITY_OP,
705 indexing_slicing::OUT_OF_BOUNDS_INDEXING,
706 infallible_destructuring_match::INFALLIBLE_DESTRUCTURING_MATCH,
707 infinite_iter::INFINITE_ITER,
708 inline_fn_without_body::INLINE_FN_WITHOUT_BODY,
709 int_plus_one::INT_PLUS_ONE,
710 invalid_ref::INVALID_REF,
711 large_enum_variant::LARGE_ENUM_VARIANT,
712 len_zero::LEN_WITHOUT_IS_EMPTY,
714 let_if_seq::USELESS_LET_IF_SEQ,
715 lifetimes::EXTRA_UNUSED_LIFETIMES,
716 lifetimes::NEEDLESS_LIFETIMES,
717 literal_representation::INCONSISTENT_DIGIT_GROUPING,
718 literal_representation::MISTYPED_LITERAL_SUFFIXES,
719 literal_representation::UNREADABLE_LITERAL,
721 loops::EXPLICIT_COUNTER_LOOP,
723 loops::FOR_LOOP_OVER_OPTION,
724 loops::FOR_LOOP_OVER_RESULT,
725 loops::ITER_NEXT_LOOP,
726 loops::MANUAL_MEMCPY,
727 loops::MUT_RANGE_BOUND,
728 loops::NEEDLESS_COLLECT,
729 loops::NEEDLESS_RANGE_LOOP,
731 loops::REVERSE_RANGE_LOOP,
732 loops::UNUSED_COLLECT,
733 loops::WHILE_IMMUTABLE_CONDITION,
734 loops::WHILE_LET_LOOP,
735 loops::WHILE_LET_ON_ITERATOR,
736 map_clone::MAP_CLONE,
737 map_unit_fn::OPTION_MAP_UNIT_FN,
738 map_unit_fn::RESULT_MAP_UNIT_FN,
739 matches::MATCH_AS_REF,
741 matches::MATCH_OVERLAPPING_ARM,
742 matches::MATCH_REF_PATS,
743 matches::MATCH_WILD_ERR_ARM,
744 matches::SINGLE_MATCH,
745 mem_discriminant::MEM_DISCRIMINANT_NON_ENUM,
746 mem_replace::MEM_REPLACE_OPTION_WITH_NONE,
747 methods::CHARS_LAST_CMP,
748 methods::CHARS_NEXT_CMP,
749 methods::CLONE_DOUBLE_REF,
750 methods::CLONE_ON_COPY,
751 methods::EXPECT_FUN_CALL,
752 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,
911 methods::INTO_ITER_ON_REF,
912 methods::ITER_CLONED_COLLECT,
913 methods::ITER_SKIP_NEXT,
914 methods::NEW_RET_NO_SELF,
916 methods::OPTION_MAP_OR_NONE,
917 methods::SHOULD_IMPLEMENT_TRAIT,
918 methods::STRING_EXTEND_CHARS,
919 methods::UNNECESSARY_FOLD,
920 methods::WRONG_SELF_CONVENTION,
921 misc::REDUNDANT_PATTERN,
922 misc::TOPLEVEL_REF_ARG,
924 misc_early::BUILTIN_TYPE_SHADOW,
925 misc_early::DOUBLE_NEG,
926 misc_early::DUPLICATE_UNDERSCORE_ARGUMENT,
927 misc_early::MIXED_CASE_HEX_LITERALS,
928 misc_early::UNNEEDED_FIELD_PATTERN,
929 mut_reference::UNNECESSARY_MUT_PASSED,
930 neg_multiply::NEG_MULTIPLY,
931 new_without_default::NEW_WITHOUT_DEFAULT,
932 non_expressive_names::JUST_UNDERSCORES_AND_DIGITS,
933 non_expressive_names::MANY_SINGLE_CHAR_NAMES,
934 ok_if_let::IF_LET_SOME_RESULT,
935 panic_unimplemented::PANIC_PARAMS,
938 question_mark::QUESTION_MARK,
939 redundant_field_names::REDUNDANT_FIELD_NAMES,
940 redundant_pattern_matching::REDUNDANT_PATTERN_MATCHING,
942 regex::TRIVIAL_REGEX,
943 returns::LET_AND_RETURN,
944 returns::NEEDLESS_RETURN,
945 returns::UNUSED_UNIT,
946 strings::STRING_LIT_AS_BYTES,
947 types::FN_TO_NUMERIC_CAST,
948 types::FN_TO_NUMERIC_CAST_WITH_TRUNCATION,
949 types::IMPLICIT_HASHER,
950 types::LET_UNIT_VALUE,
951 unsafe_removed_from_name::UNSAFE_REMOVED_FROM_NAME,
952 write::PRINTLN_EMPTY_STRING,
953 write::PRINT_LITERAL,
954 write::PRINT_WITH_NEWLINE,
955 write::WRITELN_EMPTY_STRING,
956 write::WRITE_LITERAL,
957 write::WRITE_WITH_NEWLINE,
960 reg.register_lint_group("clippy::complexity", Some("clippy_complexity"), vec![
961 assign_ops::MISREFACTORED_ASSIGN_OP,
962 attrs::DEPRECATED_CFG_ATTR,
963 booleans::NONMINIMAL_BOOL,
964 cognitive_complexity::COGNITIVE_COMPLEXITY,
965 double_comparison::DOUBLE_COMPARISONS,
966 double_parens::DOUBLE_PARENS,
967 duration_subsec::DURATION_SUBSEC,
968 eval_order_dependence::DIVERGING_SUB_EXPRESSION,
969 eval_order_dependence::EVAL_ORDER_DEPENDENCE,
970 explicit_write::EXPLICIT_WRITE,
971 format::USELESS_FORMAT,
972 functions::TOO_MANY_ARGUMENTS,
973 identity_conversion::IDENTITY_CONVERSION,
974 identity_op::IDENTITY_OP,
975 int_plus_one::INT_PLUS_ONE,
976 lifetimes::EXTRA_UNUSED_LIFETIMES,
977 lifetimes::NEEDLESS_LIFETIMES,
978 loops::EXPLICIT_COUNTER_LOOP,
979 loops::MUT_RANGE_BOUND,
980 loops::WHILE_LET_LOOP,
981 map_unit_fn::OPTION_MAP_UNIT_FN,
982 map_unit_fn::RESULT_MAP_UNIT_FN,
983 matches::MATCH_AS_REF,
984 methods::CHARS_NEXT_CMP,
985 methods::CLONE_ON_COPY,
986 methods::FILTER_NEXT,
987 methods::SEARCH_IS_SOME,
988 methods::UNNECESSARY_FILTER_MAP,
989 methods::USELESS_ASREF,
990 misc::SHORT_CIRCUIT_STATEMENT,
991 misc_early::REDUNDANT_CLOSURE_CALL,
992 misc_early::ZERO_PREFIXED_LITERAL,
993 needless_bool::BOOL_COMPARISON,
994 needless_bool::NEEDLESS_BOOL,
995 needless_borrowed_ref::NEEDLESS_BORROWED_REFERENCE,
996 needless_update::NEEDLESS_UPDATE,
997 neg_cmp_op_on_partial_ord::NEG_CMP_OP_ON_PARTIAL_ORD,
998 no_effect::NO_EFFECT,
999 no_effect::UNNECESSARY_OPERATION,
1000 overflow_check_conditional::OVERFLOW_CHECK_CONDITIONAL,
1001 partialeq_ne_impl::PARTIALEQ_NE_IMPL,
1002 precedence::PRECEDENCE,
1003 ptr_offset_with_cast::PTR_OFFSET_WITH_CAST,
1004 ranges::RANGE_MINUS_ONE,
1005 ranges::RANGE_PLUS_ONE,
1006 ranges::RANGE_ZIP_WITH_LEN,
1007 reference::DEREF_ADDROF,
1008 reference::REF_IN_DEREF,
1010 temporary_assignment::TEMPORARY_ASSIGNMENT,
1011 transmute::CROSSPOINTER_TRANSMUTE,
1012 transmute::TRANSMUTE_BYTES_TO_STR,
1013 transmute::TRANSMUTE_INT_TO_BOOL,
1014 transmute::TRANSMUTE_INT_TO_CHAR,
1015 transmute::TRANSMUTE_INT_TO_FLOAT,
1016 transmute::TRANSMUTE_PTR_TO_PTR,
1017 transmute::TRANSMUTE_PTR_TO_REF,
1018 transmute::USELESS_TRANSMUTE,
1019 types::BORROWED_BOX,
1020 types::CAST_LOSSLESS,
1021 types::CHAR_LIT_AS_U8,
1022 types::OPTION_OPTION,
1023 types::TYPE_COMPLEXITY,
1025 types::UNNECESSARY_CAST,
1027 unused_label::UNUSED_LABEL,
1028 zero_div_zero::ZERO_DIVIDED_BY_ZERO,
1031 reg.register_lint_group("clippy::correctness", Some("clippy_correctness"), vec![
1032 approx_const::APPROX_CONSTANT,
1033 attrs::DEPRECATED_SEMVER,
1034 attrs::USELESS_ATTRIBUTE,
1035 bit_mask::BAD_BIT_MASK,
1036 bit_mask::INEFFECTIVE_BIT_MASK,
1037 booleans::LOGIC_BUG,
1038 copies::IFS_SAME_COND,
1039 copies::IF_SAME_THEN_ELSE,
1040 derive::DERIVE_HASH_XOR_EQ,
1041 drop_bounds::DROP_BOUNDS,
1042 drop_forget_ref::DROP_COPY,
1043 drop_forget_ref::DROP_REF,
1044 drop_forget_ref::FORGET_COPY,
1045 drop_forget_ref::FORGET_REF,
1046 enum_clike::ENUM_CLIKE_UNPORTABLE_VARIANT,
1048 erasing_op::ERASING_OP,
1049 formatting::POSSIBLE_MISSING_COMMA,
1050 functions::NOT_UNSAFE_PTR_ARG_DEREF,
1051 indexing_slicing::OUT_OF_BOUNDS_INDEXING,
1052 infinite_iter::INFINITE_ITER,
1053 inline_fn_without_body::INLINE_FN_WITHOUT_BODY,
1054 invalid_ref::INVALID_REF,
1055 literal_representation::MISTYPED_LITERAL_SUFFIXES,
1056 loops::FOR_LOOP_OVER_OPTION,
1057 loops::FOR_LOOP_OVER_RESULT,
1058 loops::ITER_NEXT_LOOP,
1060 loops::REVERSE_RANGE_LOOP,
1061 loops::WHILE_IMMUTABLE_CONDITION,
1062 mem_discriminant::MEM_DISCRIMINANT_NON_ENUM,
1063 methods::CLONE_DOUBLE_REF,
1064 methods::INTO_ITER_ON_ARRAY,
1065 methods::TEMPORARY_CSTRING_AS_PTR,
1070 non_copy_const::BORROW_INTERIOR_MUTABLE_CONST,
1071 non_copy_const::DECLARE_INTERIOR_MUTABLE_CONST,
1072 open_options::NONSENSICAL_OPEN_OPTIONS,
1074 ranges::ITERATOR_STEP_BY_ZERO,
1075 regex::INVALID_REGEX,
1076 serde_api::SERDE_API_MISUSE,
1077 suspicious_trait_impl::SUSPICIOUS_ARITHMETIC_IMPL,
1078 suspicious_trait_impl::SUSPICIOUS_OP_ASSIGN_IMPL,
1079 swap::ALMOST_SWAPPED,
1080 transmute::WRONG_TRANSMUTE,
1081 types::ABSURD_EXTREME_COMPARISONS,
1082 types::CAST_PTR_ALIGNMENT,
1083 types::CAST_REF_TO_MUT,
1085 unicode::ZERO_WIDTH_SPACE,
1086 unused_io_amount::UNUSED_IO_AMOUNT,
1089 reg.register_lint_group("clippy::perf", Some("clippy_perf"), vec![
1090 bytecount::NAIVE_BYTECOUNT,
1092 escape::BOXED_LOCAL,
1093 large_enum_variant::LARGE_ENUM_VARIANT,
1094 loops::MANUAL_MEMCPY,
1095 loops::NEEDLESS_COLLECT,
1096 loops::UNUSED_COLLECT,
1097 methods::EXPECT_FUN_CALL,
1099 methods::OR_FUN_CALL,
1100 methods::SINGLE_CHAR_PATTERN,
1102 mutex_atomic::MUTEX_ATOMIC,
1103 slow_vector_initialization::SLOW_VECTOR_INITIALIZATION,
1104 trivially_copy_pass_by_ref::TRIVIALLY_COPY_PASS_BY_REF,
1109 reg.register_lint_group("clippy::cargo", Some("clippy_cargo"), vec![
1110 cargo_common_metadata::CARGO_COMMON_METADATA,
1111 multiple_crate_versions::MULTIPLE_CRATE_VERSIONS,
1112 wildcard_dependencies::WILDCARD_DEPENDENCIES,
1115 reg.register_lint_group("clippy::nursery", Some("clippy_nursery"), vec![
1116 attrs::EMPTY_LINE_AFTER_OUTER_ATTR,
1117 fallible_impl_from::FALLIBLE_IMPL_FROM,
1118 missing_const_for_fn::MISSING_CONST_FOR_FN,
1119 mutex_atomic::MUTEX_INTEGER,
1120 needless_borrow::NEEDLESS_BORROW,
1121 redundant_clone::REDUNDANT_CLONE,
1122 unwrap::PANICKING_UNWRAP,
1123 unwrap::UNNECESSARY_UNWRAP,
1127 /// Register renamed lints.
1129 /// Used in `./src/driver.rs`.
1130 pub fn register_renamed(ls: &mut rustc::lint::LintStore) {
1131 ls.register_renamed("clippy::stutter", "clippy::module_name_repetitions");
1132 ls.register_renamed("clippy::new_without_default_derive", "clippy::new_without_default");
1133 ls.register_renamed("clippy::cyclomatic_complexity", "clippy::cognitive_complexity");
1136 // only exists to let the dogfood integration test works.
1137 // Don't run clippy as an executable directly
1140 panic!("Please use the cargo-clippy executable");