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