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