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