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 #![feature(str_escape)]
9 #![allow(clippy::missing_docs_in_private_items)]
10 #![recursion_limit = "256"]
11 #![warn(rust_2018_idioms, trivial_casts, trivial_numeric_casts)]
12 #![feature(crate_visibility_modifier)]
15 // FIXME: switch to something more ergonomic here, once available.
16 // (currently there is no way to opt into sysroot crates w/o `extern crate`)
17 #[allow(unused_extern_crates)]
18 extern crate fmt_macros;
19 #[allow(unused_extern_crates)]
21 #[allow(unused_extern_crates)]
22 extern crate rustc_data_structures;
23 #[allow(unused_extern_crates)]
24 extern crate rustc_errors;
25 #[allow(unused_extern_crates)]
26 extern crate rustc_mir;
27 #[allow(unused_extern_crates)]
28 extern crate rustc_plugin;
29 #[allow(unused_extern_crates)]
30 extern crate rustc_target;
31 #[allow(unused_extern_crates)]
32 extern crate rustc_typeck;
33 #[allow(unused_extern_crates)]
35 #[allow(unused_extern_crates)]
36 extern crate syntax_pos;
40 /// Macro used to declare a Clippy lint.
42 /// Every lint declaration consists of 4 parts:
44 /// 1. The documentation above the lint, which is used for the website
45 /// 2. The `LINT_NAME`. See [lint naming][lint_naming] on lint naming conventions.
46 /// 3. The `lint_level`, which is a mapping from *one* of our lint groups to `Allow`, `Warn` or
47 /// `Deny`. The lint level here has nothing to do with what lint groups the lint is a part of.
48 /// 4. The `description` that contains a short explanation on what's wrong with code where the
49 /// lint is triggered.
51 /// Currently the categories `style`, `correctness`, `complexity` and `perf` are enabled by default.
52 /// As said in the README.md of this repository, if the lint level mapping changes, please update
58 /// # #![feature(rustc_private)]
59 /// # #[allow(unused_extern_crates)]
60 /// # extern crate rustc;
62 /// # use clippy_lints::declare_clippy_lint;
63 /// use rustc::declare_tool_lint;
65 /// /// **What it does:** Checks for ... (describe what the lint matches).
67 /// /// **Why is this bad?** Supply the reason for linting the code.
69 /// /// **Known problems:** None. (Or describe where it could go wrong.)
75 /// /// Insert a short example of code that triggers the lint
78 /// /// Insert a short example of improved code that doesn't trigger the lint
80 /// declare_clippy_lint! {
86 /// [lint_naming]: https://rust-lang.github.io/rfcs/0344-conventions-galore.html#lints
88 macro_rules! declare_clippy_lint {
89 { pub $name:tt, style, $description:tt } => {
90 declare_tool_lint! { pub clippy::$name, Warn, $description, report_in_external_macro: true }
92 { pub $name:tt, correctness, $description:tt } => {
93 declare_tool_lint! { pub clippy::$name, Deny, $description, report_in_external_macro: true }
95 { pub $name:tt, complexity, $description:tt } => {
96 declare_tool_lint! { pub clippy::$name, Warn, $description, report_in_external_macro: true }
98 { pub $name:tt, perf, $description:tt } => {
99 declare_tool_lint! { pub clippy::$name, Warn, $description, report_in_external_macro: true }
101 { pub $name:tt, pedantic, $description:tt } => {
102 declare_tool_lint! { pub clippy::$name, Allow, $description, report_in_external_macro: true }
104 { pub $name:tt, restriction, $description:tt } => {
105 declare_tool_lint! { pub clippy::$name, Allow, $description, report_in_external_macro: true }
107 { pub $name:tt, cargo, $description:tt } => {
108 declare_tool_lint! { pub clippy::$name, Allow, $description, report_in_external_macro: true }
110 { pub $name:tt, nursery, $description:tt } => {
111 declare_tool_lint! { pub clippy::$name, Allow, $description, report_in_external_macro: true }
113 { pub $name:tt, internal, $description:tt } => {
114 declare_tool_lint! { pub clippy::$name, Allow, $description, report_in_external_macro: true }
116 { pub $name:tt, internal_warn, $description:tt } => {
117 declare_tool_lint! { pub clippy::$name, Warn, $description, report_in_external_macro: true }
125 // begin lints modules, do not remove this comment, it’s used in `update_lints`
126 pub mod approx_const;
128 pub mod assertions_on_constants;
132 pub mod blacklisted_name;
133 pub mod block_in_if_condition;
136 pub mod cargo_common_metadata;
137 pub mod collapsible_if;
138 pub mod const_static_lifetime;
140 pub mod copy_iterator;
141 pub mod cyclomatic_complexity;
143 pub mod default_trait_access;
146 pub mod double_comparison;
147 pub mod double_parens;
148 pub mod drop_forget_ref;
149 pub mod duration_subsec;
150 pub mod else_if_without_else;
154 pub mod enum_glob_use;
155 pub mod enum_variants;
159 pub mod eta_reduction;
160 pub mod eval_order_dependence;
161 pub mod excessive_precision;
162 pub mod explicit_write;
163 pub mod fallible_impl_from;
167 pub mod identity_conversion;
170 pub mod implicit_return;
171 pub mod indexing_slicing;
172 pub mod infallible_destructuring_match;
173 pub mod infinite_iter;
174 pub mod inherent_impl;
175 pub mod inline_fn_without_body;
176 pub mod int_plus_one;
178 pub mod items_after_statements;
179 pub mod large_enum_variant;
183 pub mod literal_representation;
188 pub mod mem_discriminant;
195 pub mod missing_const_for_fn;
197 pub mod missing_inline;
198 pub mod multiple_crate_versions;
200 pub mod mut_reference;
201 pub mod mutex_atomic;
202 pub mod needless_bool;
203 pub mod needless_borrow;
204 pub mod needless_borrowed_ref;
205 pub mod needless_continue;
206 pub mod needless_pass_by_value;
207 pub mod needless_update;
208 pub mod neg_cmp_op_on_partial_ord;
209 pub mod neg_multiply;
210 pub mod new_without_default;
212 pub mod non_copy_const;
213 pub mod non_expressive_names;
215 pub mod open_options;
216 pub mod overflow_check_conditional;
217 pub mod panic_unimplemented;
218 pub mod partialeq_ne_impl;
221 pub mod ptr_offset_with_cast;
222 pub mod question_mark;
224 pub mod redundant_clone;
225 pub mod redundant_field_names;
226 pub mod redundant_pattern_matching;
229 pub mod replace_consts;
233 pub mod slow_vector_initialization;
235 pub mod suspicious_trait_impl;
237 pub mod temporary_assignment;
239 pub mod trivially_copy_pass_by_ref;
242 pub mod unsafe_removed_from_name;
243 pub mod unused_io_amount;
244 pub mod unused_label;
248 pub mod wildcard_dependencies;
250 pub mod zero_div_zero;
251 // end lints modules, do not remove this comment, it’s used in `update_lints`
253 pub use crate::utils::conf::Conf;
256 crate use syntax::ast::{Name, NodeId};
259 /// Register all pre expansion lints
261 /// Pre-expansion lints run before any macro expansion has happened.
263 /// Note that due to the architechture of the compiler, currently `cfg_attr` attributes on crate
264 /// level (i.e `#![cfg_attr(...)]`) will still be expanded even when using a pre-expansion pass.
266 /// Used in `./src/driver.rs`.
267 pub fn register_pre_expansion_lints(
268 session: &rustc::session::Session,
269 store: &mut rustc::lint::LintStore,
272 store.register_pre_expansion_pass(Some(session), true, false, box write::Pass);
273 store.register_pre_expansion_pass(
277 box redundant_field_names::RedundantFieldNames,
279 store.register_pre_expansion_pass(
283 box non_expressive_names::NonExpressiveNames {
284 single_char_binding_names_threshold: conf.single_char_binding_names_threshold,
287 store.register_pre_expansion_pass(Some(session), true, false, box attrs::CfgAttrPass);
288 store.register_pre_expansion_pass(Some(session), true, false, box dbg_macro::Pass);
292 pub fn read_conf(reg: &rustc_plugin::Registry<'_>) -> Conf {
293 match utils::conf::file_from_args(reg.args()) {
295 // if the user specified a file, it must exist, otherwise default to `clippy.toml` but
296 // do not require the file to exist
297 let file_name = if let Some(file_name) = file_name {
300 match utils::conf::lookup_conf_file() {
304 .struct_err(&format!("error finding Clippy's configuration file: {}", error))
311 let file_name = file_name.map(|file_name| {
312 if file_name.is_relative() {
314 .local_crate_source_file
316 .and_then(|file| std::path::Path::new(&file).parent().map(std::path::Path::to_path_buf))
324 let (conf, errors) = utils::conf::read(file_name.as_ref().map(|p| p.as_ref()));
326 // all conf errors are non-fatal, we just use the default conf in case of error
327 for error in errors {
329 .struct_err(&format!(
330 "error reading Clippy's configuration file `{}`: {}",
331 file_name.as_ref().and_then(|p| p.to_str()).unwrap_or(""),
339 Err((err, span)) => {
341 .struct_span_err(span, err)
342 .span_note(span, "Clippy will use default configuration")
344 toml::from_str("").expect("we never error on empty config files")
349 /// Register all lints and lint groups with the rustc plugin registry
351 /// Used in `./src/driver.rs`.
352 #[allow(clippy::too_many_lines)]
354 pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
355 let mut store = reg.sess.lint_store.borrow_mut();
356 // begin deprecated lints, do not remove this comment, it’s used in `update_lints`
357 store.register_removed(
359 "`assert!()` will be more flexible with RFC 2011",
361 store.register_removed(
363 "`.extend_from_slice(_)` is a faster way to extend a Vec by a slice",
365 store.register_removed(
366 "range_step_by_zero",
367 "`iterator.step_by(0)` panics nowadays",
369 store.register_removed(
371 "`Vec::as_slice` has been stabilized in 1.7",
373 store.register_removed(
374 "unstable_as_mut_slice",
375 "`Vec::as_mut_slice` has been stabilized in 1.7",
377 store.register_removed(
379 "using `str::to_string` is common even today and specialization will likely happen soon",
381 store.register_removed(
383 "using `string::to_string` is common even today and specialization will likely happen soon",
385 store.register_removed(
386 "misaligned_transmute",
387 "this lint has been split into cast_ptr_alignment and transmute_ptr_to_ptr",
389 store.register_removed(
391 "using compound assignment operators (e.g. `+=`) is harmless",
393 store.register_removed(
394 "if_let_redundant_pattern_matching",
395 "this lint has been changed to redundant_pattern_matching",
397 store.register_removed(
398 "unsafe_vector_initialization",
399 "the replacement suggested by this lint had substantially different behavior",
401 // end deprecated lints, do not remove this comment, it’s used in `update_lints`
403 reg.register_late_lint_pass(box serde_api::Serde);
404 reg.register_early_lint_pass(box utils::internal_lints::Clippy);
405 reg.register_late_lint_pass(box utils::internal_lints::CompilerLintFunctions::new());
406 reg.register_early_lint_pass(box utils::internal_lints::DefaultHashTypes::default());
407 reg.register_late_lint_pass(box utils::internal_lints::LintWithoutLintPass::default());
408 reg.register_late_lint_pass(box utils::inspector::Pass);
409 reg.register_late_lint_pass(box utils::author::Pass);
410 reg.register_late_lint_pass(box types::TypePass);
411 reg.register_late_lint_pass(box booleans::NonminimalBool);
412 reg.register_late_lint_pass(box eq_op::EqOp);
413 reg.register_early_lint_pass(box enum_variants::EnumVariantNames::new(conf.enum_variant_name_threshold));
414 reg.register_late_lint_pass(box enum_glob_use::EnumGlobUse);
415 reg.register_late_lint_pass(box enum_clike::UnportableVariant);
416 reg.register_late_lint_pass(box excessive_precision::ExcessivePrecision);
417 reg.register_late_lint_pass(box bit_mask::BitMask::new(conf.verbose_bit_mask_threshold));
418 reg.register_late_lint_pass(box ptr::PointerPass);
419 reg.register_late_lint_pass(box needless_bool::NeedlessBool);
420 reg.register_late_lint_pass(box needless_bool::BoolComparison);
421 reg.register_late_lint_pass(box approx_const::Pass);
422 reg.register_late_lint_pass(box misc::Pass);
423 reg.register_early_lint_pass(box precedence::Precedence);
424 reg.register_early_lint_pass(box needless_continue::NeedlessContinue);
425 reg.register_late_lint_pass(box eta_reduction::EtaPass);
426 reg.register_late_lint_pass(box identity_op::IdentityOp);
427 reg.register_late_lint_pass(box erasing_op::ErasingOp);
428 reg.register_early_lint_pass(box items_after_statements::ItemsAfterStatements);
429 reg.register_late_lint_pass(box mut_mut::MutMut);
430 reg.register_late_lint_pass(box mut_reference::UnnecessaryMutPassed);
431 reg.register_late_lint_pass(box len_zero::LenZero);
432 reg.register_late_lint_pass(box attrs::AttrPass);
433 reg.register_early_lint_pass(box collapsible_if::CollapsibleIf);
434 reg.register_late_lint_pass(box block_in_if_condition::BlockInIfCondition);
435 reg.register_late_lint_pass(box unicode::Unicode);
436 reg.register_late_lint_pass(box strings::StringAdd);
437 reg.register_early_lint_pass(box returns::ReturnPass);
438 reg.register_late_lint_pass(box implicit_return::Pass);
439 reg.register_late_lint_pass(box methods::Pass);
440 reg.register_late_lint_pass(box map_clone::Pass);
441 reg.register_late_lint_pass(box shadow::Pass);
442 reg.register_late_lint_pass(box types::LetPass);
443 reg.register_late_lint_pass(box types::UnitCmp);
444 reg.register_late_lint_pass(box loops::Pass);
445 reg.register_late_lint_pass(box lifetimes::LifetimePass);
446 reg.register_late_lint_pass(box entry::HashMapLint);
447 reg.register_late_lint_pass(box ranges::Pass);
448 reg.register_late_lint_pass(box types::CastPass);
449 reg.register_late_lint_pass(box types::TypeComplexityPass::new(conf.type_complexity_threshold));
450 reg.register_late_lint_pass(box matches::MatchPass);
451 reg.register_late_lint_pass(box minmax::MinMaxPass);
452 reg.register_late_lint_pass(box open_options::NonSensical);
453 reg.register_late_lint_pass(box zero_div_zero::Pass);
454 reg.register_late_lint_pass(box mutex_atomic::MutexAtomic);
455 reg.register_late_lint_pass(box needless_update::Pass);
456 reg.register_late_lint_pass(box needless_borrow::NeedlessBorrow::default());
457 reg.register_late_lint_pass(box needless_borrowed_ref::NeedlessBorrowedRef);
458 reg.register_late_lint_pass(box no_effect::Pass);
459 reg.register_late_lint_pass(box temporary_assignment::Pass);
460 reg.register_late_lint_pass(box transmute::Transmute);
461 reg.register_late_lint_pass(
462 box cyclomatic_complexity::CyclomaticComplexity::new(conf.cyclomatic_complexity_threshold)
464 reg.register_late_lint_pass(box escape::Pass{too_large_for_stack: conf.too_large_for_stack});
465 reg.register_early_lint_pass(box misc_early::MiscEarly);
466 reg.register_late_lint_pass(box panic_unimplemented::Pass);
467 reg.register_late_lint_pass(box strings::StringLitAsBytes);
468 reg.register_late_lint_pass(box derive::Derive);
469 reg.register_late_lint_pass(box types::CharLitAsU8);
470 reg.register_late_lint_pass(box vec::Pass);
471 reg.register_late_lint_pass(box drop_forget_ref::Pass);
472 reg.register_late_lint_pass(box empty_enum::EmptyEnum);
473 reg.register_late_lint_pass(box types::AbsurdExtremeComparisons);
474 reg.register_late_lint_pass(box types::InvalidUpcastComparisons);
475 reg.register_late_lint_pass(box regex::Pass::default());
476 reg.register_late_lint_pass(box copies::CopyAndPaste);
477 reg.register_late_lint_pass(box copy_iterator::CopyIterator);
478 reg.register_late_lint_pass(box format::Pass);
479 reg.register_early_lint_pass(box formatting::Formatting);
480 reg.register_late_lint_pass(box swap::Swap);
481 reg.register_early_lint_pass(box if_not_else::IfNotElse);
482 reg.register_early_lint_pass(box else_if_without_else::ElseIfWithoutElse);
483 reg.register_early_lint_pass(box int_plus_one::IntPlusOne);
484 reg.register_late_lint_pass(box overflow_check_conditional::OverflowCheckConditional);
485 reg.register_late_lint_pass(box unused_label::UnusedLabel);
486 reg.register_late_lint_pass(box new_without_default::NewWithoutDefault::default());
487 reg.register_late_lint_pass(box blacklisted_name::BlackListedName::new(
488 conf.blacklisted_names.iter().cloned().collect()
490 reg.register_late_lint_pass(box functions::Functions::new(conf.too_many_arguments_threshold, conf.too_many_lines_threshold));
491 reg.register_early_lint_pass(box doc::Doc::new(conf.doc_valid_idents.iter().cloned().collect()));
492 reg.register_late_lint_pass(box neg_multiply::NegMultiply);
493 reg.register_early_lint_pass(box unsafe_removed_from_name::UnsafeNameRemoval);
494 reg.register_late_lint_pass(box mem_discriminant::MemDiscriminant);
495 reg.register_late_lint_pass(box mem_forget::MemForget);
496 reg.register_late_lint_pass(box mem_replace::MemReplace);
497 reg.register_late_lint_pass(box arithmetic::Arithmetic::default());
498 reg.register_late_lint_pass(box assign_ops::AssignOps);
499 reg.register_late_lint_pass(box let_if_seq::LetIfSeq);
500 reg.register_late_lint_pass(box eval_order_dependence::EvalOrderDependence);
501 reg.register_late_lint_pass(box missing_doc::MissingDoc::new());
502 reg.register_late_lint_pass(box missing_inline::MissingInline);
503 reg.register_late_lint_pass(box ok_if_let::Pass);
504 reg.register_late_lint_pass(box redundant_pattern_matching::Pass);
505 reg.register_late_lint_pass(box partialeq_ne_impl::Pass);
506 reg.register_early_lint_pass(box reference::Pass);
507 reg.register_early_lint_pass(box reference::DerefPass);
508 reg.register_early_lint_pass(box double_parens::DoubleParens);
509 reg.register_late_lint_pass(box unused_io_amount::UnusedIoAmount);
510 reg.register_late_lint_pass(box large_enum_variant::LargeEnumVariant::new(conf.enum_variant_size_threshold));
511 reg.register_late_lint_pass(box explicit_write::Pass);
512 reg.register_late_lint_pass(box needless_pass_by_value::NeedlessPassByValue);
513 reg.register_late_lint_pass(box trivially_copy_pass_by_ref::TriviallyCopyPassByRef::new(
514 conf.trivial_copy_size_limit,
517 reg.register_early_lint_pass(box literal_representation::LiteralDigitGrouping);
518 reg.register_early_lint_pass(box literal_representation::LiteralRepresentation::new(
519 conf.literal_representation_threshold
521 reg.register_late_lint_pass(box use_self::UseSelf);
522 reg.register_late_lint_pass(box bytecount::ByteCount);
523 reg.register_late_lint_pass(box infinite_iter::Pass);
524 reg.register_late_lint_pass(box inline_fn_without_body::Pass);
525 reg.register_late_lint_pass(box invalid_ref::InvalidRef);
526 reg.register_late_lint_pass(box identity_conversion::IdentityConversion::default());
527 reg.register_late_lint_pass(box types::ImplicitHasher);
528 reg.register_early_lint_pass(box const_static_lifetime::StaticConst);
529 reg.register_late_lint_pass(box fallible_impl_from::FallibleImplFrom);
530 reg.register_late_lint_pass(box replace_consts::ReplaceConsts);
531 reg.register_late_lint_pass(box types::UnitArg);
532 reg.register_late_lint_pass(box double_comparison::Pass);
533 reg.register_late_lint_pass(box question_mark::Pass);
534 reg.register_late_lint_pass(box suspicious_trait_impl::SuspiciousImpl);
535 reg.register_early_lint_pass(box cargo_common_metadata::Pass);
536 reg.register_early_lint_pass(box multiple_crate_versions::Pass);
537 reg.register_early_lint_pass(box wildcard_dependencies::Pass);
538 reg.register_late_lint_pass(box map_unit_fn::Pass);
539 reg.register_late_lint_pass(box infallible_destructuring_match::Pass);
540 reg.register_late_lint_pass(box inherent_impl::Pass::default());
541 reg.register_late_lint_pass(box neg_cmp_op_on_partial_ord::NoNegCompOpForPartialOrd);
542 reg.register_late_lint_pass(box unwrap::Pass);
543 reg.register_late_lint_pass(box duration_subsec::DurationSubsec);
544 reg.register_late_lint_pass(box default_trait_access::DefaultTraitAccess);
545 reg.register_late_lint_pass(box indexing_slicing::IndexingSlicing);
546 reg.register_late_lint_pass(box non_copy_const::NonCopyConst);
547 reg.register_late_lint_pass(box ptr_offset_with_cast::Pass);
548 reg.register_late_lint_pass(box redundant_clone::RedundantClone);
549 reg.register_late_lint_pass(box slow_vector_initialization::Pass);
550 reg.register_late_lint_pass(box types::RefToMut);
551 reg.register_late_lint_pass(box assertions_on_constants::AssertionsOnConstants);
552 reg.register_late_lint_pass(box missing_const_for_fn::MissingConstForFn);
554 reg.register_lint_group("clippy::restriction", Some("clippy_restriction"), vec![
555 arithmetic::FLOAT_ARITHMETIC,
556 arithmetic::INTEGER_ARITHMETIC,
557 dbg_macro::DBG_MACRO,
558 else_if_without_else::ELSE_IF_WITHOUT_ELSE,
559 implicit_return::IMPLICIT_RETURN,
560 indexing_slicing::INDEXING_SLICING,
561 inherent_impl::MULTIPLE_INHERENT_IMPL,
562 literal_representation::DECIMAL_LITERAL_REPRESENTATION,
563 matches::WILDCARD_ENUM_MATCH_ARM,
564 mem_forget::MEM_FORGET,
565 methods::CLONE_ON_REF_PTR,
566 methods::OPTION_UNWRAP_USED,
567 methods::RESULT_UNWRAP_USED,
568 methods::WRONG_PUB_SELF_CONVENTION,
569 misc::FLOAT_CMP_CONST,
570 missing_doc::MISSING_DOCS_IN_PRIVATE_ITEMS,
571 missing_inline::MISSING_INLINE_IN_PUBLIC_ITEMS,
572 panic_unimplemented::UNIMPLEMENTED,
573 shadow::SHADOW_REUSE,
580 reg.register_lint_group("clippy::pedantic", Some("clippy_pedantic"), vec![
581 attrs::INLINE_ALWAYS,
582 copies::MATCH_SAME_ARMS,
583 copy_iterator::COPY_ITERATOR,
584 default_trait_access::DEFAULT_TRAIT_ACCESS,
585 derive::EXPL_IMPL_CLONE_ON_COPY,
587 empty_enum::EMPTY_ENUM,
588 enum_glob_use::ENUM_GLOB_USE,
589 enum_variants::MODULE_NAME_REPETITIONS,
590 enum_variants::PUB_ENUM_VARIANT_NAMES,
591 functions::TOO_MANY_LINES,
592 if_not_else::IF_NOT_ELSE,
593 infinite_iter::MAYBE_INFINITE_ITER,
594 items_after_statements::ITEMS_AFTER_STATEMENTS,
595 literal_representation::LARGE_DIGIT_GROUPS,
596 loops::EXPLICIT_INTO_ITER_LOOP,
597 loops::EXPLICIT_ITER_LOOP,
598 matches::SINGLE_MATCH_ELSE,
600 methods::MAP_FLATTEN,
601 methods::OPTION_MAP_UNWRAP_OR,
602 methods::OPTION_MAP_UNWRAP_OR_ELSE,
603 methods::RESULT_MAP_UNWRAP_OR_ELSE,
604 misc::USED_UNDERSCORE_BINDING,
605 misc_early::UNSEPARATED_LITERAL_SUFFIX,
607 needless_continue::NEEDLESS_CONTINUE,
608 needless_pass_by_value::NEEDLESS_PASS_BY_VALUE,
609 non_expressive_names::SIMILAR_NAMES,
610 replace_consts::REPLACE_CONSTS,
611 shadow::SHADOW_UNRELATED,
612 strings::STRING_ADD_ASSIGN,
613 types::CAST_POSSIBLE_TRUNCATION,
614 types::CAST_POSSIBLE_WRAP,
615 types::CAST_PRECISION_LOSS,
616 types::CAST_SIGN_LOSS,
617 types::INVALID_UPCAST_COMPARISONS,
619 unicode::NON_ASCII_LITERAL,
620 unicode::UNICODE_NOT_NFC,
624 reg.register_lint_group("clippy::internal", Some("clippy_internal"), vec![
625 utils::internal_lints::CLIPPY_LINTS_INTERNAL,
626 utils::internal_lints::COMPILER_LINT_FUNCTIONS,
627 utils::internal_lints::DEFAULT_HASH_TYPES,
628 utils::internal_lints::LINT_WITHOUT_LINT_PASS,
631 reg.register_lint_group("clippy::all", Some("clippy"), vec![
632 approx_const::APPROX_CONSTANT,
633 assertions_on_constants::ASSERTIONS_ON_CONSTANTS,
634 assign_ops::ASSIGN_OP_PATTERN,
635 assign_ops::MISREFACTORED_ASSIGN_OP,
636 attrs::DEPRECATED_CFG_ATTR,
637 attrs::DEPRECATED_SEMVER,
638 attrs::UNKNOWN_CLIPPY_LINTS,
639 attrs::USELESS_ATTRIBUTE,
640 bit_mask::BAD_BIT_MASK,
641 bit_mask::INEFFECTIVE_BIT_MASK,
642 bit_mask::VERBOSE_BIT_MASK,
643 blacklisted_name::BLACKLISTED_NAME,
644 block_in_if_condition::BLOCK_IN_IF_CONDITION_EXPR,
645 block_in_if_condition::BLOCK_IN_IF_CONDITION_STMT,
647 booleans::NONMINIMAL_BOOL,
648 bytecount::NAIVE_BYTECOUNT,
649 collapsible_if::COLLAPSIBLE_IF,
650 const_static_lifetime::CONST_STATIC_LIFETIME,
651 copies::IFS_SAME_COND,
652 copies::IF_SAME_THEN_ELSE,
653 cyclomatic_complexity::CYCLOMATIC_COMPLEXITY,
654 derive::DERIVE_HASH_XOR_EQ,
655 double_comparison::DOUBLE_COMPARISONS,
656 double_parens::DOUBLE_PARENS,
657 drop_forget_ref::DROP_COPY,
658 drop_forget_ref::DROP_REF,
659 drop_forget_ref::FORGET_COPY,
660 drop_forget_ref::FORGET_REF,
661 duration_subsec::DURATION_SUBSEC,
663 enum_clike::ENUM_CLIKE_UNPORTABLE_VARIANT,
664 enum_variants::ENUM_VARIANT_NAMES,
665 enum_variants::MODULE_INCEPTION,
668 erasing_op::ERASING_OP,
670 eta_reduction::REDUNDANT_CLOSURE,
671 eval_order_dependence::DIVERGING_SUB_EXPRESSION,
672 eval_order_dependence::EVAL_ORDER_DEPENDENCE,
673 excessive_precision::EXCESSIVE_PRECISION,
674 explicit_write::EXPLICIT_WRITE,
675 format::USELESS_FORMAT,
676 formatting::POSSIBLE_MISSING_COMMA,
677 formatting::SUSPICIOUS_ASSIGNMENT_FORMATTING,
678 formatting::SUSPICIOUS_ELSE_FORMATTING,
679 functions::NOT_UNSAFE_PTR_ARG_DEREF,
680 functions::TOO_MANY_ARGUMENTS,
681 identity_conversion::IDENTITY_CONVERSION,
682 identity_op::IDENTITY_OP,
683 indexing_slicing::OUT_OF_BOUNDS_INDEXING,
684 infallible_destructuring_match::INFALLIBLE_DESTRUCTURING_MATCH,
685 infinite_iter::INFINITE_ITER,
686 inline_fn_without_body::INLINE_FN_WITHOUT_BODY,
687 int_plus_one::INT_PLUS_ONE,
688 invalid_ref::INVALID_REF,
689 large_enum_variant::LARGE_ENUM_VARIANT,
690 len_zero::LEN_WITHOUT_IS_EMPTY,
692 let_if_seq::USELESS_LET_IF_SEQ,
693 lifetimes::EXTRA_UNUSED_LIFETIMES,
694 lifetimes::NEEDLESS_LIFETIMES,
695 literal_representation::INCONSISTENT_DIGIT_GROUPING,
696 literal_representation::MISTYPED_LITERAL_SUFFIXES,
697 literal_representation::UNREADABLE_LITERAL,
699 loops::EXPLICIT_COUNTER_LOOP,
701 loops::FOR_LOOP_OVER_OPTION,
702 loops::FOR_LOOP_OVER_RESULT,
703 loops::ITER_NEXT_LOOP,
704 loops::MANUAL_MEMCPY,
705 loops::MUT_RANGE_BOUND,
706 loops::NEEDLESS_COLLECT,
707 loops::NEEDLESS_RANGE_LOOP,
709 loops::REVERSE_RANGE_LOOP,
710 loops::UNUSED_COLLECT,
711 loops::WHILE_IMMUTABLE_CONDITION,
712 loops::WHILE_LET_LOOP,
713 loops::WHILE_LET_ON_ITERATOR,
714 map_clone::MAP_CLONE,
715 map_unit_fn::OPTION_MAP_UNIT_FN,
716 map_unit_fn::RESULT_MAP_UNIT_FN,
717 matches::MATCH_AS_REF,
719 matches::MATCH_OVERLAPPING_ARM,
720 matches::MATCH_REF_PATS,
721 matches::MATCH_WILD_ERR_ARM,
722 matches::SINGLE_MATCH,
723 mem_discriminant::MEM_DISCRIMINANT_NON_ENUM,
724 mem_replace::MEM_REPLACE_OPTION_WITH_NONE,
725 methods::CHARS_LAST_CMP,
726 methods::CHARS_NEXT_CMP,
727 methods::CLONE_DOUBLE_REF,
728 methods::CLONE_ON_COPY,
729 methods::EXPECT_FUN_CALL,
730 methods::FILTER_NEXT,
732 methods::INTO_ITER_ON_ARRAY,
733 methods::INTO_ITER_ON_REF,
734 methods::ITER_CLONED_COLLECT,
736 methods::ITER_SKIP_NEXT,
737 methods::NEW_RET_NO_SELF,
739 methods::OPTION_MAP_OR_NONE,
740 methods::OR_FUN_CALL,
741 methods::SEARCH_IS_SOME,
742 methods::SHOULD_IMPLEMENT_TRAIT,
743 methods::SINGLE_CHAR_PATTERN,
744 methods::STRING_EXTEND_CHARS,
745 methods::TEMPORARY_CSTRING_AS_PTR,
746 methods::UNNECESSARY_FILTER_MAP,
747 methods::UNNECESSARY_FOLD,
748 methods::USELESS_ASREF,
749 methods::WRONG_SELF_CONVENTION,
755 misc::REDUNDANT_PATTERN,
756 misc::SHORT_CIRCUIT_STATEMENT,
757 misc::TOPLEVEL_REF_ARG,
759 misc_early::BUILTIN_TYPE_SHADOW,
760 misc_early::DOUBLE_NEG,
761 misc_early::DUPLICATE_UNDERSCORE_ARGUMENT,
762 misc_early::MIXED_CASE_HEX_LITERALS,
763 misc_early::REDUNDANT_CLOSURE_CALL,
764 misc_early::UNNEEDED_FIELD_PATTERN,
765 misc_early::ZERO_PREFIXED_LITERAL,
766 mut_reference::UNNECESSARY_MUT_PASSED,
767 mutex_atomic::MUTEX_ATOMIC,
768 needless_bool::BOOL_COMPARISON,
769 needless_bool::NEEDLESS_BOOL,
770 needless_borrowed_ref::NEEDLESS_BORROWED_REFERENCE,
771 needless_update::NEEDLESS_UPDATE,
772 neg_cmp_op_on_partial_ord::NEG_CMP_OP_ON_PARTIAL_ORD,
773 neg_multiply::NEG_MULTIPLY,
774 new_without_default::NEW_WITHOUT_DEFAULT,
775 no_effect::NO_EFFECT,
776 no_effect::UNNECESSARY_OPERATION,
777 non_copy_const::BORROW_INTERIOR_MUTABLE_CONST,
778 non_copy_const::DECLARE_INTERIOR_MUTABLE_CONST,
779 non_expressive_names::JUST_UNDERSCORES_AND_DIGITS,
780 non_expressive_names::MANY_SINGLE_CHAR_NAMES,
781 ok_if_let::IF_LET_SOME_RESULT,
782 open_options::NONSENSICAL_OPEN_OPTIONS,
783 overflow_check_conditional::OVERFLOW_CHECK_CONDITIONAL,
784 panic_unimplemented::PANIC_PARAMS,
785 partialeq_ne_impl::PARTIALEQ_NE_IMPL,
786 precedence::PRECEDENCE,
790 ptr_offset_with_cast::PTR_OFFSET_WITH_CAST,
791 question_mark::QUESTION_MARK,
792 ranges::ITERATOR_STEP_BY_ZERO,
793 ranges::RANGE_MINUS_ONE,
794 ranges::RANGE_PLUS_ONE,
795 ranges::RANGE_ZIP_WITH_LEN,
796 redundant_field_names::REDUNDANT_FIELD_NAMES,
797 redundant_pattern_matching::REDUNDANT_PATTERN_MATCHING,
798 reference::DEREF_ADDROF,
799 reference::REF_IN_DEREF,
800 regex::INVALID_REGEX,
802 regex::TRIVIAL_REGEX,
803 returns::LET_AND_RETURN,
804 returns::NEEDLESS_RETURN,
805 returns::UNUSED_UNIT,
806 serde_api::SERDE_API_MISUSE,
807 slow_vector_initialization::SLOW_VECTOR_INITIALIZATION,
808 strings::STRING_LIT_AS_BYTES,
809 suspicious_trait_impl::SUSPICIOUS_ARITHMETIC_IMPL,
810 suspicious_trait_impl::SUSPICIOUS_OP_ASSIGN_IMPL,
811 swap::ALMOST_SWAPPED,
813 temporary_assignment::TEMPORARY_ASSIGNMENT,
814 transmute::CROSSPOINTER_TRANSMUTE,
815 transmute::TRANSMUTE_BYTES_TO_STR,
816 transmute::TRANSMUTE_INT_TO_BOOL,
817 transmute::TRANSMUTE_INT_TO_CHAR,
818 transmute::TRANSMUTE_INT_TO_FLOAT,
819 transmute::TRANSMUTE_PTR_TO_PTR,
820 transmute::TRANSMUTE_PTR_TO_REF,
821 transmute::USELESS_TRANSMUTE,
822 transmute::WRONG_TRANSMUTE,
823 trivially_copy_pass_by_ref::TRIVIALLY_COPY_PASS_BY_REF,
824 types::ABSURD_EXTREME_COMPARISONS,
827 types::CAST_LOSSLESS,
828 types::CAST_PTR_ALIGNMENT,
829 types::CAST_REF_TO_MUT,
830 types::CHAR_LIT_AS_U8,
831 types::FN_TO_NUMERIC_CAST,
832 types::FN_TO_NUMERIC_CAST_WITH_TRUNCATION,
833 types::IMPLICIT_HASHER,
834 types::LET_UNIT_VALUE,
835 types::OPTION_OPTION,
836 types::TYPE_COMPLEXITY,
839 types::UNNECESSARY_CAST,
841 unicode::ZERO_WIDTH_SPACE,
842 unsafe_removed_from_name::UNSAFE_REMOVED_FROM_NAME,
843 unused_io_amount::UNUSED_IO_AMOUNT,
844 unused_label::UNUSED_LABEL,
846 write::PRINTLN_EMPTY_STRING,
847 write::PRINT_LITERAL,
848 write::PRINT_WITH_NEWLINE,
849 write::WRITELN_EMPTY_STRING,
850 write::WRITE_LITERAL,
851 write::WRITE_WITH_NEWLINE,
852 zero_div_zero::ZERO_DIVIDED_BY_ZERO,
855 reg.register_lint_group("clippy::style", Some("clippy_style"), vec![
856 assertions_on_constants::ASSERTIONS_ON_CONSTANTS,
857 assign_ops::ASSIGN_OP_PATTERN,
858 attrs::UNKNOWN_CLIPPY_LINTS,
859 bit_mask::VERBOSE_BIT_MASK,
860 blacklisted_name::BLACKLISTED_NAME,
861 block_in_if_condition::BLOCK_IN_IF_CONDITION_EXPR,
862 block_in_if_condition::BLOCK_IN_IF_CONDITION_STMT,
863 collapsible_if::COLLAPSIBLE_IF,
864 const_static_lifetime::CONST_STATIC_LIFETIME,
865 enum_variants::ENUM_VARIANT_NAMES,
866 enum_variants::MODULE_INCEPTION,
868 eta_reduction::REDUNDANT_CLOSURE,
869 excessive_precision::EXCESSIVE_PRECISION,
870 formatting::SUSPICIOUS_ASSIGNMENT_FORMATTING,
871 formatting::SUSPICIOUS_ELSE_FORMATTING,
872 infallible_destructuring_match::INFALLIBLE_DESTRUCTURING_MATCH,
873 len_zero::LEN_WITHOUT_IS_EMPTY,
875 let_if_seq::USELESS_LET_IF_SEQ,
876 literal_representation::INCONSISTENT_DIGIT_GROUPING,
877 literal_representation::UNREADABLE_LITERAL,
880 loops::NEEDLESS_RANGE_LOOP,
881 loops::WHILE_LET_ON_ITERATOR,
882 map_clone::MAP_CLONE,
884 matches::MATCH_OVERLAPPING_ARM,
885 matches::MATCH_REF_PATS,
886 matches::MATCH_WILD_ERR_ARM,
887 matches::SINGLE_MATCH,
888 mem_replace::MEM_REPLACE_OPTION_WITH_NONE,
889 methods::CHARS_LAST_CMP,
891 methods::INTO_ITER_ON_REF,
892 methods::ITER_CLONED_COLLECT,
893 methods::ITER_SKIP_NEXT,
894 methods::NEW_RET_NO_SELF,
896 methods::OPTION_MAP_OR_NONE,
897 methods::SHOULD_IMPLEMENT_TRAIT,
898 methods::STRING_EXTEND_CHARS,
899 methods::UNNECESSARY_FOLD,
900 methods::WRONG_SELF_CONVENTION,
901 misc::REDUNDANT_PATTERN,
902 misc::TOPLEVEL_REF_ARG,
904 misc_early::BUILTIN_TYPE_SHADOW,
905 misc_early::DOUBLE_NEG,
906 misc_early::DUPLICATE_UNDERSCORE_ARGUMENT,
907 misc_early::MIXED_CASE_HEX_LITERALS,
908 misc_early::UNNEEDED_FIELD_PATTERN,
909 mut_reference::UNNECESSARY_MUT_PASSED,
910 neg_multiply::NEG_MULTIPLY,
911 new_without_default::NEW_WITHOUT_DEFAULT,
912 non_expressive_names::JUST_UNDERSCORES_AND_DIGITS,
913 non_expressive_names::MANY_SINGLE_CHAR_NAMES,
914 ok_if_let::IF_LET_SOME_RESULT,
915 panic_unimplemented::PANIC_PARAMS,
918 question_mark::QUESTION_MARK,
919 redundant_field_names::REDUNDANT_FIELD_NAMES,
920 redundant_pattern_matching::REDUNDANT_PATTERN_MATCHING,
922 regex::TRIVIAL_REGEX,
923 returns::LET_AND_RETURN,
924 returns::NEEDLESS_RETURN,
925 returns::UNUSED_UNIT,
926 strings::STRING_LIT_AS_BYTES,
927 types::FN_TO_NUMERIC_CAST,
928 types::FN_TO_NUMERIC_CAST_WITH_TRUNCATION,
929 types::IMPLICIT_HASHER,
930 types::LET_UNIT_VALUE,
931 unsafe_removed_from_name::UNSAFE_REMOVED_FROM_NAME,
932 write::PRINTLN_EMPTY_STRING,
933 write::PRINT_LITERAL,
934 write::PRINT_WITH_NEWLINE,
935 write::WRITELN_EMPTY_STRING,
936 write::WRITE_LITERAL,
937 write::WRITE_WITH_NEWLINE,
940 reg.register_lint_group("clippy::complexity", Some("clippy_complexity"), vec![
941 assign_ops::MISREFACTORED_ASSIGN_OP,
942 attrs::DEPRECATED_CFG_ATTR,
943 booleans::NONMINIMAL_BOOL,
944 cyclomatic_complexity::CYCLOMATIC_COMPLEXITY,
945 double_comparison::DOUBLE_COMPARISONS,
946 double_parens::DOUBLE_PARENS,
947 duration_subsec::DURATION_SUBSEC,
948 eval_order_dependence::DIVERGING_SUB_EXPRESSION,
949 eval_order_dependence::EVAL_ORDER_DEPENDENCE,
950 explicit_write::EXPLICIT_WRITE,
951 format::USELESS_FORMAT,
952 functions::TOO_MANY_ARGUMENTS,
953 identity_conversion::IDENTITY_CONVERSION,
954 identity_op::IDENTITY_OP,
955 int_plus_one::INT_PLUS_ONE,
956 lifetimes::EXTRA_UNUSED_LIFETIMES,
957 lifetimes::NEEDLESS_LIFETIMES,
958 loops::EXPLICIT_COUNTER_LOOP,
959 loops::MUT_RANGE_BOUND,
960 loops::WHILE_LET_LOOP,
961 map_unit_fn::OPTION_MAP_UNIT_FN,
962 map_unit_fn::RESULT_MAP_UNIT_FN,
963 matches::MATCH_AS_REF,
964 methods::CHARS_NEXT_CMP,
965 methods::CLONE_ON_COPY,
966 methods::FILTER_NEXT,
967 methods::SEARCH_IS_SOME,
968 methods::UNNECESSARY_FILTER_MAP,
969 methods::USELESS_ASREF,
970 misc::SHORT_CIRCUIT_STATEMENT,
971 misc_early::REDUNDANT_CLOSURE_CALL,
972 misc_early::ZERO_PREFIXED_LITERAL,
973 needless_bool::BOOL_COMPARISON,
974 needless_bool::NEEDLESS_BOOL,
975 needless_borrowed_ref::NEEDLESS_BORROWED_REFERENCE,
976 needless_update::NEEDLESS_UPDATE,
977 neg_cmp_op_on_partial_ord::NEG_CMP_OP_ON_PARTIAL_ORD,
978 no_effect::NO_EFFECT,
979 no_effect::UNNECESSARY_OPERATION,
980 overflow_check_conditional::OVERFLOW_CHECK_CONDITIONAL,
981 partialeq_ne_impl::PARTIALEQ_NE_IMPL,
982 precedence::PRECEDENCE,
983 ptr_offset_with_cast::PTR_OFFSET_WITH_CAST,
984 ranges::RANGE_MINUS_ONE,
985 ranges::RANGE_PLUS_ONE,
986 ranges::RANGE_ZIP_WITH_LEN,
987 reference::DEREF_ADDROF,
988 reference::REF_IN_DEREF,
990 temporary_assignment::TEMPORARY_ASSIGNMENT,
991 transmute::CROSSPOINTER_TRANSMUTE,
992 transmute::TRANSMUTE_BYTES_TO_STR,
993 transmute::TRANSMUTE_INT_TO_BOOL,
994 transmute::TRANSMUTE_INT_TO_CHAR,
995 transmute::TRANSMUTE_INT_TO_FLOAT,
996 transmute::TRANSMUTE_PTR_TO_PTR,
997 transmute::TRANSMUTE_PTR_TO_REF,
998 transmute::USELESS_TRANSMUTE,
1000 types::CAST_LOSSLESS,
1001 types::CHAR_LIT_AS_U8,
1002 types::OPTION_OPTION,
1003 types::TYPE_COMPLEXITY,
1005 types::UNNECESSARY_CAST,
1007 unused_label::UNUSED_LABEL,
1008 zero_div_zero::ZERO_DIVIDED_BY_ZERO,
1011 reg.register_lint_group("clippy::correctness", Some("clippy_correctness"), vec![
1012 approx_const::APPROX_CONSTANT,
1013 attrs::DEPRECATED_SEMVER,
1014 attrs::USELESS_ATTRIBUTE,
1015 bit_mask::BAD_BIT_MASK,
1016 bit_mask::INEFFECTIVE_BIT_MASK,
1017 booleans::LOGIC_BUG,
1018 copies::IFS_SAME_COND,
1019 copies::IF_SAME_THEN_ELSE,
1020 derive::DERIVE_HASH_XOR_EQ,
1021 drop_forget_ref::DROP_COPY,
1022 drop_forget_ref::DROP_REF,
1023 drop_forget_ref::FORGET_COPY,
1024 drop_forget_ref::FORGET_REF,
1025 enum_clike::ENUM_CLIKE_UNPORTABLE_VARIANT,
1027 erasing_op::ERASING_OP,
1028 formatting::POSSIBLE_MISSING_COMMA,
1029 functions::NOT_UNSAFE_PTR_ARG_DEREF,
1030 indexing_slicing::OUT_OF_BOUNDS_INDEXING,
1031 infinite_iter::INFINITE_ITER,
1032 inline_fn_without_body::INLINE_FN_WITHOUT_BODY,
1033 invalid_ref::INVALID_REF,
1034 literal_representation::MISTYPED_LITERAL_SUFFIXES,
1035 loops::FOR_LOOP_OVER_OPTION,
1036 loops::FOR_LOOP_OVER_RESULT,
1037 loops::ITER_NEXT_LOOP,
1039 loops::REVERSE_RANGE_LOOP,
1040 loops::WHILE_IMMUTABLE_CONDITION,
1041 mem_discriminant::MEM_DISCRIMINANT_NON_ENUM,
1042 methods::CLONE_DOUBLE_REF,
1043 methods::INTO_ITER_ON_ARRAY,
1044 methods::TEMPORARY_CSTRING_AS_PTR,
1049 non_copy_const::BORROW_INTERIOR_MUTABLE_CONST,
1050 non_copy_const::DECLARE_INTERIOR_MUTABLE_CONST,
1051 open_options::NONSENSICAL_OPEN_OPTIONS,
1053 ranges::ITERATOR_STEP_BY_ZERO,
1054 regex::INVALID_REGEX,
1055 serde_api::SERDE_API_MISUSE,
1056 suspicious_trait_impl::SUSPICIOUS_ARITHMETIC_IMPL,
1057 suspicious_trait_impl::SUSPICIOUS_OP_ASSIGN_IMPL,
1058 swap::ALMOST_SWAPPED,
1059 transmute::WRONG_TRANSMUTE,
1060 types::ABSURD_EXTREME_COMPARISONS,
1061 types::CAST_PTR_ALIGNMENT,
1062 types::CAST_REF_TO_MUT,
1064 unicode::ZERO_WIDTH_SPACE,
1065 unused_io_amount::UNUSED_IO_AMOUNT,
1068 reg.register_lint_group("clippy::perf", Some("clippy_perf"), vec![
1069 bytecount::NAIVE_BYTECOUNT,
1071 escape::BOXED_LOCAL,
1072 large_enum_variant::LARGE_ENUM_VARIANT,
1073 loops::MANUAL_MEMCPY,
1074 loops::NEEDLESS_COLLECT,
1075 loops::UNUSED_COLLECT,
1076 methods::EXPECT_FUN_CALL,
1078 methods::OR_FUN_CALL,
1079 methods::SINGLE_CHAR_PATTERN,
1081 mutex_atomic::MUTEX_ATOMIC,
1082 slow_vector_initialization::SLOW_VECTOR_INITIALIZATION,
1083 trivially_copy_pass_by_ref::TRIVIALLY_COPY_PASS_BY_REF,
1088 reg.register_lint_group("clippy::cargo", Some("clippy_cargo"), vec![
1089 cargo_common_metadata::CARGO_COMMON_METADATA,
1090 multiple_crate_versions::MULTIPLE_CRATE_VERSIONS,
1091 wildcard_dependencies::WILDCARD_DEPENDENCIES,
1094 reg.register_lint_group("clippy::nursery", Some("clippy_nursery"), vec![
1095 attrs::EMPTY_LINE_AFTER_OUTER_ATTR,
1096 fallible_impl_from::FALLIBLE_IMPL_FROM,
1097 missing_const_for_fn::MISSING_CONST_FOR_FN,
1098 mutex_atomic::MUTEX_INTEGER,
1099 needless_borrow::NEEDLESS_BORROW,
1100 redundant_clone::REDUNDANT_CLONE,
1101 unwrap::PANICKING_UNWRAP,
1102 unwrap::UNNECESSARY_UNWRAP,
1106 /// Register renamed lints.
1108 /// Used in `./src/driver.rs`.
1109 pub fn register_renamed(ls: &mut rustc::lint::LintStore) {
1110 ls.register_renamed("clippy::stutter", "clippy::module_name_repetitions");
1111 ls.register_renamed("clippy::new_without_default_derive", "clippy::new_without_default");
1114 // only exists to let the dogfood integration test works.
1115 // Don't run clippy as an executable directly
1118 panic!("Please use the cargo-clippy executable");