2016-05-24 11:25:25 -05:00
|
|
|
|
// error-pattern:cargo-clippy
|
|
|
|
|
|
2020-06-09 09:36:01 -05:00
|
|
|
|
#![feature(bindings_after_at)]
|
2019-07-21 05:52:14 -05:00
|
|
|
|
#![feature(box_patterns)]
|
2020-06-23 10:05:22 -05:00
|
|
|
|
#![feature(box_syntax)]
|
|
|
|
|
#![feature(concat_idents)]
|
|
|
|
|
#![feature(crate_visibility_modifier)]
|
|
|
|
|
#![feature(drain_filter)]
|
2020-09-26 09:08:24 -05:00
|
|
|
|
#![feature(in_band_lifetimes)]
|
2020-10-09 05:45:29 -05:00
|
|
|
|
#![feature(once_cell)]
|
2020-03-16 01:23:03 -05:00
|
|
|
|
#![feature(or_patterns)]
|
2016-06-06 10:09:51 -05:00
|
|
|
|
#![feature(rustc_private)]
|
2016-05-24 11:25:25 -05:00
|
|
|
|
#![feature(stmt_expr_attributes)]
|
2020-10-21 07:27:32 -05:00
|
|
|
|
#![feature(control_flow_enum)]
|
2019-05-13 18:34:08 -05:00
|
|
|
|
#![recursion_limit = "512"]
|
2019-07-15 00:35:02 -05:00
|
|
|
|
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
|
2020-06-23 10:05:22 -05:00
|
|
|
|
#![allow(clippy::missing_docs_in_private_items, clippy::must_use_candidate)]
|
|
|
|
|
#![warn(trivial_casts, trivial_numeric_casts)]
|
|
|
|
|
// warn on lints, that are included in `rust-lang/rust`s bootstrap
|
|
|
|
|
#![warn(rust_2018_idioms, unused_lifetimes)]
|
|
|
|
|
// warn on rustc internal lints
|
|
|
|
|
#![deny(rustc::internal)]
|
2018-03-25 21:04:05 -05:00
|
|
|
|
|
2018-09-15 02:21:58 -05:00
|
|
|
|
// FIXME: switch to something more ergonomic here, once available.
|
2019-01-30 19:15:29 -06:00
|
|
|
|
// (Currently there is no way to opt into sysroot crates without `extern crate`.)
|
2020-02-29 21:23:33 -06:00
|
|
|
|
extern crate rustc_ast;
|
2020-02-01 15:56:27 -06:00
|
|
|
|
extern crate rustc_ast_pretty;
|
|
|
|
|
extern crate rustc_attr;
|
2018-09-15 02:21:58 -05:00
|
|
|
|
extern crate rustc_data_structures;
|
|
|
|
|
extern crate rustc_errors;
|
2020-01-06 10:39:50 -06:00
|
|
|
|
extern crate rustc_hir;
|
2020-03-27 09:34:29 -05:00
|
|
|
|
extern crate rustc_hir_pretty;
|
2019-10-01 18:02:18 -05:00
|
|
|
|
extern crate rustc_index;
|
2020-02-16 20:07:26 -06:00
|
|
|
|
extern crate rustc_infer;
|
2019-11-02 23:41:22 -05:00
|
|
|
|
extern crate rustc_lexer;
|
2020-01-12 00:08:41 -06:00
|
|
|
|
extern crate rustc_lint;
|
2020-03-30 04:02:14 -05:00
|
|
|
|
extern crate rustc_middle;
|
2019-01-09 13:11:37 -06:00
|
|
|
|
extern crate rustc_mir;
|
2019-11-10 22:22:50 -06:00
|
|
|
|
extern crate rustc_parse;
|
2020-06-02 14:46:42 -05:00
|
|
|
|
extern crate rustc_parse_format;
|
2019-12-03 17:16:03 -06:00
|
|
|
|
extern crate rustc_session;
|
2019-12-30 18:17:56 -06:00
|
|
|
|
extern crate rustc_span;
|
2018-09-15 02:21:58 -05:00
|
|
|
|
extern crate rustc_target;
|
2020-03-14 15:26:32 -05:00
|
|
|
|
extern crate rustc_trait_selection;
|
2018-09-15 02:21:58 -05:00
|
|
|
|
extern crate rustc_typeck;
|
2016-05-24 11:25:25 -05:00
|
|
|
|
|
2019-10-10 20:46:22 -05:00
|
|
|
|
use rustc_data_structures::fx::FxHashSet;
|
2020-01-12 00:08:41 -06:00
|
|
|
|
use rustc_lint::LintId;
|
2020-03-18 17:45:02 -05:00
|
|
|
|
use rustc_session::Session;
|
2019-12-23 14:06:52 -06:00
|
|
|
|
|
2019-02-11 00:35:28 -06:00
|
|
|
|
/// Macro used to declare a Clippy lint.
|
|
|
|
|
///
|
|
|
|
|
/// Every lint declaration consists of 4 parts:
|
|
|
|
|
///
|
2019-03-05 10:50:33 -06:00
|
|
|
|
/// 1. The documentation, which is used for the website
|
2019-02-11 00:35:28 -06:00
|
|
|
|
/// 2. The `LINT_NAME`. See [lint naming][lint_naming] on lint naming conventions.
|
|
|
|
|
/// 3. The `lint_level`, which is a mapping from *one* of our lint groups to `Allow`, `Warn` or
|
|
|
|
|
/// `Deny`. The lint level here has nothing to do with what lint groups the lint is a part of.
|
|
|
|
|
/// 4. The `description` that contains a short explanation on what's wrong with code where the
|
|
|
|
|
/// lint is triggered.
|
|
|
|
|
///
|
|
|
|
|
/// Currently the categories `style`, `correctness`, `complexity` and `perf` are enabled by default.
|
|
|
|
|
/// As said in the README.md of this repository, if the lint level mapping changes, please update
|
|
|
|
|
/// README.md.
|
|
|
|
|
///
|
|
|
|
|
/// # Example
|
|
|
|
|
///
|
|
|
|
|
/// ```
|
2020-06-23 10:05:22 -05:00
|
|
|
|
/// #![feature(rustc_private)]
|
|
|
|
|
/// extern crate rustc_session;
|
2019-12-03 17:16:03 -06:00
|
|
|
|
/// use rustc_session::declare_tool_lint;
|
2020-06-23 10:05:22 -05:00
|
|
|
|
/// use clippy_lints::declare_clippy_lint;
|
2019-02-11 00:35:28 -06:00
|
|
|
|
///
|
|
|
|
|
/// declare_clippy_lint! {
|
2019-03-05 10:50:33 -06:00
|
|
|
|
/// /// **What it does:** Checks for ... (describe what the lint matches).
|
|
|
|
|
/// ///
|
|
|
|
|
/// /// **Why is this bad?** Supply the reason for linting the code.
|
|
|
|
|
/// ///
|
|
|
|
|
/// /// **Known problems:** None. (Or describe where it could go wrong.)
|
|
|
|
|
/// ///
|
|
|
|
|
/// /// **Example:**
|
|
|
|
|
/// ///
|
|
|
|
|
/// /// ```rust
|
|
|
|
|
/// /// // Bad
|
|
|
|
|
/// /// Insert a short example of code that triggers the lint
|
|
|
|
|
/// ///
|
|
|
|
|
/// /// // Good
|
|
|
|
|
/// /// Insert a short example of improved code that doesn't trigger the lint
|
|
|
|
|
/// /// ```
|
2019-02-11 00:35:28 -06:00
|
|
|
|
/// pub LINT_NAME,
|
|
|
|
|
/// pedantic,
|
|
|
|
|
/// "description"
|
|
|
|
|
/// }
|
|
|
|
|
/// ```
|
|
|
|
|
/// [lint_naming]: https://rust-lang.github.io/rfcs/0344-conventions-galore.html#lints
|
2018-10-12 01:09:04 -05:00
|
|
|
|
#[macro_export]
|
2018-03-27 10:13:55 -05:00
|
|
|
|
macro_rules! declare_clippy_lint {
|
2019-03-05 10:50:33 -06:00
|
|
|
|
{ $(#[$attr:meta])* pub $name:tt, style, $description:tt } => {
|
|
|
|
|
declare_tool_lint! {
|
|
|
|
|
$(#[$attr])* pub clippy::$name, Warn, $description, report_in_external_macro: true
|
|
|
|
|
}
|
2018-03-27 10:13:55 -05:00
|
|
|
|
};
|
2019-03-05 10:50:33 -06:00
|
|
|
|
{ $(#[$attr:meta])* pub $name:tt, correctness, $description:tt } => {
|
|
|
|
|
declare_tool_lint! {
|
|
|
|
|
$(#[$attr])* pub clippy::$name, Deny, $description, report_in_external_macro: true
|
|
|
|
|
}
|
2018-03-27 10:13:55 -05:00
|
|
|
|
};
|
2019-03-05 10:50:33 -06:00
|
|
|
|
{ $(#[$attr:meta])* pub $name:tt, complexity, $description:tt } => {
|
|
|
|
|
declare_tool_lint! {
|
2019-08-02 01:13:54 -05:00
|
|
|
|
$(#[$attr])* pub clippy::$name, Warn, $description, report_in_external_macro: true
|
2019-03-05 10:50:33 -06:00
|
|
|
|
}
|
2018-03-27 10:13:55 -05:00
|
|
|
|
};
|
2019-03-05 10:50:33 -06:00
|
|
|
|
{ $(#[$attr:meta])* pub $name:tt, perf, $description:tt } => {
|
|
|
|
|
declare_tool_lint! {
|
2019-08-03 01:01:27 -05:00
|
|
|
|
$(#[$attr])* pub clippy::$name, Warn, $description, report_in_external_macro: true
|
2019-03-05 10:50:33 -06:00
|
|
|
|
}
|
2018-03-27 10:13:55 -05:00
|
|
|
|
};
|
2019-03-05 10:50:33 -06:00
|
|
|
|
{ $(#[$attr:meta])* pub $name:tt, pedantic, $description:tt } => {
|
|
|
|
|
declare_tool_lint! {
|
2019-08-03 11:42:05 -05:00
|
|
|
|
$(#[$attr])* pub clippy::$name, Allow, $description, report_in_external_macro: true
|
2019-03-05 10:50:33 -06:00
|
|
|
|
}
|
2018-03-28 08:24:26 -05:00
|
|
|
|
};
|
2019-03-05 10:50:33 -06:00
|
|
|
|
{ $(#[$attr:meta])* pub $name:tt, restriction, $description:tt } => {
|
|
|
|
|
declare_tool_lint! {
|
2019-08-03 14:24:50 -05:00
|
|
|
|
$(#[$attr])* pub clippy::$name, Allow, $description, report_in_external_macro: true
|
2019-03-05 10:50:33 -06:00
|
|
|
|
}
|
2018-03-28 08:24:26 -05:00
|
|
|
|
};
|
2019-03-05 10:50:33 -06:00
|
|
|
|
{ $(#[$attr:meta])* pub $name:tt, cargo, $description:tt } => {
|
|
|
|
|
declare_tool_lint! {
|
2019-08-03 01:01:27 -05:00
|
|
|
|
$(#[$attr])* pub clippy::$name, Allow, $description, report_in_external_macro: true
|
2019-03-05 10:50:33 -06:00
|
|
|
|
}
|
2018-04-29 18:20:39 -05:00
|
|
|
|
};
|
2019-03-05 10:50:33 -06:00
|
|
|
|
{ $(#[$attr:meta])* pub $name:tt, nursery, $description:tt } => {
|
|
|
|
|
declare_tool_lint! {
|
2019-08-03 14:01:23 -05:00
|
|
|
|
$(#[$attr])* pub clippy::$name, Allow, $description, report_in_external_macro: true
|
2019-03-05 10:50:33 -06:00
|
|
|
|
}
|
2018-03-28 08:24:26 -05:00
|
|
|
|
};
|
2019-03-05 10:50:33 -06:00
|
|
|
|
{ $(#[$attr:meta])* pub $name:tt, internal, $description:tt } => {
|
|
|
|
|
declare_tool_lint! {
|
2019-08-03 01:12:53 -05:00
|
|
|
|
$(#[$attr])* pub clippy::$name, Allow, $description, report_in_external_macro: true
|
2019-03-05 10:50:33 -06:00
|
|
|
|
}
|
2018-03-28 08:24:26 -05:00
|
|
|
|
};
|
2019-03-05 10:50:33 -06:00
|
|
|
|
{ $(#[$attr:meta])* pub $name:tt, internal_warn, $description:tt } => {
|
|
|
|
|
declare_tool_lint! {
|
2019-08-03 01:12:53 -05:00
|
|
|
|
$(#[$attr])* pub clippy::$name, Warn, $description, report_in_external_macro: true
|
2019-03-05 10:50:33 -06:00
|
|
|
|
}
|
2018-03-29 06:41:53 -05:00
|
|
|
|
};
|
2018-03-27 10:13:55 -05:00
|
|
|
|
}
|
|
|
|
|
|
2018-08-28 21:32:20 -05:00
|
|
|
|
mod consts;
|
2016-05-24 11:25:25 -05:00
|
|
|
|
#[macro_use]
|
2018-08-28 21:32:20 -05:00
|
|
|
|
mod utils;
|
2016-05-24 11:25:25 -05:00
|
|
|
|
|
|
|
|
|
// begin lints modules, do not remove this comment, it’s used in `update_lints`
|
2020-04-02 15:08:25 -05:00
|
|
|
|
mod approx_const;
|
|
|
|
|
mod arithmetic;
|
|
|
|
|
mod as_conversions;
|
2020-10-09 05:45:29 -05:00
|
|
|
|
mod asm_syntax;
|
2020-04-02 15:08:25 -05:00
|
|
|
|
mod assertions_on_constants;
|
|
|
|
|
mod assign_ops;
|
2020-09-10 10:47:07 -05:00
|
|
|
|
mod async_yields_async;
|
2020-04-02 15:08:25 -05:00
|
|
|
|
mod atomic_ordering;
|
|
|
|
|
mod attrs;
|
2020-10-28 17:36:07 -05:00
|
|
|
|
mod await_holding_invalid;
|
2020-04-02 15:08:25 -05:00
|
|
|
|
mod bit_mask;
|
|
|
|
|
mod blacklisted_name;
|
2020-05-17 10:36:26 -05:00
|
|
|
|
mod blocks_in_if_conditions;
|
2020-04-02 15:08:25 -05:00
|
|
|
|
mod booleans;
|
|
|
|
|
mod bytecount;
|
|
|
|
|
mod cargo_common_metadata;
|
|
|
|
|
mod checked_conversions;
|
|
|
|
|
mod cognitive_complexity;
|
|
|
|
|
mod collapsible_if;
|
|
|
|
|
mod comparison_chain;
|
|
|
|
|
mod copies;
|
|
|
|
|
mod copy_iterator;
|
2020-09-10 10:47:07 -05:00
|
|
|
|
mod create_dir;
|
2020-04-02 15:08:25 -05:00
|
|
|
|
mod dbg_macro;
|
2020-11-05 07:29:48 -06:00
|
|
|
|
mod default;
|
2020-03-21 13:34:56 -05:00
|
|
|
|
mod dereference;
|
2020-04-02 15:08:25 -05:00
|
|
|
|
mod derive;
|
2020-10-09 05:45:29 -05:00
|
|
|
|
mod disallowed_method;
|
2020-04-02 15:08:25 -05:00
|
|
|
|
mod doc;
|
|
|
|
|
mod double_comparison;
|
|
|
|
|
mod double_parens;
|
|
|
|
|
mod drop_forget_ref;
|
|
|
|
|
mod duration_subsec;
|
|
|
|
|
mod else_if_without_else;
|
|
|
|
|
mod empty_enum;
|
|
|
|
|
mod entry;
|
|
|
|
|
mod enum_clike;
|
|
|
|
|
mod enum_variants;
|
|
|
|
|
mod eq_op;
|
|
|
|
|
mod erasing_op;
|
|
|
|
|
mod escape;
|
|
|
|
|
mod eta_reduction;
|
|
|
|
|
mod eval_order_dependence;
|
|
|
|
|
mod excessive_bools;
|
|
|
|
|
mod exit;
|
|
|
|
|
mod explicit_write;
|
|
|
|
|
mod fallible_impl_from;
|
2020-08-28 09:10:16 -05:00
|
|
|
|
mod float_equality_without_abs;
|
2020-04-02 15:08:25 -05:00
|
|
|
|
mod float_literal;
|
|
|
|
|
mod floating_point_arithmetic;
|
|
|
|
|
mod format;
|
|
|
|
|
mod formatting;
|
|
|
|
|
mod functions;
|
2020-04-07 08:39:07 -05:00
|
|
|
|
mod future_not_send;
|
2020-04-02 15:08:25 -05:00
|
|
|
|
mod get_last_with_len;
|
|
|
|
|
mod identity_op;
|
2020-03-05 07:36:19 -06:00
|
|
|
|
mod if_let_mutex;
|
2020-04-02 15:08:25 -05:00
|
|
|
|
mod if_let_some_result;
|
|
|
|
|
mod if_not_else;
|
|
|
|
|
mod implicit_return;
|
2020-04-06 13:07:57 -05:00
|
|
|
|
mod implicit_saturating_sub;
|
2020-04-02 15:08:25 -05:00
|
|
|
|
mod indexing_slicing;
|
|
|
|
|
mod infinite_iter;
|
|
|
|
|
mod inherent_impl;
|
|
|
|
|
mod inherent_to_string;
|
|
|
|
|
mod inline_fn_without_body;
|
|
|
|
|
mod int_plus_one;
|
|
|
|
|
mod integer_division;
|
|
|
|
|
mod items_after_statements;
|
2020-03-23 16:07:46 -05:00
|
|
|
|
mod large_const_arrays;
|
2020-04-02 15:08:25 -05:00
|
|
|
|
mod large_enum_variant;
|
|
|
|
|
mod large_stack_arrays;
|
|
|
|
|
mod len_zero;
|
|
|
|
|
mod let_if_seq;
|
|
|
|
|
mod let_underscore;
|
|
|
|
|
mod lifetimes;
|
|
|
|
|
mod literal_representation;
|
|
|
|
|
mod loops;
|
|
|
|
|
mod macro_use;
|
|
|
|
|
mod main_recursion;
|
2020-05-11 13:23:47 -05:00
|
|
|
|
mod manual_async_fn;
|
|
|
|
|
mod manual_non_exhaustive;
|
2020-11-05 07:29:48 -06:00
|
|
|
|
mod manual_ok_or;
|
2020-09-24 07:49:22 -05:00
|
|
|
|
mod manual_strip;
|
2020-10-23 15:16:59 -05:00
|
|
|
|
mod manual_unwrap_or;
|
2020-04-02 15:08:25 -05:00
|
|
|
|
mod map_clone;
|
2020-09-24 07:49:22 -05:00
|
|
|
|
mod map_err_ignore;
|
2020-07-14 07:59:59 -05:00
|
|
|
|
mod map_identity;
|
2020-04-02 15:08:25 -05:00
|
|
|
|
mod map_unit_fn;
|
2020-04-25 03:33:40 -05:00
|
|
|
|
mod match_on_vec_items;
|
2020-04-02 15:08:25 -05:00
|
|
|
|
mod matches;
|
|
|
|
|
mod mem_discriminant;
|
|
|
|
|
mod mem_forget;
|
|
|
|
|
mod mem_replace;
|
|
|
|
|
mod methods;
|
|
|
|
|
mod minmax;
|
|
|
|
|
mod misc;
|
|
|
|
|
mod misc_early;
|
|
|
|
|
mod missing_const_for_fn;
|
|
|
|
|
mod missing_doc;
|
|
|
|
|
mod missing_inline;
|
|
|
|
|
mod modulo_arithmetic;
|
|
|
|
|
mod multiple_crate_versions;
|
|
|
|
|
mod mut_key;
|
|
|
|
|
mod mut_mut;
|
2020-10-28 17:36:07 -05:00
|
|
|
|
mod mut_mutex_lock;
|
2020-04-02 15:08:25 -05:00
|
|
|
|
mod mut_reference;
|
|
|
|
|
mod mutable_debug_assertion;
|
|
|
|
|
mod mutex_atomic;
|
2020-08-11 08:43:21 -05:00
|
|
|
|
mod needless_arbitrary_self_type;
|
2020-04-02 15:08:25 -05:00
|
|
|
|
mod needless_bool;
|
|
|
|
|
mod needless_borrow;
|
|
|
|
|
mod needless_borrowed_ref;
|
|
|
|
|
mod needless_continue;
|
|
|
|
|
mod needless_pass_by_value;
|
|
|
|
|
mod needless_update;
|
|
|
|
|
mod neg_cmp_op_on_partial_ord;
|
|
|
|
|
mod neg_multiply;
|
|
|
|
|
mod new_without_default;
|
|
|
|
|
mod no_effect;
|
|
|
|
|
mod non_copy_const;
|
|
|
|
|
mod non_expressive_names;
|
|
|
|
|
mod open_options;
|
|
|
|
|
mod option_env_unwrap;
|
2020-07-14 07:59:59 -05:00
|
|
|
|
mod option_if_let_else;
|
2020-04-02 15:08:25 -05:00
|
|
|
|
mod overflow_check_conditional;
|
2020-09-24 07:49:22 -05:00
|
|
|
|
mod panic_in_result_fn;
|
2020-04-02 15:08:25 -05:00
|
|
|
|
mod panic_unimplemented;
|
|
|
|
|
mod partialeq_ne_impl;
|
2020-10-28 17:36:07 -05:00
|
|
|
|
mod pass_by_ref_or_value;
|
2020-04-02 15:08:25 -05:00
|
|
|
|
mod path_buf_push_overwrite;
|
2020-07-14 07:59:59 -05:00
|
|
|
|
mod pattern_type_mismatch;
|
2020-04-02 15:08:25 -05:00
|
|
|
|
mod precedence;
|
|
|
|
|
mod ptr;
|
2020-10-23 15:16:59 -05:00
|
|
|
|
mod ptr_eq;
|
2020-04-02 15:08:25 -05:00
|
|
|
|
mod ptr_offset_with_cast;
|
|
|
|
|
mod question_mark;
|
|
|
|
|
mod ranges;
|
|
|
|
|
mod redundant_clone;
|
2020-07-26 14:07:07 -05:00
|
|
|
|
mod redundant_closure_call;
|
2020-04-02 15:08:25 -05:00
|
|
|
|
mod redundant_field_names;
|
|
|
|
|
mod redundant_pub_crate;
|
|
|
|
|
mod redundant_static_lifetimes;
|
2020-11-05 07:29:48 -06:00
|
|
|
|
mod ref_option_ref;
|
2020-04-02 15:08:25 -05:00
|
|
|
|
mod reference;
|
|
|
|
|
mod regex;
|
2020-07-14 07:59:59 -05:00
|
|
|
|
mod repeat_once;
|
2020-04-02 15:08:25 -05:00
|
|
|
|
mod returns;
|
2020-08-28 09:10:16 -05:00
|
|
|
|
mod self_assignment;
|
2020-04-02 15:08:25 -05:00
|
|
|
|
mod serde_api;
|
|
|
|
|
mod shadow;
|
|
|
|
|
mod single_component_path_imports;
|
|
|
|
|
mod slow_vector_initialization;
|
2020-08-11 08:43:21 -05:00
|
|
|
|
mod stable_sort_primitive;
|
2020-04-02 15:08:25 -05:00
|
|
|
|
mod strings;
|
|
|
|
|
mod suspicious_trait_impl;
|
|
|
|
|
mod swap;
|
|
|
|
|
mod tabs_in_doc_comments;
|
|
|
|
|
mod temporary_assignment;
|
|
|
|
|
mod to_digit_is_some;
|
2020-08-28 09:10:16 -05:00
|
|
|
|
mod to_string_in_display;
|
2020-04-02 15:08:25 -05:00
|
|
|
|
mod trait_bounds;
|
|
|
|
|
mod transmute;
|
|
|
|
|
mod transmuting_null;
|
|
|
|
|
mod try_err;
|
|
|
|
|
mod types;
|
2020-10-28 17:36:07 -05:00
|
|
|
|
mod undropped_manually_drops;
|
2020-04-02 15:08:25 -05:00
|
|
|
|
mod unicode;
|
2020-07-26 14:07:07 -05:00
|
|
|
|
mod unit_return_expecting_ord;
|
2020-04-02 15:08:25 -05:00
|
|
|
|
mod unnamed_address;
|
2020-06-09 09:36:01 -05:00
|
|
|
|
mod unnecessary_sort_by;
|
|
|
|
|
mod unnested_or_patterns;
|
2020-04-02 15:08:25 -05:00
|
|
|
|
mod unsafe_removed_from_name;
|
|
|
|
|
mod unused_io_amount;
|
|
|
|
|
mod unused_self;
|
2020-08-28 09:10:16 -05:00
|
|
|
|
mod unused_unit;
|
2020-04-02 15:08:25 -05:00
|
|
|
|
mod unwrap;
|
2020-08-28 09:10:16 -05:00
|
|
|
|
mod unwrap_in_result;
|
2020-04-02 15:08:25 -05:00
|
|
|
|
mod use_self;
|
2020-05-17 10:36:26 -05:00
|
|
|
|
mod useless_conversion;
|
2020-04-02 15:08:25 -05:00
|
|
|
|
mod vec;
|
2020-06-09 09:36:01 -05:00
|
|
|
|
mod vec_resize_to_zero;
|
2020-04-02 15:08:25 -05:00
|
|
|
|
mod verbose_file_reads;
|
|
|
|
|
mod wildcard_dependencies;
|
|
|
|
|
mod wildcard_imports;
|
|
|
|
|
mod write;
|
|
|
|
|
mod zero_div_zero;
|
2016-05-24 11:25:25 -05:00
|
|
|
|
// end lints modules, do not remove this comment, it’s used in `update_lints`
|
|
|
|
|
|
2018-09-02 20:57:50 -05:00
|
|
|
|
pub use crate::utils::conf::Conf;
|
2018-08-15 01:11:07 -05:00
|
|
|
|
|
2019-02-11 00:59:57 -06:00
|
|
|
|
/// Register all pre expansion lints
|
|
|
|
|
///
|
|
|
|
|
/// Pre-expansion lints run before any macro expansion has happened.
|
|
|
|
|
///
|
2019-04-04 04:15:30 -05:00
|
|
|
|
/// Note that due to the architecture of the compiler, currently `cfg_attr` attributes on crate
|
2019-02-11 15:32:54 -06:00
|
|
|
|
/// level (i.e `#![cfg_attr(...)]`) will still be expanded even when using a pre-expansion pass.
|
2019-02-11 00:59:57 -06:00
|
|
|
|
///
|
|
|
|
|
/// Used in `./src/driver.rs`.
|
2020-05-28 08:45:24 -05:00
|
|
|
|
pub fn register_pre_expansion_lints(store: &mut rustc_lint::LintStore) {
|
2020-01-14 09:28:08 -06:00
|
|
|
|
store.register_pre_expansion_pass(|| box write::Write::default());
|
2020-04-22 16:01:25 -05:00
|
|
|
|
store.register_pre_expansion_pass(|| box attrs::EarlyAttributes);
|
2019-10-10 20:46:22 -05:00
|
|
|
|
store.register_pre_expansion_pass(|| box dbg_macro::DbgMacro);
|
2018-08-16 00:13:52 -05:00
|
|
|
|
}
|
|
|
|
|
|
2019-02-11 00:59:57 -06:00
|
|
|
|
#[doc(hidden)]
|
2020-04-27 12:56:11 -05:00
|
|
|
|
pub fn read_conf(args: &[rustc_ast::NestedMetaItem], sess: &Session) -> Conf {
|
2020-02-04 20:06:34 -06:00
|
|
|
|
use std::path::Path;
|
2019-10-10 20:46:22 -05:00
|
|
|
|
match utils::conf::file_from_args(args) {
|
2016-05-24 11:25:25 -05:00
|
|
|
|
Ok(file_name) => {
|
|
|
|
|
// if the user specified a file, it must exist, otherwise default to `clippy.toml` but
|
|
|
|
|
// do not require the file to exist
|
2020-02-04 20:06:34 -06:00
|
|
|
|
let file_name = match file_name {
|
|
|
|
|
Some(file_name) => file_name,
|
|
|
|
|
None => match utils::conf::lookup_conf_file() {
|
|
|
|
|
Ok(Some(path)) => path,
|
|
|
|
|
Ok(None) => return Conf::default(),
|
2016-10-25 12:41:24 -05:00
|
|
|
|
Err(error) => {
|
2019-10-10 20:46:22 -05:00
|
|
|
|
sess.struct_err(&format!("error finding Clippy's configuration file: {}", error))
|
2018-11-27 14:14:15 -06:00
|
|
|
|
.emit();
|
2020-02-04 20:06:34 -06:00
|
|
|
|
return Conf::default();
|
2019-10-24 04:55:22 -05:00
|
|
|
|
},
|
2020-02-04 20:06:34 -06:00
|
|
|
|
},
|
2016-05-24 11:25:25 -05:00
|
|
|
|
};
|
|
|
|
|
|
2020-02-04 20:06:34 -06:00
|
|
|
|
let file_name = if file_name.is_relative() {
|
|
|
|
|
sess.local_crate_source_file
|
|
|
|
|
.as_deref()
|
|
|
|
|
.and_then(Path::parent)
|
|
|
|
|
.unwrap_or_else(|| Path::new(""))
|
|
|
|
|
.join(file_name)
|
|
|
|
|
} else {
|
|
|
|
|
file_name
|
|
|
|
|
};
|
2017-11-14 07:56:00 -06:00
|
|
|
|
|
2020-02-04 20:06:34 -06:00
|
|
|
|
let (conf, errors) = utils::conf::read(&file_name);
|
2016-05-24 11:25:25 -05:00
|
|
|
|
|
|
|
|
|
// all conf errors are non-fatal, we just use the default conf in case of error
|
|
|
|
|
for error in errors {
|
2019-10-10 20:46:22 -05:00
|
|
|
|
sess.struct_err(&format!(
|
|
|
|
|
"error reading Clippy's configuration file `{}`: {}",
|
2020-02-04 20:06:34 -06:00
|
|
|
|
file_name.display(),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
error
|
|
|
|
|
))
|
|
|
|
|
.emit();
|
2016-05-24 11:25:25 -05:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
conf
|
2020-01-23 09:28:01 -06:00
|
|
|
|
},
|
2016-05-24 11:25:25 -05:00
|
|
|
|
Err((err, span)) => {
|
2019-10-10 20:46:22 -05:00
|
|
|
|
sess.struct_span_err(span, err)
|
2018-11-27 14:14:15 -06:00
|
|
|
|
.span_note(span, "Clippy will use default configuration")
|
|
|
|
|
.emit();
|
2020-02-04 20:06:34 -06:00
|
|
|
|
Conf::default()
|
2019-10-24 04:55:22 -05:00
|
|
|
|
},
|
2018-08-15 01:11:07 -05:00
|
|
|
|
}
|
|
|
|
|
}
|
2016-05-24 11:25:25 -05:00
|
|
|
|
|
2019-02-11 00:59:57 -06:00
|
|
|
|
/// Register all lints and lint groups with the rustc plugin registry
|
|
|
|
|
///
|
|
|
|
|
/// Used in `./src/driver.rs`.
|
2019-01-13 09:19:02 -06:00
|
|
|
|
#[allow(clippy::too_many_lines)]
|
2018-08-15 01:11:07 -05:00
|
|
|
|
#[rustfmt::skip]
|
2020-01-12 00:08:41 -06:00
|
|
|
|
pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf: &Conf) {
|
2019-10-10 20:46:22 -05:00
|
|
|
|
register_removed_non_tool_lints(store);
|
2019-08-12 00:28:07 -05:00
|
|
|
|
|
2018-10-31 02:03:50 -05:00
|
|
|
|
// begin deprecated lints, do not remove this comment, it’s used in `update_lints`
|
2017-10-19 23:42:04 -05:00
|
|
|
|
store.register_removed(
|
2019-08-09 00:50:25 -05:00
|
|
|
|
"clippy::should_assert_eq",
|
2017-10-29 04:30:33 -05:00
|
|
|
|
"`assert!()` will be more flexible with RFC 2011",
|
2017-10-19 23:42:04 -05:00
|
|
|
|
);
|
2017-01-14 07:39:41 -06:00
|
|
|
|
store.register_removed(
|
2019-08-09 00:50:25 -05:00
|
|
|
|
"clippy::extend_from_slice",
|
2017-01-14 07:39:41 -06:00
|
|
|
|
"`.extend_from_slice(_)` is a faster way to extend a Vec by a slice",
|
|
|
|
|
);
|
2017-06-18 08:14:46 -05:00
|
|
|
|
store.register_removed(
|
2019-08-09 00:50:25 -05:00
|
|
|
|
"clippy::range_step_by_zero",
|
2017-06-18 08:14:46 -05:00
|
|
|
|
"`iterator.step_by(0)` panics nowadays",
|
|
|
|
|
);
|
2016-12-21 05:50:39 -06:00
|
|
|
|
store.register_removed(
|
2019-08-09 00:50:25 -05:00
|
|
|
|
"clippy::unstable_as_slice",
|
2016-12-21 05:50:39 -06:00
|
|
|
|
"`Vec::as_slice` has been stabilized in 1.7",
|
|
|
|
|
);
|
|
|
|
|
store.register_removed(
|
2019-08-09 00:50:25 -05:00
|
|
|
|
"clippy::unstable_as_mut_slice",
|
2016-12-21 05:50:39 -06:00
|
|
|
|
"`Vec::as_mut_slice` has been stabilized in 1.7",
|
|
|
|
|
);
|
|
|
|
|
store.register_removed(
|
2019-08-09 00:50:25 -05:00
|
|
|
|
"clippy::str_to_string",
|
2016-12-21 05:50:39 -06:00
|
|
|
|
"using `str::to_string` is common even today and specialization will likely happen soon",
|
|
|
|
|
);
|
|
|
|
|
store.register_removed(
|
2019-08-09 00:50:25 -05:00
|
|
|
|
"clippy::string_to_string",
|
2016-12-21 05:50:39 -06:00
|
|
|
|
"using `string::to_string` is common even today and specialization will likely happen soon",
|
|
|
|
|
);
|
2018-04-11 04:50:04 -05:00
|
|
|
|
store.register_removed(
|
2019-08-09 00:50:25 -05:00
|
|
|
|
"clippy::misaligned_transmute",
|
2018-04-11 04:50:04 -05:00
|
|
|
|
"this lint has been split into cast_ptr_alignment and transmute_ptr_to_ptr",
|
|
|
|
|
);
|
2018-08-09 14:14:12 -05:00
|
|
|
|
store.register_removed(
|
2019-08-09 00:50:25 -05:00
|
|
|
|
"clippy::assign_ops",
|
2019-01-30 19:15:29 -06:00
|
|
|
|
"using compound assignment operators (e.g., `+=`) is harmless",
|
2018-08-09 14:14:12 -05:00
|
|
|
|
);
|
2018-10-10 10:13:53 -05:00
|
|
|
|
store.register_removed(
|
2019-08-09 00:50:25 -05:00
|
|
|
|
"clippy::if_let_redundant_pattern_matching",
|
2018-10-10 10:13:53 -05:00
|
|
|
|
"this lint has been changed to redundant_pattern_matching",
|
|
|
|
|
);
|
2018-12-03 04:43:01 -06:00
|
|
|
|
store.register_removed(
|
2019-08-09 00:50:25 -05:00
|
|
|
|
"clippy::unsafe_vector_initialization",
|
2018-12-03 04:43:01 -06:00
|
|
|
|
"the replacement suggested by this lint had substantially different behavior",
|
|
|
|
|
);
|
2019-08-12 00:27:01 -05:00
|
|
|
|
store.register_removed(
|
|
|
|
|
"clippy::invalid_ref",
|
|
|
|
|
"superseded by rustc lint `invalid_value`",
|
|
|
|
|
);
|
2019-08-07 00:37:13 -05:00
|
|
|
|
store.register_removed(
|
|
|
|
|
"clippy::unused_collect",
|
|
|
|
|
"`collect` has been marked as #[must_use] in rustc and that covers all cases of this lint",
|
|
|
|
|
);
|
2019-11-07 06:44:57 -06:00
|
|
|
|
store.register_removed(
|
|
|
|
|
"clippy::into_iter_on_array",
|
|
|
|
|
"this lint has been uplifted to rustc and is now called `array_into_iter`",
|
|
|
|
|
);
|
2019-12-21 09:20:30 -06:00
|
|
|
|
store.register_removed(
|
|
|
|
|
"clippy::unused_label",
|
|
|
|
|
"this lint has been uplifted to rustc and is now called `unused_labels`",
|
|
|
|
|
);
|
2020-03-29 00:59:35 -05:00
|
|
|
|
store.register_removed(
|
|
|
|
|
"clippy::replace_consts",
|
2020-07-26 14:07:07 -05:00
|
|
|
|
"associated-constants `MIN`/`MAX` of integers are preferred to `{min,max}_value()` and module constants",
|
2020-07-14 07:59:59 -05:00
|
|
|
|
);
|
|
|
|
|
store.register_removed(
|
|
|
|
|
"clippy::regex_macro",
|
|
|
|
|
"the regex! macro has been removed from the regex crate in 2018",
|
2020-03-29 00:59:35 -05:00
|
|
|
|
);
|
2020-10-02 13:34:14 -05:00
|
|
|
|
store.register_removed(
|
|
|
|
|
"clippy::drop_bounds",
|
|
|
|
|
"this lint has been uplifted to rustc and is now called `drop_bounds`",
|
|
|
|
|
);
|
2020-10-28 17:36:07 -05:00
|
|
|
|
store.register_removed(
|
|
|
|
|
"clippy::temporary_cstring_as_ptr",
|
|
|
|
|
"this lint has been uplifted to rustc and is now called `temporary_cstring_as_ptr`",
|
|
|
|
|
);
|
2016-05-24 11:25:25 -05:00
|
|
|
|
// end deprecated lints, do not remove this comment, it’s used in `update_lints`
|
|
|
|
|
|
2019-10-10 20:46:22 -05:00
|
|
|
|
// begin register lints, do not remove this comment, it’s used in `update_lints`
|
|
|
|
|
store.register_lints(&[
|
|
|
|
|
&approx_const::APPROX_CONSTANT,
|
|
|
|
|
&arithmetic::FLOAT_ARITHMETIC,
|
|
|
|
|
&arithmetic::INTEGER_ARITHMETIC,
|
2019-11-15 13:27:07 -06:00
|
|
|
|
&as_conversions::AS_CONVERSIONS,
|
2020-10-09 05:45:29 -05:00
|
|
|
|
&asm_syntax::INLINE_ASM_X86_ATT_SYNTAX,
|
|
|
|
|
&asm_syntax::INLINE_ASM_X86_INTEL_SYNTAX,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&assertions_on_constants::ASSERTIONS_ON_CONSTANTS,
|
|
|
|
|
&assign_ops::ASSIGN_OP_PATTERN,
|
|
|
|
|
&assign_ops::MISREFACTORED_ASSIGN_OP,
|
2020-09-10 10:47:07 -05:00
|
|
|
|
&async_yields_async::ASYNC_YIELDS_ASYNC,
|
2020-01-05 18:16:27 -06:00
|
|
|
|
&atomic_ordering::INVALID_ATOMIC_ORDERING,
|
2020-07-14 07:59:59 -05:00
|
|
|
|
&attrs::BLANKET_CLIPPY_RESTRICTION_LINTS,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&attrs::DEPRECATED_CFG_ATTR,
|
|
|
|
|
&attrs::DEPRECATED_SEMVER,
|
|
|
|
|
&attrs::EMPTY_LINE_AFTER_OUTER_ATTR,
|
|
|
|
|
&attrs::INLINE_ALWAYS,
|
2020-04-22 16:01:25 -05:00
|
|
|
|
&attrs::MISMATCHED_TARGET_OS,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&attrs::UNKNOWN_CLIPPY_LINTS,
|
|
|
|
|
&attrs::USELESS_ATTRIBUTE,
|
2020-10-28 17:36:07 -05:00
|
|
|
|
&await_holding_invalid::AWAIT_HOLDING_LOCK,
|
|
|
|
|
&await_holding_invalid::AWAIT_HOLDING_REFCELL_REF,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&bit_mask::BAD_BIT_MASK,
|
|
|
|
|
&bit_mask::INEFFECTIVE_BIT_MASK,
|
|
|
|
|
&bit_mask::VERBOSE_BIT_MASK,
|
|
|
|
|
&blacklisted_name::BLACKLISTED_NAME,
|
2020-05-17 10:36:26 -05:00
|
|
|
|
&blocks_in_if_conditions::BLOCKS_IN_IF_CONDITIONS,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&booleans::LOGIC_BUG,
|
|
|
|
|
&booleans::NONMINIMAL_BOOL,
|
|
|
|
|
&bytecount::NAIVE_BYTECOUNT,
|
|
|
|
|
&cargo_common_metadata::CARGO_COMMON_METADATA,
|
|
|
|
|
&checked_conversions::CHECKED_CONVERSIONS,
|
|
|
|
|
&cognitive_complexity::COGNITIVE_COMPLEXITY,
|
|
|
|
|
&collapsible_if::COLLAPSIBLE_IF,
|
|
|
|
|
&comparison_chain::COMPARISON_CHAIN,
|
|
|
|
|
&copies::IFS_SAME_COND,
|
|
|
|
|
&copies::IF_SAME_THEN_ELSE,
|
2019-11-23 10:57:28 -06:00
|
|
|
|
&copies::SAME_FUNCTIONS_IN_IF_CONDITION,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
©_iterator::COPY_ITERATOR,
|
2020-09-10 10:47:07 -05:00
|
|
|
|
&create_dir::CREATE_DIR,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&dbg_macro::DBG_MACRO,
|
2020-11-05 07:29:48 -06:00
|
|
|
|
&default::DEFAULT_TRAIT_ACCESS,
|
|
|
|
|
&default::FIELD_REASSIGN_WITH_DEFAULT,
|
2020-03-07 08:33:27 -06:00
|
|
|
|
&dereference::EXPLICIT_DEREF_METHODS,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&derive::DERIVE_HASH_XOR_EQ,
|
2020-08-11 08:43:21 -05:00
|
|
|
|
&derive::DERIVE_ORD_XOR_PARTIAL_ORD,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&derive::EXPL_IMPL_CLONE_ON_COPY,
|
2020-04-19 16:11:30 -05:00
|
|
|
|
&derive::UNSAFE_DERIVE_DESERIALIZE,
|
2020-10-09 05:45:29 -05:00
|
|
|
|
&disallowed_method::DISALLOWED_METHOD,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&doc::DOC_MARKDOWN,
|
2019-12-05 18:00:23 -06:00
|
|
|
|
&doc::MISSING_ERRORS_DOC,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&doc::MISSING_SAFETY_DOC,
|
|
|
|
|
&doc::NEEDLESS_DOCTEST_MAIN,
|
|
|
|
|
&double_comparison::DOUBLE_COMPARISONS,
|
|
|
|
|
&double_parens::DOUBLE_PARENS,
|
|
|
|
|
&drop_forget_ref::DROP_COPY,
|
|
|
|
|
&drop_forget_ref::DROP_REF,
|
|
|
|
|
&drop_forget_ref::FORGET_COPY,
|
|
|
|
|
&drop_forget_ref::FORGET_REF,
|
|
|
|
|
&duration_subsec::DURATION_SUBSEC,
|
|
|
|
|
&else_if_without_else::ELSE_IF_WITHOUT_ELSE,
|
|
|
|
|
&empty_enum::EMPTY_ENUM,
|
|
|
|
|
&entry::MAP_ENTRY,
|
|
|
|
|
&enum_clike::ENUM_CLIKE_UNPORTABLE_VARIANT,
|
|
|
|
|
&enum_variants::ENUM_VARIANT_NAMES,
|
|
|
|
|
&enum_variants::MODULE_INCEPTION,
|
|
|
|
|
&enum_variants::MODULE_NAME_REPETITIONS,
|
|
|
|
|
&enum_variants::PUB_ENUM_VARIANT_NAMES,
|
|
|
|
|
&eq_op::EQ_OP,
|
|
|
|
|
&eq_op::OP_REF,
|
|
|
|
|
&erasing_op::ERASING_OP,
|
|
|
|
|
&escape::BOXED_LOCAL,
|
|
|
|
|
&eta_reduction::REDUNDANT_CLOSURE,
|
|
|
|
|
&eta_reduction::REDUNDANT_CLOSURE_FOR_METHOD_CALLS,
|
|
|
|
|
&eval_order_dependence::DIVERGING_SUB_EXPRESSION,
|
|
|
|
|
&eval_order_dependence::EVAL_ORDER_DEPENDENCE,
|
2020-02-01 17:49:52 -06:00
|
|
|
|
&excessive_bools::FN_PARAMS_EXCESSIVE_BOOLS,
|
|
|
|
|
&excessive_bools::STRUCT_EXCESSIVE_BOOLS,
|
2019-10-24 14:17:21 -05:00
|
|
|
|
&exit::EXIT,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&explicit_write::EXPLICIT_WRITE,
|
|
|
|
|
&fallible_impl_from::FALLIBLE_IMPL_FROM,
|
2020-08-28 09:10:16 -05:00
|
|
|
|
&float_equality_without_abs::FLOAT_EQUALITY_WITHOUT_ABS,
|
2020-02-20 20:32:06 -06:00
|
|
|
|
&float_literal::EXCESSIVE_PRECISION,
|
|
|
|
|
&float_literal::LOSSY_FLOAT_LITERAL,
|
2020-02-23 23:06:55 -06:00
|
|
|
|
&floating_point_arithmetic::IMPRECISE_FLOPS,
|
2020-02-17 14:56:55 -06:00
|
|
|
|
&floating_point_arithmetic::SUBOPTIMAL_FLOPS,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&format::USELESS_FORMAT,
|
|
|
|
|
&formatting::POSSIBLE_MISSING_COMMA,
|
|
|
|
|
&formatting::SUSPICIOUS_ASSIGNMENT_FORMATTING,
|
|
|
|
|
&formatting::SUSPICIOUS_ELSE_FORMATTING,
|
|
|
|
|
&formatting::SUSPICIOUS_UNARY_OP_FORMATTING,
|
|
|
|
|
&functions::DOUBLE_MUST_USE,
|
|
|
|
|
&functions::MUST_USE_CANDIDATE,
|
|
|
|
|
&functions::MUST_USE_UNIT,
|
|
|
|
|
&functions::NOT_UNSAFE_PTR_ARG_DEREF,
|
2020-10-23 15:16:59 -05:00
|
|
|
|
&functions::RESULT_UNIT_ERR,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&functions::TOO_MANY_ARGUMENTS,
|
|
|
|
|
&functions::TOO_MANY_LINES,
|
2020-04-07 08:39:07 -05:00
|
|
|
|
&future_not_send::FUTURE_NOT_SEND,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&get_last_with_len::GET_LAST_WITH_LEN,
|
|
|
|
|
&identity_op::IDENTITY_OP,
|
2020-03-05 07:36:19 -06:00
|
|
|
|
&if_let_mutex::IF_LET_MUTEX,
|
2020-01-10 15:02:02 -06:00
|
|
|
|
&if_let_some_result::IF_LET_SOME_RESULT,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&if_not_else::IF_NOT_ELSE,
|
|
|
|
|
&implicit_return::IMPLICIT_RETURN,
|
2020-04-06 13:07:57 -05:00
|
|
|
|
&implicit_saturating_sub::IMPLICIT_SATURATING_SUB,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&indexing_slicing::INDEXING_SLICING,
|
|
|
|
|
&indexing_slicing::OUT_OF_BOUNDS_INDEXING,
|
|
|
|
|
&infinite_iter::INFINITE_ITER,
|
|
|
|
|
&infinite_iter::MAYBE_INFINITE_ITER,
|
|
|
|
|
&inherent_impl::MULTIPLE_INHERENT_IMPL,
|
|
|
|
|
&inherent_to_string::INHERENT_TO_STRING,
|
|
|
|
|
&inherent_to_string::INHERENT_TO_STRING_SHADOW_DISPLAY,
|
|
|
|
|
&inline_fn_without_body::INLINE_FN_WITHOUT_BODY,
|
|
|
|
|
&int_plus_one::INT_PLUS_ONE,
|
|
|
|
|
&integer_division::INTEGER_DIVISION,
|
|
|
|
|
&items_after_statements::ITEMS_AFTER_STATEMENTS,
|
2020-02-29 11:41:18 -06:00
|
|
|
|
&large_const_arrays::LARGE_CONST_ARRAYS,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&large_enum_variant::LARGE_ENUM_VARIANT,
|
2019-11-12 16:22:53 -06:00
|
|
|
|
&large_stack_arrays::LARGE_STACK_ARRAYS,
|
2020-11-05 07:29:48 -06:00
|
|
|
|
&len_zero::COMPARISON_TO_EMPTY,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&len_zero::LEN_WITHOUT_IS_EMPTY,
|
|
|
|
|
&len_zero::LEN_ZERO,
|
|
|
|
|
&let_if_seq::USELESS_LET_IF_SEQ,
|
2020-01-27 08:34:30 -06:00
|
|
|
|
&let_underscore::LET_UNDERSCORE_LOCK,
|
2019-11-16 08:55:00 -06:00
|
|
|
|
&let_underscore::LET_UNDERSCORE_MUST_USE,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&lifetimes::EXTRA_UNUSED_LIFETIMES,
|
|
|
|
|
&lifetimes::NEEDLESS_LIFETIMES,
|
|
|
|
|
&literal_representation::DECIMAL_LITERAL_REPRESENTATION,
|
|
|
|
|
&literal_representation::INCONSISTENT_DIGIT_GROUPING,
|
|
|
|
|
&literal_representation::LARGE_DIGIT_GROUPS,
|
|
|
|
|
&literal_representation::MISTYPED_LITERAL_SUFFIXES,
|
|
|
|
|
&literal_representation::UNREADABLE_LITERAL,
|
2020-10-28 17:36:07 -05:00
|
|
|
|
&literal_representation::UNUSUAL_BYTE_GROUPINGS,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&loops::EMPTY_LOOP,
|
|
|
|
|
&loops::EXPLICIT_COUNTER_LOOP,
|
|
|
|
|
&loops::EXPLICIT_INTO_ITER_LOOP,
|
|
|
|
|
&loops::EXPLICIT_ITER_LOOP,
|
|
|
|
|
&loops::FOR_KV_MAP,
|
2020-05-17 10:36:26 -05:00
|
|
|
|
&loops::FOR_LOOPS_OVER_FALLIBLES,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&loops::ITER_NEXT_LOOP,
|
|
|
|
|
&loops::MANUAL_MEMCPY,
|
|
|
|
|
&loops::MUT_RANGE_BOUND,
|
|
|
|
|
&loops::NEEDLESS_COLLECT,
|
|
|
|
|
&loops::NEEDLESS_RANGE_LOOP,
|
|
|
|
|
&loops::NEVER_LOOP,
|
2020-08-11 08:43:21 -05:00
|
|
|
|
&loops::SAME_ITEM_PUSH,
|
2020-10-28 17:36:07 -05:00
|
|
|
|
&loops::SINGLE_ELEMENT_LOOP,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&loops::WHILE_IMMUTABLE_CONDITION,
|
|
|
|
|
&loops::WHILE_LET_LOOP,
|
|
|
|
|
&loops::WHILE_LET_ON_ITERATOR,
|
2020-03-05 12:22:17 -06:00
|
|
|
|
¯o_use::MACRO_USE_IMPORTS,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&main_recursion::MAIN_RECURSION,
|
2020-05-11 13:23:47 -05:00
|
|
|
|
&manual_async_fn::MANUAL_ASYNC_FN,
|
|
|
|
|
&manual_non_exhaustive::MANUAL_NON_EXHAUSTIVE,
|
2020-11-05 07:29:48 -06:00
|
|
|
|
&manual_ok_or::MANUAL_OK_OR,
|
2020-09-24 07:49:22 -05:00
|
|
|
|
&manual_strip::MANUAL_STRIP,
|
2020-10-23 15:16:59 -05:00
|
|
|
|
&manual_unwrap_or::MANUAL_UNWRAP_OR,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&map_clone::MAP_CLONE,
|
2020-09-24 07:49:22 -05:00
|
|
|
|
&map_err_ignore::MAP_ERR_IGNORE,
|
2020-07-14 07:59:59 -05:00
|
|
|
|
&map_identity::MAP_IDENTITY,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&map_unit_fn::OPTION_MAP_UNIT_FN,
|
|
|
|
|
&map_unit_fn::RESULT_MAP_UNIT_FN,
|
2020-04-25 03:33:40 -05:00
|
|
|
|
&match_on_vec_items::MATCH_ON_VEC_ITEMS,
|
2020-01-19 04:07:13 -06:00
|
|
|
|
&matches::INFALLIBLE_DESTRUCTURING_MATCH,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&matches::MATCH_AS_REF,
|
|
|
|
|
&matches::MATCH_BOOL,
|
2020-07-14 07:59:59 -05:00
|
|
|
|
&matches::MATCH_LIKE_MATCHES_MACRO,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&matches::MATCH_OVERLAPPING_ARM,
|
|
|
|
|
&matches::MATCH_REF_PATS,
|
2020-10-28 17:36:07 -05:00
|
|
|
|
&matches::MATCH_SAME_ARMS,
|
2020-01-15 00:56:56 -06:00
|
|
|
|
&matches::MATCH_SINGLE_BINDING,
|
2020-05-28 08:45:24 -05:00
|
|
|
|
&matches::MATCH_WILDCARD_FOR_SINGLE_VARIANTS,
|
2020-01-19 04:07:13 -06:00
|
|
|
|
&matches::MATCH_WILD_ERR_ARM,
|
2020-07-14 07:59:59 -05:00
|
|
|
|
&matches::REDUNDANT_PATTERN_MATCHING,
|
2020-03-01 10:36:14 -06:00
|
|
|
|
&matches::REST_PAT_IN_FULLY_BOUND_STRUCTS,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&matches::SINGLE_MATCH,
|
|
|
|
|
&matches::SINGLE_MATCH_ELSE,
|
|
|
|
|
&matches::WILDCARD_ENUM_MATCH_ARM,
|
2020-01-05 08:05:16 -06:00
|
|
|
|
&matches::WILDCARD_IN_OR_PATTERNS,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&mem_discriminant::MEM_DISCRIMINANT_NON_ENUM,
|
|
|
|
|
&mem_forget::MEM_FORGET,
|
|
|
|
|
&mem_replace::MEM_REPLACE_OPTION_WITH_NONE,
|
2019-12-07 21:10:06 -06:00
|
|
|
|
&mem_replace::MEM_REPLACE_WITH_DEFAULT,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&mem_replace::MEM_REPLACE_WITH_UNINIT,
|
2020-05-17 10:36:26 -05:00
|
|
|
|
&methods::BIND_INSTEAD_OF_MAP,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&methods::CHARS_LAST_CMP,
|
|
|
|
|
&methods::CHARS_NEXT_CMP,
|
|
|
|
|
&methods::CLONE_DOUBLE_REF,
|
|
|
|
|
&methods::CLONE_ON_COPY,
|
|
|
|
|
&methods::CLONE_ON_REF_PTR,
|
|
|
|
|
&methods::EXPECT_FUN_CALL,
|
2020-05-17 10:36:26 -05:00
|
|
|
|
&methods::EXPECT_USED,
|
2020-01-01 23:12:23 -06:00
|
|
|
|
&methods::FILETYPE_IS_FILE,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&methods::FILTER_MAP,
|
|
|
|
|
&methods::FILTER_MAP_NEXT,
|
|
|
|
|
&methods::FILTER_NEXT,
|
|
|
|
|
&methods::FIND_MAP,
|
|
|
|
|
&methods::FLAT_MAP_IDENTITY,
|
2020-11-05 07:29:48 -06:00
|
|
|
|
&methods::FROM_ITER_INSTEAD_OF_COLLECT,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&methods::GET_UNWRAP,
|
|
|
|
|
&methods::INEFFICIENT_TO_STRING,
|
|
|
|
|
&methods::INTO_ITER_ON_REF,
|
2019-12-18 10:59:43 -06:00
|
|
|
|
&methods::ITERATOR_STEP_BY_ZERO,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&methods::ITER_CLONED_COLLECT,
|
2020-06-09 09:36:01 -05:00
|
|
|
|
&methods::ITER_NEXT_SLICE,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&methods::ITER_NTH,
|
2019-12-28 16:37:23 -06:00
|
|
|
|
&methods::ITER_NTH_ZERO,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&methods::ITER_SKIP_NEXT,
|
|
|
|
|
&methods::MANUAL_SATURATING_ARITHMETIC,
|
2020-11-05 07:29:48 -06:00
|
|
|
|
&methods::MAP_COLLECT_RESULT_UNIT,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&methods::MAP_FLATTEN,
|
2020-05-17 10:36:26 -05:00
|
|
|
|
&methods::MAP_UNWRAP_OR,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&methods::NEW_RET_NO_SELF,
|
|
|
|
|
&methods::OK_EXPECT,
|
2019-12-22 22:48:15 -06:00
|
|
|
|
&methods::OPTION_AS_REF_DEREF,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&methods::OPTION_MAP_OR_NONE,
|
|
|
|
|
&methods::OR_FUN_CALL,
|
2020-04-04 01:59:52 -05:00
|
|
|
|
&methods::RESULT_MAP_OR_INTO_OPTION,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&methods::SEARCH_IS_SOME,
|
|
|
|
|
&methods::SHOULD_IMPLEMENT_TRAIT,
|
2020-11-05 07:29:48 -06:00
|
|
|
|
&methods::SINGLE_CHAR_ADD_STR,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&methods::SINGLE_CHAR_PATTERN,
|
2020-01-19 19:54:54 -06:00
|
|
|
|
&methods::SKIP_WHILE_NEXT,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&methods::STRING_EXTEND_CHARS,
|
|
|
|
|
&methods::SUSPICIOUS_MAP,
|
|
|
|
|
&methods::UNINIT_ASSUMED_INIT,
|
|
|
|
|
&methods::UNNECESSARY_FILTER_MAP,
|
|
|
|
|
&methods::UNNECESSARY_FOLD,
|
2020-08-28 09:10:16 -05:00
|
|
|
|
&methods::UNNECESSARY_LAZY_EVALUATIONS,
|
2020-05-17 10:36:26 -05:00
|
|
|
|
&methods::UNWRAP_USED,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&methods::USELESS_ASREF,
|
|
|
|
|
&methods::WRONG_PUB_SELF_CONVENTION,
|
|
|
|
|
&methods::WRONG_SELF_CONVENTION,
|
2019-11-14 13:18:24 -06:00
|
|
|
|
&methods::ZST_OFFSET,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&minmax::MIN_MAX,
|
|
|
|
|
&misc::CMP_NAN,
|
|
|
|
|
&misc::CMP_OWNED,
|
|
|
|
|
&misc::FLOAT_CMP,
|
|
|
|
|
&misc::FLOAT_CMP_CONST,
|
|
|
|
|
&misc::MODULO_ONE,
|
|
|
|
|
&misc::SHORT_CIRCUIT_STATEMENT,
|
|
|
|
|
&misc::TOPLEVEL_REF_ARG,
|
|
|
|
|
&misc::USED_UNDERSCORE_BINDING,
|
|
|
|
|
&misc::ZERO_PTR,
|
|
|
|
|
&misc_early::BUILTIN_TYPE_SHADOW,
|
|
|
|
|
&misc_early::DOUBLE_NEG,
|
|
|
|
|
&misc_early::DUPLICATE_UNDERSCORE_ARGUMENT,
|
|
|
|
|
&misc_early::MIXED_CASE_HEX_LITERALS,
|
|
|
|
|
&misc_early::REDUNDANT_PATTERN,
|
|
|
|
|
&misc_early::UNNEEDED_FIELD_PATTERN,
|
|
|
|
|
&misc_early::UNNEEDED_WILDCARD_PATTERN,
|
|
|
|
|
&misc_early::UNSEPARATED_LITERAL_SUFFIX,
|
|
|
|
|
&misc_early::ZERO_PREFIXED_LITERAL,
|
|
|
|
|
&missing_const_for_fn::MISSING_CONST_FOR_FN,
|
|
|
|
|
&missing_doc::MISSING_DOCS_IN_PRIVATE_ITEMS,
|
|
|
|
|
&missing_inline::MISSING_INLINE_IN_PUBLIC_ITEMS,
|
2019-12-26 06:34:18 -06:00
|
|
|
|
&modulo_arithmetic::MODULO_ARITHMETIC,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&multiple_crate_versions::MULTIPLE_CRATE_VERSIONS,
|
2019-12-06 12:45:33 -06:00
|
|
|
|
&mut_key::MUTABLE_KEY_TYPE,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&mut_mut::MUT_MUT,
|
2020-10-28 17:36:07 -05:00
|
|
|
|
&mut_mutex_lock::MUT_MUTEX_LOCK,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&mut_reference::UNNECESSARY_MUT_PASSED,
|
|
|
|
|
&mutable_debug_assertion::DEBUG_ASSERT_WITH_MUT_CALL,
|
|
|
|
|
&mutex_atomic::MUTEX_ATOMIC,
|
|
|
|
|
&mutex_atomic::MUTEX_INTEGER,
|
2020-08-11 08:43:21 -05:00
|
|
|
|
&needless_arbitrary_self_type::NEEDLESS_ARBITRARY_SELF_TYPE,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&needless_bool::BOOL_COMPARISON,
|
|
|
|
|
&needless_bool::NEEDLESS_BOOL,
|
|
|
|
|
&needless_borrow::NEEDLESS_BORROW,
|
|
|
|
|
&needless_borrowed_ref::NEEDLESS_BORROWED_REFERENCE,
|
|
|
|
|
&needless_continue::NEEDLESS_CONTINUE,
|
|
|
|
|
&needless_pass_by_value::NEEDLESS_PASS_BY_VALUE,
|
|
|
|
|
&needless_update::NEEDLESS_UPDATE,
|
|
|
|
|
&neg_cmp_op_on_partial_ord::NEG_CMP_OP_ON_PARTIAL_ORD,
|
|
|
|
|
&neg_multiply::NEG_MULTIPLY,
|
|
|
|
|
&new_without_default::NEW_WITHOUT_DEFAULT,
|
|
|
|
|
&no_effect::NO_EFFECT,
|
|
|
|
|
&no_effect::UNNECESSARY_OPERATION,
|
|
|
|
|
&non_copy_const::BORROW_INTERIOR_MUTABLE_CONST,
|
|
|
|
|
&non_copy_const::DECLARE_INTERIOR_MUTABLE_CONST,
|
|
|
|
|
&non_expressive_names::JUST_UNDERSCORES_AND_DIGITS,
|
|
|
|
|
&non_expressive_names::MANY_SINGLE_CHAR_NAMES,
|
|
|
|
|
&non_expressive_names::SIMILAR_NAMES,
|
|
|
|
|
&open_options::NONSENSICAL_OPEN_OPTIONS,
|
2020-02-08 18:44:35 -06:00
|
|
|
|
&option_env_unwrap::OPTION_ENV_UNWRAP,
|
2020-07-14 07:59:59 -05:00
|
|
|
|
&option_if_let_else::OPTION_IF_LET_ELSE,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&overflow_check_conditional::OVERFLOW_CHECK_CONDITIONAL,
|
2020-09-24 07:49:22 -05:00
|
|
|
|
&panic_in_result_fn::PANIC_IN_RESULT_FN,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&panic_unimplemented::PANIC,
|
|
|
|
|
&panic_unimplemented::TODO,
|
|
|
|
|
&panic_unimplemented::UNIMPLEMENTED,
|
|
|
|
|
&panic_unimplemented::UNREACHABLE,
|
|
|
|
|
&partialeq_ne_impl::PARTIALEQ_NE_IMPL,
|
2020-10-28 17:36:07 -05:00
|
|
|
|
&pass_by_ref_or_value::LARGE_TYPES_PASSED_BY_VALUE,
|
|
|
|
|
&pass_by_ref_or_value::TRIVIALLY_COPY_PASS_BY_REF,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&path_buf_push_overwrite::PATH_BUF_PUSH_OVERWRITE,
|
2020-07-14 07:59:59 -05:00
|
|
|
|
&pattern_type_mismatch::PATTERN_TYPE_MISMATCH,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&precedence::PRECEDENCE,
|
|
|
|
|
&ptr::CMP_NULL,
|
|
|
|
|
&ptr::MUT_FROM_REF,
|
|
|
|
|
&ptr::PTR_ARG,
|
2020-10-23 15:16:59 -05:00
|
|
|
|
&ptr_eq::PTR_EQ,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&ptr_offset_with_cast::PTR_OFFSET_WITH_CAST,
|
|
|
|
|
&question_mark::QUESTION_MARK,
|
2020-10-28 17:36:07 -05:00
|
|
|
|
&ranges::MANUAL_RANGE_CONTAINS,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&ranges::RANGE_MINUS_ONE,
|
|
|
|
|
&ranges::RANGE_PLUS_ONE,
|
|
|
|
|
&ranges::RANGE_ZIP_WITH_LEN,
|
2020-05-17 10:36:26 -05:00
|
|
|
|
&ranges::REVERSED_EMPTY_RANGES,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&redundant_clone::REDUNDANT_CLONE,
|
2020-07-26 14:07:07 -05:00
|
|
|
|
&redundant_closure_call::REDUNDANT_CLOSURE_CALL,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&redundant_field_names::REDUNDANT_FIELD_NAMES,
|
2020-03-15 12:38:20 -05:00
|
|
|
|
&redundant_pub_crate::REDUNDANT_PUB_CRATE,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&redundant_static_lifetimes::REDUNDANT_STATIC_LIFETIMES,
|
2020-11-05 07:29:48 -06:00
|
|
|
|
&ref_option_ref::REF_OPTION_REF,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&reference::DEREF_ADDROF,
|
|
|
|
|
&reference::REF_IN_DEREF,
|
|
|
|
|
®ex::INVALID_REGEX,
|
|
|
|
|
®ex::TRIVIAL_REGEX,
|
2020-07-14 07:59:59 -05:00
|
|
|
|
&repeat_once::REPEAT_ONCE,
|
2020-08-28 09:10:16 -05:00
|
|
|
|
&returns::LET_AND_RETURN,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&returns::NEEDLESS_RETURN,
|
2020-08-28 09:10:16 -05:00
|
|
|
|
&self_assignment::SELF_ASSIGNMENT,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&serde_api::SERDE_API_MISUSE,
|
|
|
|
|
&shadow::SHADOW_REUSE,
|
|
|
|
|
&shadow::SHADOW_SAME,
|
|
|
|
|
&shadow::SHADOW_UNRELATED,
|
2020-01-29 10:21:29 -06:00
|
|
|
|
&single_component_path_imports::SINGLE_COMPONENT_PATH_IMPORTS,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&slow_vector_initialization::SLOW_VECTOR_INITIALIZATION,
|
2020-08-11 08:43:21 -05:00
|
|
|
|
&stable_sort_primitive::STABLE_SORT_PRIMITIVE,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&strings::STRING_ADD,
|
|
|
|
|
&strings::STRING_ADD_ASSIGN,
|
|
|
|
|
&strings::STRING_LIT_AS_BYTES,
|
|
|
|
|
&suspicious_trait_impl::SUSPICIOUS_ARITHMETIC_IMPL,
|
|
|
|
|
&suspicious_trait_impl::SUSPICIOUS_OP_ASSIGN_IMPL,
|
|
|
|
|
&swap::ALMOST_SWAPPED,
|
|
|
|
|
&swap::MANUAL_SWAP,
|
2019-11-15 09:20:21 -06:00
|
|
|
|
&tabs_in_doc_comments::TABS_IN_DOC_COMMENTS,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&temporary_assignment::TEMPORARY_ASSIGNMENT,
|
2019-11-10 07:12:05 -06:00
|
|
|
|
&to_digit_is_some::TO_DIGIT_IS_SOME,
|
2020-08-28 09:10:16 -05:00
|
|
|
|
&to_string_in_display::TO_STRING_IN_DISPLAY,
|
2020-08-11 08:43:21 -05:00
|
|
|
|
&trait_bounds::TRAIT_DUPLICATION_IN_BOUNDS,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&trait_bounds::TYPE_REPETITION_IN_BOUNDS,
|
|
|
|
|
&transmute::CROSSPOINTER_TRANSMUTE,
|
2020-08-06 07:11:23 -05:00
|
|
|
|
&transmute::TRANSMUTES_EXPRESSIBLE_AS_PTR_CASTS,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&transmute::TRANSMUTE_BYTES_TO_STR,
|
2019-12-07 18:33:49 -06:00
|
|
|
|
&transmute::TRANSMUTE_FLOAT_TO_INT,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&transmute::TRANSMUTE_INT_TO_BOOL,
|
|
|
|
|
&transmute::TRANSMUTE_INT_TO_CHAR,
|
|
|
|
|
&transmute::TRANSMUTE_INT_TO_FLOAT,
|
|
|
|
|
&transmute::TRANSMUTE_PTR_TO_PTR,
|
|
|
|
|
&transmute::TRANSMUTE_PTR_TO_REF,
|
|
|
|
|
&transmute::UNSOUND_COLLECTION_TRANSMUTE,
|
|
|
|
|
&transmute::USELESS_TRANSMUTE,
|
|
|
|
|
&transmute::WRONG_TRANSMUTE,
|
|
|
|
|
&transmuting_null::TRANSMUTING_NULL,
|
|
|
|
|
&try_err::TRY_ERR,
|
|
|
|
|
&types::ABSURD_EXTREME_COMPARISONS,
|
|
|
|
|
&types::BORROWED_BOX,
|
|
|
|
|
&types::BOX_VEC,
|
|
|
|
|
&types::CAST_LOSSLESS,
|
|
|
|
|
&types::CAST_POSSIBLE_TRUNCATION,
|
|
|
|
|
&types::CAST_POSSIBLE_WRAP,
|
|
|
|
|
&types::CAST_PRECISION_LOSS,
|
|
|
|
|
&types::CAST_PTR_ALIGNMENT,
|
|
|
|
|
&types::CAST_REF_TO_MUT,
|
|
|
|
|
&types::CAST_SIGN_LOSS,
|
|
|
|
|
&types::CHAR_LIT_AS_U8,
|
|
|
|
|
&types::FN_TO_NUMERIC_CAST,
|
|
|
|
|
&types::FN_TO_NUMERIC_CAST_WITH_TRUNCATION,
|
|
|
|
|
&types::IMPLICIT_HASHER,
|
|
|
|
|
&types::INVALID_UPCAST_COMPARISONS,
|
|
|
|
|
&types::LET_UNIT_VALUE,
|
|
|
|
|
&types::LINKEDLIST,
|
|
|
|
|
&types::OPTION_OPTION,
|
2020-09-24 07:49:22 -05:00
|
|
|
|
&types::RC_BUFFER,
|
2020-03-12 15:41:13 -05:00
|
|
|
|
&types::REDUNDANT_ALLOCATION,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&types::TYPE_COMPLEXITY,
|
|
|
|
|
&types::UNIT_ARG,
|
|
|
|
|
&types::UNIT_CMP,
|
|
|
|
|
&types::UNNECESSARY_CAST,
|
|
|
|
|
&types::VEC_BOX,
|
2020-10-28 17:36:07 -05:00
|
|
|
|
&undropped_manually_drops::UNDROPPED_MANUALLY_DROPS,
|
2020-10-09 05:45:29 -05:00
|
|
|
|
&unicode::INVISIBLE_CHARACTERS,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&unicode::NON_ASCII_LITERAL,
|
|
|
|
|
&unicode::UNICODE_NOT_NFC,
|
2020-07-26 14:07:07 -05:00
|
|
|
|
&unit_return_expecting_ord::UNIT_RETURN_EXPECTING_ORD,
|
2020-03-11 19:00:00 -05:00
|
|
|
|
&unnamed_address::FN_ADDRESS_COMPARISONS,
|
|
|
|
|
&unnamed_address::VTABLE_ADDRESS_COMPARISONS,
|
2020-06-09 09:36:01 -05:00
|
|
|
|
&unnecessary_sort_by::UNNECESSARY_SORT_BY,
|
|
|
|
|
&unnested_or_patterns::UNNESTED_OR_PATTERNS,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&unsafe_removed_from_name::UNSAFE_REMOVED_FROM_NAME,
|
|
|
|
|
&unused_io_amount::UNUSED_IO_AMOUNT,
|
|
|
|
|
&unused_self::UNUSED_SELF,
|
2020-08-28 09:10:16 -05:00
|
|
|
|
&unused_unit::UNUSED_UNIT,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&unwrap::PANICKING_UNWRAP,
|
|
|
|
|
&unwrap::UNNECESSARY_UNWRAP,
|
2020-08-28 09:10:16 -05:00
|
|
|
|
&unwrap_in_result::UNWRAP_IN_RESULT,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&use_self::USE_SELF,
|
2020-05-17 10:36:26 -05:00
|
|
|
|
&useless_conversion::USELESS_CONVERSION,
|
2020-04-02 15:08:25 -05:00
|
|
|
|
&utils::internal_lints::CLIPPY_LINTS_INTERNAL,
|
2020-04-17 07:43:37 -05:00
|
|
|
|
&utils::internal_lints::COLLAPSIBLE_SPAN_LINT_CALLS,
|
2020-04-02 15:08:25 -05:00
|
|
|
|
&utils::internal_lints::COMPILER_LINT_FUNCTIONS,
|
|
|
|
|
&utils::internal_lints::DEFAULT_LINT,
|
2020-10-28 17:36:07 -05:00
|
|
|
|
&utils::internal_lints::INVALID_PATHS,
|
2020-04-02 15:08:25 -05:00
|
|
|
|
&utils::internal_lints::LINT_WITHOUT_LINT_PASS,
|
2020-09-24 07:49:22 -05:00
|
|
|
|
&utils::internal_lints::MATCH_TYPE_ON_DIAGNOSTIC_ITEM,
|
2020-04-02 15:08:25 -05:00
|
|
|
|
&utils::internal_lints::OUTER_EXPN_EXPN_DATA,
|
|
|
|
|
&utils::internal_lints::PRODUCE_ICE,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&vec::USELESS_VEC,
|
2020-06-09 09:36:01 -05:00
|
|
|
|
&vec_resize_to_zero::VEC_RESIZE_TO_ZERO,
|
2020-03-04 20:13:57 -06:00
|
|
|
|
&verbose_file_reads::VERBOSE_FILE_READS,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&wildcard_dependencies::WILDCARD_DEPENDENCIES,
|
2020-01-14 06:52:08 -06:00
|
|
|
|
&wildcard_imports::ENUM_GLOB_USE,
|
2020-01-07 10:54:08 -06:00
|
|
|
|
&wildcard_imports::WILDCARD_IMPORTS,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&write::PRINTLN_EMPTY_STRING,
|
|
|
|
|
&write::PRINT_LITERAL,
|
|
|
|
|
&write::PRINT_STDOUT,
|
|
|
|
|
&write::PRINT_WITH_NEWLINE,
|
|
|
|
|
&write::USE_DEBUG,
|
|
|
|
|
&write::WRITELN_EMPTY_STRING,
|
|
|
|
|
&write::WRITE_LITERAL,
|
|
|
|
|
&write::WRITE_WITH_NEWLINE,
|
|
|
|
|
&zero_div_zero::ZERO_DIVIDED_BY_ZERO,
|
|
|
|
|
]);
|
|
|
|
|
// end register lints, do not remove this comment, it’s used in `update_lints`
|
|
|
|
|
|
2020-10-28 17:36:07 -05:00
|
|
|
|
store.register_late_pass(|| box await_holding_invalid::AwaitHolding);
|
2019-10-10 20:46:22 -05:00
|
|
|
|
store.register_late_pass(|| box serde_api::SerdeAPI);
|
|
|
|
|
store.register_late_pass(|| box utils::internal_lints::CompilerLintFunctions::new());
|
|
|
|
|
store.register_late_pass(|| box utils::internal_lints::LintWithoutLintPass::default());
|
|
|
|
|
store.register_late_pass(|| box utils::internal_lints::OuterExpnDataPass);
|
2020-10-28 17:36:07 -05:00
|
|
|
|
store.register_late_pass(|| box utils::internal_lints::InvalidPaths);
|
2019-10-10 20:46:22 -05:00
|
|
|
|
store.register_late_pass(|| box utils::inspector::DeepCodeInspector);
|
|
|
|
|
store.register_late_pass(|| box utils::author::Author);
|
2020-01-23 08:52:41 -06:00
|
|
|
|
let vec_box_size_threshold = conf.vec_box_size_threshold;
|
|
|
|
|
store.register_late_pass(move || box types::Types::new(vec_box_size_threshold));
|
2019-10-10 20:46:22 -05:00
|
|
|
|
store.register_late_pass(|| box booleans::NonminimalBool);
|
|
|
|
|
store.register_late_pass(|| box eq_op::EqOp);
|
|
|
|
|
store.register_late_pass(|| box enum_clike::UnportableVariant);
|
2020-02-20 20:32:06 -06:00
|
|
|
|
store.register_late_pass(|| box float_literal::FloatLiteral);
|
2019-10-24 07:33:14 -05:00
|
|
|
|
let verbose_bit_mask_threshold = conf.verbose_bit_mask_threshold;
|
|
|
|
|
store.register_late_pass(move || box bit_mask::BitMask::new(verbose_bit_mask_threshold));
|
2019-10-10 20:46:22 -05:00
|
|
|
|
store.register_late_pass(|| box ptr::Ptr);
|
2020-10-23 15:16:59 -05:00
|
|
|
|
store.register_late_pass(|| box ptr_eq::PtrEq);
|
2019-10-10 20:46:22 -05:00
|
|
|
|
store.register_late_pass(|| box needless_bool::NeedlessBool);
|
|
|
|
|
store.register_late_pass(|| box needless_bool::BoolComparison);
|
|
|
|
|
store.register_late_pass(|| box approx_const::ApproxConstant);
|
|
|
|
|
store.register_late_pass(|| box misc::MiscLints);
|
|
|
|
|
store.register_late_pass(|| box eta_reduction::EtaReduction);
|
|
|
|
|
store.register_late_pass(|| box identity_op::IdentityOp);
|
|
|
|
|
store.register_late_pass(|| box erasing_op::ErasingOp);
|
|
|
|
|
store.register_late_pass(|| box mut_mut::MutMut);
|
|
|
|
|
store.register_late_pass(|| box mut_reference::UnnecessaryMutPassed);
|
|
|
|
|
store.register_late_pass(|| box len_zero::LenZero);
|
|
|
|
|
store.register_late_pass(|| box attrs::Attributes);
|
2020-05-17 10:36:26 -05:00
|
|
|
|
store.register_late_pass(|| box blocks_in_if_conditions::BlocksInIfConditions);
|
2019-10-10 20:46:22 -05:00
|
|
|
|
store.register_late_pass(|| box unicode::Unicode);
|
2020-07-26 14:07:07 -05:00
|
|
|
|
store.register_late_pass(|| box unit_return_expecting_ord::UnitReturnExpectingOrd);
|
2019-10-10 20:46:22 -05:00
|
|
|
|
store.register_late_pass(|| box strings::StringAdd);
|
|
|
|
|
store.register_late_pass(|| box implicit_return::ImplicitReturn);
|
2020-04-06 13:07:57 -05:00
|
|
|
|
store.register_late_pass(|| box implicit_saturating_sub::ImplicitSaturatingSub);
|
2019-10-10 20:46:22 -05:00
|
|
|
|
store.register_late_pass(|| box methods::Methods);
|
|
|
|
|
store.register_late_pass(|| box map_clone::MapClone);
|
2020-09-24 07:49:22 -05:00
|
|
|
|
store.register_late_pass(|| box map_err_ignore::MapErrIgnore);
|
2019-10-10 20:46:22 -05:00
|
|
|
|
store.register_late_pass(|| box shadow::Shadow);
|
|
|
|
|
store.register_late_pass(|| box types::LetUnitValue);
|
|
|
|
|
store.register_late_pass(|| box types::UnitCmp);
|
|
|
|
|
store.register_late_pass(|| box loops::Loops);
|
|
|
|
|
store.register_late_pass(|| box main_recursion::MainRecursion::default());
|
|
|
|
|
store.register_late_pass(|| box lifetimes::Lifetimes);
|
|
|
|
|
store.register_late_pass(|| box entry::HashMapPass);
|
|
|
|
|
store.register_late_pass(|| box ranges::Ranges);
|
|
|
|
|
store.register_late_pass(|| box types::Casts);
|
2019-10-24 07:33:14 -05:00
|
|
|
|
let type_complexity_threshold = conf.type_complexity_threshold;
|
|
|
|
|
store.register_late_pass(move || box types::TypeComplexity::new(type_complexity_threshold));
|
2020-01-19 04:07:13 -06:00
|
|
|
|
store.register_late_pass(|| box matches::Matches::default());
|
2019-10-10 20:46:22 -05:00
|
|
|
|
store.register_late_pass(|| box minmax::MinMaxPass);
|
|
|
|
|
store.register_late_pass(|| box open_options::OpenOptions);
|
|
|
|
|
store.register_late_pass(|| box zero_div_zero::ZeroDiv);
|
|
|
|
|
store.register_late_pass(|| box mutex_atomic::Mutex);
|
|
|
|
|
store.register_late_pass(|| box needless_update::NeedlessUpdate);
|
|
|
|
|
store.register_late_pass(|| box needless_borrow::NeedlessBorrow::default());
|
|
|
|
|
store.register_late_pass(|| box needless_borrowed_ref::NeedlessBorrowedRef);
|
|
|
|
|
store.register_late_pass(|| box no_effect::NoEffect);
|
|
|
|
|
store.register_late_pass(|| box temporary_assignment::TemporaryAssignment);
|
|
|
|
|
store.register_late_pass(|| box transmute::Transmute);
|
2019-10-24 07:33:14 -05:00
|
|
|
|
let cognitive_complexity_threshold = conf.cognitive_complexity_threshold;
|
|
|
|
|
store.register_late_pass(move || box cognitive_complexity::CognitiveComplexity::new(cognitive_complexity_threshold));
|
|
|
|
|
let too_large_for_stack = conf.too_large_for_stack;
|
|
|
|
|
store.register_late_pass(move || box escape::BoxedLocal{too_large_for_stack});
|
2020-08-28 09:10:16 -05:00
|
|
|
|
store.register_late_pass(move || box vec::UselessVec{too_large_for_stack});
|
2019-10-10 20:46:22 -05:00
|
|
|
|
store.register_late_pass(|| box panic_unimplemented::PanicUnimplemented);
|
|
|
|
|
store.register_late_pass(|| box strings::StringLitAsBytes);
|
|
|
|
|
store.register_late_pass(|| box derive::Derive);
|
|
|
|
|
store.register_late_pass(|| box types::CharLitAsU8);
|
|
|
|
|
store.register_late_pass(|| box get_last_with_len::GetLastWithLen);
|
|
|
|
|
store.register_late_pass(|| box drop_forget_ref::DropForgetRef);
|
|
|
|
|
store.register_late_pass(|| box empty_enum::EmptyEnum);
|
|
|
|
|
store.register_late_pass(|| box types::AbsurdExtremeComparisons);
|
|
|
|
|
store.register_late_pass(|| box types::InvalidUpcastComparisons);
|
|
|
|
|
store.register_late_pass(|| box regex::Regex::default());
|
|
|
|
|
store.register_late_pass(|| box copies::CopyAndPaste);
|
|
|
|
|
store.register_late_pass(|| box copy_iterator::CopyIterator);
|
|
|
|
|
store.register_late_pass(|| box format::UselessFormat);
|
|
|
|
|
store.register_late_pass(|| box swap::Swap);
|
|
|
|
|
store.register_late_pass(|| box overflow_check_conditional::OverflowCheckConditional);
|
|
|
|
|
store.register_late_pass(|| box new_without_default::NewWithoutDefault::default());
|
2019-10-24 07:33:14 -05:00
|
|
|
|
let blacklisted_names = conf.blacklisted_names.iter().cloned().collect::<FxHashSet<_>>();
|
|
|
|
|
store.register_late_pass(move || box blacklisted_name::BlacklistedName::new(blacklisted_names.clone()));
|
|
|
|
|
let too_many_arguments_threshold1 = conf.too_many_arguments_threshold;
|
|
|
|
|
let too_many_lines_threshold2 = conf.too_many_lines_threshold;
|
|
|
|
|
store.register_late_pass(move || box functions::Functions::new(too_many_arguments_threshold1, too_many_lines_threshold2));
|
|
|
|
|
let doc_valid_idents = conf.doc_valid_idents.iter().cloned().collect::<FxHashSet<_>>();
|
|
|
|
|
store.register_late_pass(move || box doc::DocMarkdown::new(doc_valid_idents.clone()));
|
2019-10-10 20:46:22 -05:00
|
|
|
|
store.register_late_pass(|| box neg_multiply::NegMultiply);
|
|
|
|
|
store.register_late_pass(|| box mem_discriminant::MemDiscriminant);
|
|
|
|
|
store.register_late_pass(|| box mem_forget::MemForget);
|
|
|
|
|
store.register_late_pass(|| box mem_replace::MemReplace);
|
|
|
|
|
store.register_late_pass(|| box arithmetic::Arithmetic::default());
|
|
|
|
|
store.register_late_pass(|| box assign_ops::AssignOps);
|
|
|
|
|
store.register_late_pass(|| box let_if_seq::LetIfSeq);
|
|
|
|
|
store.register_late_pass(|| box eval_order_dependence::EvalOrderDependence);
|
|
|
|
|
store.register_late_pass(|| box missing_doc::MissingDoc::new());
|
|
|
|
|
store.register_late_pass(|| box missing_inline::MissingInline);
|
2020-01-10 12:29:55 -06:00
|
|
|
|
store.register_late_pass(|| box if_let_some_result::OkIfLet);
|
2019-10-10 20:46:22 -05:00
|
|
|
|
store.register_late_pass(|| box partialeq_ne_impl::PartialEqNeImpl);
|
|
|
|
|
store.register_late_pass(|| box unused_io_amount::UnusedIoAmount);
|
2019-10-24 07:33:14 -05:00
|
|
|
|
let enum_variant_size_threshold = conf.enum_variant_size_threshold;
|
|
|
|
|
store.register_late_pass(move || box large_enum_variant::LargeEnumVariant::new(enum_variant_size_threshold));
|
2019-10-10 20:46:22 -05:00
|
|
|
|
store.register_late_pass(|| box explicit_write::ExplicitWrite);
|
|
|
|
|
store.register_late_pass(|| box needless_pass_by_value::NeedlessPassByValue);
|
2020-10-28 17:36:07 -05:00
|
|
|
|
let pass_by_ref_or_value = pass_by_ref_or_value::PassByRefOrValue::new(
|
2019-10-10 20:46:22 -05:00
|
|
|
|
conf.trivial_copy_size_limit,
|
2020-10-28 17:36:07 -05:00
|
|
|
|
conf.pass_by_value_size_limit,
|
2019-10-10 20:46:22 -05:00
|
|
|
|
&sess.target,
|
2016-12-21 05:30:41 -06:00
|
|
|
|
);
|
2020-10-28 17:36:07 -05:00
|
|
|
|
store.register_late_pass(move || box pass_by_ref_or_value);
|
2020-11-05 07:29:48 -06:00
|
|
|
|
store.register_late_pass(|| box ref_option_ref::RefOptionRef);
|
2019-10-10 20:46:22 -05:00
|
|
|
|
store.register_late_pass(|| box try_err::TryErr);
|
|
|
|
|
store.register_late_pass(|| box use_self::UseSelf);
|
|
|
|
|
store.register_late_pass(|| box bytecount::ByteCount);
|
|
|
|
|
store.register_late_pass(|| box infinite_iter::InfiniteIter);
|
|
|
|
|
store.register_late_pass(|| box inline_fn_without_body::InlineFnWithoutBody);
|
2020-05-17 10:36:26 -05:00
|
|
|
|
store.register_late_pass(|| box useless_conversion::UselessConversion::default());
|
2019-10-10 20:46:22 -05:00
|
|
|
|
store.register_late_pass(|| box types::ImplicitHasher);
|
|
|
|
|
store.register_late_pass(|| box fallible_impl_from::FallibleImplFrom);
|
|
|
|
|
store.register_late_pass(|| box types::UnitArg);
|
|
|
|
|
store.register_late_pass(|| box double_comparison::DoubleComparisons);
|
|
|
|
|
store.register_late_pass(|| box question_mark::QuestionMark);
|
|
|
|
|
store.register_late_pass(|| box suspicious_trait_impl::SuspiciousImpl);
|
|
|
|
|
store.register_late_pass(|| box map_unit_fn::MapUnit);
|
|
|
|
|
store.register_late_pass(|| box inherent_impl::MultipleInherentImpl::default());
|
|
|
|
|
store.register_late_pass(|| box neg_cmp_op_on_partial_ord::NoNegCompOpForPartialOrd);
|
|
|
|
|
store.register_late_pass(|| box unwrap::Unwrap);
|
|
|
|
|
store.register_late_pass(|| box duration_subsec::DurationSubsec);
|
|
|
|
|
store.register_late_pass(|| box indexing_slicing::IndexingSlicing);
|
|
|
|
|
store.register_late_pass(|| box non_copy_const::NonCopyConst);
|
|
|
|
|
store.register_late_pass(|| box ptr_offset_with_cast::PtrOffsetWithCast);
|
|
|
|
|
store.register_late_pass(|| box redundant_clone::RedundantClone);
|
|
|
|
|
store.register_late_pass(|| box slow_vector_initialization::SlowVectorInit);
|
2020-06-09 09:36:01 -05:00
|
|
|
|
store.register_late_pass(|| box unnecessary_sort_by::UnnecessarySortBy);
|
2019-10-10 20:46:22 -05:00
|
|
|
|
store.register_late_pass(|| box types::RefToMut);
|
|
|
|
|
store.register_late_pass(|| box assertions_on_constants::AssertionsOnConstants);
|
|
|
|
|
store.register_late_pass(|| box missing_const_for_fn::MissingConstForFn);
|
|
|
|
|
store.register_late_pass(|| box transmuting_null::TransmutingNull);
|
|
|
|
|
store.register_late_pass(|| box path_buf_push_overwrite::PathBufPushOverwrite);
|
|
|
|
|
store.register_late_pass(|| box checked_conversions::CheckedConversions);
|
|
|
|
|
store.register_late_pass(|| box integer_division::IntegerDivision);
|
|
|
|
|
store.register_late_pass(|| box inherent_to_string::InherentToString);
|
2020-07-14 07:59:59 -05:00
|
|
|
|
let max_trait_bounds = conf.max_trait_bounds;
|
|
|
|
|
store.register_late_pass(move || box trait_bounds::TraitBounds::new(max_trait_bounds));
|
2019-10-10 20:46:22 -05:00
|
|
|
|
store.register_late_pass(|| box comparison_chain::ComparisonChain);
|
2019-12-06 12:45:33 -06:00
|
|
|
|
store.register_late_pass(|| box mut_key::MutableKeyType);
|
2019-12-26 06:34:18 -06:00
|
|
|
|
store.register_late_pass(|| box modulo_arithmetic::ModuloArithmetic);
|
2019-10-10 20:46:22 -05:00
|
|
|
|
store.register_early_pass(|| box reference::DerefAddrOf);
|
|
|
|
|
store.register_early_pass(|| box reference::RefInDeref);
|
|
|
|
|
store.register_early_pass(|| box double_parens::DoubleParens);
|
2020-08-28 09:10:16 -05:00
|
|
|
|
store.register_late_pass(|| box to_string_in_display::ToStringInDisplay::new());
|
2019-10-10 20:46:22 -05:00
|
|
|
|
store.register_early_pass(|| box unsafe_removed_from_name::UnsafeNameRemoval);
|
|
|
|
|
store.register_early_pass(|| box if_not_else::IfNotElse);
|
|
|
|
|
store.register_early_pass(|| box else_if_without_else::ElseIfWithoutElse);
|
|
|
|
|
store.register_early_pass(|| box int_plus_one::IntPlusOne);
|
|
|
|
|
store.register_early_pass(|| box formatting::Formatting);
|
|
|
|
|
store.register_early_pass(|| box misc_early::MiscEarlyLints);
|
2020-07-26 14:07:07 -05:00
|
|
|
|
store.register_early_pass(|| box redundant_closure_call::RedundantClosureCall);
|
|
|
|
|
store.register_late_pass(|| box redundant_closure_call::RedundantClosureCall);
|
2020-08-28 09:10:16 -05:00
|
|
|
|
store.register_early_pass(|| box unused_unit::UnusedUnit);
|
|
|
|
|
store.register_late_pass(|| box returns::Return);
|
2019-10-10 20:46:22 -05:00
|
|
|
|
store.register_early_pass(|| box collapsible_if::CollapsibleIf);
|
|
|
|
|
store.register_early_pass(|| box items_after_statements::ItemsAfterStatements);
|
|
|
|
|
store.register_early_pass(|| box precedence::Precedence);
|
|
|
|
|
store.register_early_pass(|| box needless_continue::NeedlessContinue);
|
2020-09-10 10:47:07 -05:00
|
|
|
|
store.register_late_pass(|| box create_dir::CreateDir);
|
2020-08-11 08:43:21 -05:00
|
|
|
|
store.register_early_pass(|| box needless_arbitrary_self_type::NeedlessArbitrarySelfType);
|
2019-10-10 20:46:22 -05:00
|
|
|
|
store.register_early_pass(|| box redundant_static_lifetimes::RedundantStaticLifetimes);
|
2020-04-21 15:53:18 -05:00
|
|
|
|
store.register_late_pass(|| box cargo_common_metadata::CargoCommonMetadata);
|
|
|
|
|
store.register_late_pass(|| box multiple_crate_versions::MultipleCrateVersions);
|
|
|
|
|
store.register_late_pass(|| box wildcard_dependencies::WildcardDependencies);
|
2019-10-10 20:46:22 -05:00
|
|
|
|
store.register_early_pass(|| box literal_representation::LiteralDigitGrouping);
|
2019-10-24 07:33:14 -05:00
|
|
|
|
let literal_representation_threshold = conf.literal_representation_threshold;
|
|
|
|
|
store.register_early_pass(move || box literal_representation::DecimalLiteralRepresentation::new(literal_representation_threshold));
|
2019-10-10 20:46:22 -05:00
|
|
|
|
store.register_early_pass(|| box utils::internal_lints::ClippyLintsInternal);
|
2019-10-24 07:33:14 -05:00
|
|
|
|
let enum_variant_name_threshold = conf.enum_variant_name_threshold;
|
|
|
|
|
store.register_early_pass(move || box enum_variants::EnumVariantNames::new(enum_variant_name_threshold));
|
2019-11-15 09:20:21 -06:00
|
|
|
|
store.register_early_pass(|| box tabs_in_doc_comments::TabsInDocComments);
|
2020-11-05 07:29:48 -06:00
|
|
|
|
store.register_late_pass(|| box default::Default::default());
|
2019-10-24 06:29:51 -05:00
|
|
|
|
store.register_late_pass(|| box unused_self::UnusedSelf);
|
|
|
|
|
store.register_late_pass(|| box mutable_debug_assertion::DebugAssertWithMutCall);
|
2019-10-25 03:59:33 -05:00
|
|
|
|
store.register_late_pass(|| box exit::Exit);
|
2019-11-10 07:12:05 -06:00
|
|
|
|
store.register_late_pass(|| box to_digit_is_some::ToDigitIsSome);
|
2019-11-12 16:22:53 -06:00
|
|
|
|
let array_size_threshold = conf.array_size_threshold;
|
|
|
|
|
store.register_late_pass(move || box large_stack_arrays::LargeStackArrays::new(array_size_threshold));
|
2020-02-29 11:41:18 -06:00
|
|
|
|
store.register_late_pass(move || box large_const_arrays::LargeConstArrays::new(array_size_threshold));
|
2020-07-14 07:59:59 -05:00
|
|
|
|
store.register_late_pass(|| box floating_point_arithmetic::FloatingPointArithmetic);
|
2019-11-15 13:27:07 -06:00
|
|
|
|
store.register_early_pass(|| box as_conversions::AsConversions);
|
2019-09-27 00:09:12 -05:00
|
|
|
|
store.register_early_pass(|| box utils::internal_lints::ProduceIce);
|
2019-11-16 08:55:00 -06:00
|
|
|
|
store.register_late_pass(|| box let_underscore::LetUnderscore);
|
2020-01-05 18:16:27 -06:00
|
|
|
|
store.register_late_pass(|| box atomic_ordering::AtomicOrdering);
|
2020-01-29 10:21:29 -06:00
|
|
|
|
store.register_early_pass(|| box single_component_path_imports::SingleComponentPathImports);
|
2020-02-01 17:49:52 -06:00
|
|
|
|
let max_fn_params_bools = conf.max_fn_params_bools;
|
|
|
|
|
let max_struct_bools = conf.max_struct_bools;
|
|
|
|
|
store.register_early_pass(move || box excessive_bools::ExcessiveBools::new(max_struct_bools, max_fn_params_bools));
|
2020-02-08 18:44:35 -06:00
|
|
|
|
store.register_early_pass(|| box option_env_unwrap::OptionEnvUnwrap);
|
2020-05-11 13:23:47 -05:00
|
|
|
|
let warn_on_all_wildcard_imports = conf.warn_on_all_wildcard_imports;
|
|
|
|
|
store.register_late_pass(move || box wildcard_imports::WildcardImports::new(warn_on_all_wildcard_imports));
|
2020-03-04 20:13:57 -06:00
|
|
|
|
store.register_late_pass(|| box verbose_file_reads::VerboseFileReads);
|
2020-03-15 12:38:20 -05:00
|
|
|
|
store.register_late_pass(|| box redundant_pub_crate::RedundantPubCrate::default());
|
2020-03-11 19:00:00 -05:00
|
|
|
|
store.register_late_pass(|| box unnamed_address::UnnamedAddress);
|
2020-01-23 09:28:01 -06:00
|
|
|
|
store.register_late_pass(|| box dereference::Dereferencing);
|
2020-07-14 07:59:59 -05:00
|
|
|
|
store.register_late_pass(|| box option_if_let_else::OptionIfLetElse);
|
2020-04-07 08:39:07 -05:00
|
|
|
|
store.register_late_pass(|| box future_not_send::FutureNotSend);
|
2020-04-17 07:43:37 -05:00
|
|
|
|
store.register_late_pass(|| box utils::internal_lints::CollapsibleCalls);
|
2020-03-05 07:36:19 -06:00
|
|
|
|
store.register_late_pass(|| box if_let_mutex::IfLetMutex);
|
2020-10-28 17:36:07 -05:00
|
|
|
|
store.register_late_pass(|| box mut_mutex_lock::MutMutexLock);
|
2020-04-25 03:33:40 -05:00
|
|
|
|
store.register_late_pass(|| box match_on_vec_items::MatchOnVecItems);
|
2020-05-11 13:23:47 -05:00
|
|
|
|
store.register_early_pass(|| box manual_non_exhaustive::ManualNonExhaustive);
|
|
|
|
|
store.register_late_pass(|| box manual_async_fn::ManualAsyncFn);
|
2020-05-28 08:45:24 -05:00
|
|
|
|
store.register_early_pass(|| box redundant_field_names::RedundantFieldNames);
|
2020-06-09 09:36:01 -05:00
|
|
|
|
store.register_late_pass(|| box vec_resize_to_zero::VecResizeToZero);
|
2020-09-24 07:49:22 -05:00
|
|
|
|
store.register_late_pass(|| box panic_in_result_fn::PanicInResultFn);
|
|
|
|
|
|
2020-05-28 08:45:24 -05:00
|
|
|
|
let single_char_binding_names_threshold = conf.single_char_binding_names_threshold;
|
|
|
|
|
store.register_early_pass(move || box non_expressive_names::NonExpressiveNames {
|
|
|
|
|
single_char_binding_names_threshold,
|
|
|
|
|
});
|
2020-06-09 09:36:01 -05:00
|
|
|
|
store.register_early_pass(|| box unnested_or_patterns::UnnestedOrPatterns);
|
2020-06-23 10:05:22 -05:00
|
|
|
|
store.register_late_pass(|| box macro_use::MacroUseImports::default());
|
2020-07-14 07:59:59 -05:00
|
|
|
|
store.register_late_pass(|| box map_identity::MapIdentity);
|
|
|
|
|
store.register_late_pass(|| box pattern_type_mismatch::PatternTypeMismatch);
|
2020-08-11 08:43:21 -05:00
|
|
|
|
store.register_late_pass(|| box stable_sort_primitive::StableSortPrimitive);
|
2020-07-14 07:59:59 -05:00
|
|
|
|
store.register_late_pass(|| box repeat_once::RepeatOnce);
|
2020-08-28 09:10:16 -05:00
|
|
|
|
store.register_late_pass(|| box unwrap_in_result::UnwrapInResult);
|
|
|
|
|
store.register_late_pass(|| box self_assignment::SelfAssignment);
|
2020-10-23 15:16:59 -05:00
|
|
|
|
store.register_late_pass(|| box manual_unwrap_or::ManualUnwrapOr);
|
2020-11-05 07:29:48 -06:00
|
|
|
|
store.register_late_pass(|| box manual_ok_or::ManualOkOr);
|
2020-08-28 09:10:16 -05:00
|
|
|
|
store.register_late_pass(|| box float_equality_without_abs::FloatEqualityWithoutAbs);
|
2020-09-10 10:47:07 -05:00
|
|
|
|
store.register_late_pass(|| box async_yields_async::AsyncYieldsAsync);
|
2020-09-24 07:49:22 -05:00
|
|
|
|
store.register_late_pass(|| box manual_strip::ManualStrip);
|
|
|
|
|
store.register_late_pass(|| box utils::internal_lints::MatchTypeOnDiagItem);
|
2020-10-09 05:45:29 -05:00
|
|
|
|
let disallowed_methods = conf.disallowed_methods.iter().cloned().collect::<FxHashSet<_>>();
|
|
|
|
|
store.register_late_pass(move || box disallowed_method::DisallowedMethod::new(&disallowed_methods));
|
|
|
|
|
store.register_early_pass(|| box asm_syntax::InlineAsmX86AttSyntax);
|
|
|
|
|
store.register_early_pass(|| box asm_syntax::InlineAsmX86IntelSyntax);
|
2020-10-28 17:36:07 -05:00
|
|
|
|
store.register_late_pass(|| box undropped_manually_drops::UndroppedManuallyDrops);
|
2020-10-09 05:45:29 -05:00
|
|
|
|
|
2016-05-24 11:25:25 -05:00
|
|
|
|
|
2019-10-10 20:46:22 -05:00
|
|
|
|
store.register_group(true, "clippy::restriction", Some("clippy_restriction"), vec![
|
|
|
|
|
LintId::of(&arithmetic::FLOAT_ARITHMETIC),
|
|
|
|
|
LintId::of(&arithmetic::INTEGER_ARITHMETIC),
|
2019-11-15 13:27:07 -06:00
|
|
|
|
LintId::of(&as_conversions::AS_CONVERSIONS),
|
2020-10-09 05:45:29 -05:00
|
|
|
|
LintId::of(&asm_syntax::INLINE_ASM_X86_ATT_SYNTAX),
|
|
|
|
|
LintId::of(&asm_syntax::INLINE_ASM_X86_INTEL_SYNTAX),
|
2020-09-10 10:47:07 -05:00
|
|
|
|
LintId::of(&create_dir::CREATE_DIR),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&dbg_macro::DBG_MACRO),
|
|
|
|
|
LintId::of(&else_if_without_else::ELSE_IF_WITHOUT_ELSE),
|
2019-10-18 14:10:35 -05:00
|
|
|
|
LintId::of(&exit::EXIT),
|
2020-02-20 20:32:06 -06:00
|
|
|
|
LintId::of(&float_literal::LOSSY_FLOAT_LITERAL),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&implicit_return::IMPLICIT_RETURN),
|
|
|
|
|
LintId::of(&indexing_slicing::INDEXING_SLICING),
|
|
|
|
|
LintId::of(&inherent_impl::MULTIPLE_INHERENT_IMPL),
|
|
|
|
|
LintId::of(&integer_division::INTEGER_DIVISION),
|
2019-11-16 08:55:00 -06:00
|
|
|
|
LintId::of(&let_underscore::LET_UNDERSCORE_MUST_USE),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&literal_representation::DECIMAL_LITERAL_REPRESENTATION),
|
2020-03-01 10:36:14 -06:00
|
|
|
|
LintId::of(&matches::REST_PAT_IN_FULLY_BOUND_STRUCTS),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&matches::WILDCARD_ENUM_MATCH_ARM),
|
|
|
|
|
LintId::of(&mem_forget::MEM_FORGET),
|
|
|
|
|
LintId::of(&methods::CLONE_ON_REF_PTR),
|
2020-05-17 10:36:26 -05:00
|
|
|
|
LintId::of(&methods::EXPECT_USED),
|
2020-01-07 02:11:34 -06:00
|
|
|
|
LintId::of(&methods::FILETYPE_IS_FILE),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&methods::GET_UNWRAP),
|
2020-05-17 10:36:26 -05:00
|
|
|
|
LintId::of(&methods::UNWRAP_USED),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&methods::WRONG_PUB_SELF_CONVENTION),
|
|
|
|
|
LintId::of(&misc::FLOAT_CMP_CONST),
|
2020-02-19 17:32:59 -06:00
|
|
|
|
LintId::of(&misc_early::UNNEEDED_FIELD_PATTERN),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&missing_doc::MISSING_DOCS_IN_PRIVATE_ITEMS),
|
|
|
|
|
LintId::of(&missing_inline::MISSING_INLINE_IN_PUBLIC_ITEMS),
|
2019-12-26 06:34:18 -06:00
|
|
|
|
LintId::of(&modulo_arithmetic::MODULO_ARITHMETIC),
|
2020-09-24 07:49:22 -05:00
|
|
|
|
LintId::of(&panic_in_result_fn::PANIC_IN_RESULT_FN),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&panic_unimplemented::PANIC),
|
|
|
|
|
LintId::of(&panic_unimplemented::TODO),
|
|
|
|
|
LintId::of(&panic_unimplemented::UNIMPLEMENTED),
|
|
|
|
|
LintId::of(&panic_unimplemented::UNREACHABLE),
|
2020-07-14 07:59:59 -05:00
|
|
|
|
LintId::of(&pattern_type_mismatch::PATTERN_TYPE_MISMATCH),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&shadow::SHADOW_REUSE),
|
|
|
|
|
LintId::of(&shadow::SHADOW_SAME),
|
|
|
|
|
LintId::of(&strings::STRING_ADD),
|
2020-10-09 05:45:29 -05:00
|
|
|
|
LintId::of(&types::RC_BUFFER),
|
2020-08-28 09:10:16 -05:00
|
|
|
|
LintId::of(&unwrap_in_result::UNWRAP_IN_RESULT),
|
2020-03-26 09:01:03 -05:00
|
|
|
|
LintId::of(&verbose_file_reads::VERBOSE_FILE_READS),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&write::PRINT_STDOUT),
|
|
|
|
|
LintId::of(&write::USE_DEBUG),
|
2016-05-24 11:25:25 -05:00
|
|
|
|
]);
|
|
|
|
|
|
2019-10-10 20:46:22 -05:00
|
|
|
|
store.register_group(true, "clippy::pedantic", Some("clippy_pedantic"), vec![
|
|
|
|
|
LintId::of(&attrs::INLINE_ALWAYS),
|
2020-09-24 07:49:22 -05:00
|
|
|
|
LintId::of(&bit_mask::VERBOSE_BIT_MASK),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&checked_conversions::CHECKED_CONVERSIONS),
|
2019-11-23 10:57:28 -06:00
|
|
|
|
LintId::of(&copies::SAME_FUNCTIONS_IN_IF_CONDITION),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(©_iterator::COPY_ITERATOR),
|
2020-11-05 07:29:48 -06:00
|
|
|
|
LintId::of(&default::DEFAULT_TRAIT_ACCESS),
|
2020-03-07 08:33:27 -06:00
|
|
|
|
LintId::of(&dereference::EXPLICIT_DEREF_METHODS),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&derive::EXPL_IMPL_CLONE_ON_COPY),
|
2020-04-20 13:05:15 -05:00
|
|
|
|
LintId::of(&derive::UNSAFE_DERIVE_DESERIALIZE),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&doc::DOC_MARKDOWN),
|
2019-12-05 18:00:23 -06:00
|
|
|
|
LintId::of(&doc::MISSING_ERRORS_DOC),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&empty_enum::EMPTY_ENUM),
|
|
|
|
|
LintId::of(&enum_variants::MODULE_NAME_REPETITIONS),
|
|
|
|
|
LintId::of(&enum_variants::PUB_ENUM_VARIANT_NAMES),
|
|
|
|
|
LintId::of(&eta_reduction::REDUNDANT_CLOSURE_FOR_METHOD_CALLS),
|
2020-02-01 17:49:52 -06:00
|
|
|
|
LintId::of(&excessive_bools::FN_PARAMS_EXCESSIVE_BOOLS),
|
|
|
|
|
LintId::of(&excessive_bools::STRUCT_EXCESSIVE_BOOLS),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&functions::MUST_USE_CANDIDATE),
|
|
|
|
|
LintId::of(&functions::TOO_MANY_LINES),
|
|
|
|
|
LintId::of(&if_not_else::IF_NOT_ELSE),
|
2020-04-06 13:07:57 -05:00
|
|
|
|
LintId::of(&implicit_saturating_sub::IMPLICIT_SATURATING_SUB),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&infinite_iter::MAYBE_INFINITE_ITER),
|
|
|
|
|
LintId::of(&items_after_statements::ITEMS_AFTER_STATEMENTS),
|
2019-11-12 16:22:53 -06:00
|
|
|
|
LintId::of(&large_stack_arrays::LARGE_STACK_ARRAYS),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&literal_representation::LARGE_DIGIT_GROUPS),
|
2020-04-04 14:47:16 -05:00
|
|
|
|
LintId::of(&literal_representation::UNREADABLE_LITERAL),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&loops::EXPLICIT_INTO_ITER_LOOP),
|
|
|
|
|
LintId::of(&loops::EXPLICIT_ITER_LOOP),
|
2020-03-05 12:22:17 -06:00
|
|
|
|
LintId::of(¯o_use::MACRO_USE_IMPORTS),
|
2020-11-05 07:29:48 -06:00
|
|
|
|
LintId::of(&manual_ok_or::MANUAL_OK_OR),
|
2020-09-24 07:49:22 -05:00
|
|
|
|
LintId::of(&map_err_ignore::MAP_ERR_IGNORE),
|
2020-05-11 13:23:47 -05:00
|
|
|
|
LintId::of(&match_on_vec_items::MATCH_ON_VEC_ITEMS),
|
2020-04-02 19:36:49 -05:00
|
|
|
|
LintId::of(&matches::MATCH_BOOL),
|
2020-10-28 17:36:07 -05:00
|
|
|
|
LintId::of(&matches::MATCH_SAME_ARMS),
|
2020-05-28 08:45:24 -05:00
|
|
|
|
LintId::of(&matches::MATCH_WILDCARD_FOR_SINGLE_VARIANTS),
|
|
|
|
|
LintId::of(&matches::MATCH_WILD_ERR_ARM),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&matches::SINGLE_MATCH_ELSE),
|
|
|
|
|
LintId::of(&methods::FILTER_MAP),
|
|
|
|
|
LintId::of(&methods::FILTER_MAP_NEXT),
|
|
|
|
|
LintId::of(&methods::FIND_MAP),
|
2020-04-02 22:00:12 -05:00
|
|
|
|
LintId::of(&methods::INEFFICIENT_TO_STRING),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&methods::MAP_FLATTEN),
|
2020-05-17 10:36:26 -05:00
|
|
|
|
LintId::of(&methods::MAP_UNWRAP_OR),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&misc::USED_UNDERSCORE_BINDING),
|
|
|
|
|
LintId::of(&misc_early::UNSEPARATED_LITERAL_SUFFIX),
|
|
|
|
|
LintId::of(&mut_mut::MUT_MUT),
|
|
|
|
|
LintId::of(&needless_continue::NEEDLESS_CONTINUE),
|
|
|
|
|
LintId::of(&needless_pass_by_value::NEEDLESS_PASS_BY_VALUE),
|
|
|
|
|
LintId::of(&non_expressive_names::SIMILAR_NAMES),
|
2020-07-14 07:59:59 -05:00
|
|
|
|
LintId::of(&option_if_let_else::OPTION_IF_LET_ELSE),
|
2020-10-28 17:36:07 -05:00
|
|
|
|
LintId::of(&pass_by_ref_or_value::LARGE_TYPES_PASSED_BY_VALUE),
|
|
|
|
|
LintId::of(&pass_by_ref_or_value::TRIVIALLY_COPY_PASS_BY_REF),
|
2020-07-14 07:59:59 -05:00
|
|
|
|
LintId::of(&ranges::RANGE_MINUS_ONE),
|
2020-01-17 03:15:14 -06:00
|
|
|
|
LintId::of(&ranges::RANGE_PLUS_ONE),
|
2020-11-05 07:29:48 -06:00
|
|
|
|
LintId::of(&ref_option_ref::REF_OPTION_REF),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&shadow::SHADOW_UNRELATED),
|
|
|
|
|
LintId::of(&strings::STRING_ADD_ASSIGN),
|
2020-08-11 08:43:21 -05:00
|
|
|
|
LintId::of(&trait_bounds::TRAIT_DUPLICATION_IN_BOUNDS),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&trait_bounds::TYPE_REPETITION_IN_BOUNDS),
|
|
|
|
|
LintId::of(&types::CAST_LOSSLESS),
|
|
|
|
|
LintId::of(&types::CAST_POSSIBLE_TRUNCATION),
|
|
|
|
|
LintId::of(&types::CAST_POSSIBLE_WRAP),
|
|
|
|
|
LintId::of(&types::CAST_PRECISION_LOSS),
|
2020-06-09 09:36:01 -05:00
|
|
|
|
LintId::of(&types::CAST_PTR_ALIGNMENT),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&types::CAST_SIGN_LOSS),
|
2020-04-02 21:09:30 -05:00
|
|
|
|
LintId::of(&types::IMPLICIT_HASHER),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&types::INVALID_UPCAST_COMPARISONS),
|
2020-04-02 20:22:18 -05:00
|
|
|
|
LintId::of(&types::LET_UNIT_VALUE),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&types::LINKEDLIST),
|
2020-04-01 14:00:49 -05:00
|
|
|
|
LintId::of(&types::OPTION_OPTION),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&unicode::NON_ASCII_LITERAL),
|
|
|
|
|
LintId::of(&unicode::UNICODE_NOT_NFC),
|
2020-06-23 10:05:22 -05:00
|
|
|
|
LintId::of(&unnested_or_patterns::UNNESTED_OR_PATTERNS),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&unused_self::UNUSED_SELF),
|
2020-01-14 06:52:08 -06:00
|
|
|
|
LintId::of(&wildcard_imports::ENUM_GLOB_USE),
|
2020-01-07 10:54:08 -06:00
|
|
|
|
LintId::of(&wildcard_imports::WILDCARD_IMPORTS),
|
2016-05-24 11:25:25 -05:00
|
|
|
|
]);
|
|
|
|
|
|
2019-10-10 20:46:22 -05:00
|
|
|
|
store.register_group(true, "clippy::internal", Some("clippy_internal"), vec![
|
|
|
|
|
LintId::of(&utils::internal_lints::CLIPPY_LINTS_INTERNAL),
|
2020-04-17 07:43:37 -05:00
|
|
|
|
LintId::of(&utils::internal_lints::COLLAPSIBLE_SPAN_LINT_CALLS),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&utils::internal_lints::COMPILER_LINT_FUNCTIONS),
|
2020-02-11 04:11:43 -06:00
|
|
|
|
LintId::of(&utils::internal_lints::DEFAULT_LINT),
|
2020-10-28 17:36:07 -05:00
|
|
|
|
LintId::of(&utils::internal_lints::INVALID_PATHS),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&utils::internal_lints::LINT_WITHOUT_LINT_PASS),
|
2020-09-24 07:49:22 -05:00
|
|
|
|
LintId::of(&utils::internal_lints::MATCH_TYPE_ON_DIAGNOSTIC_ITEM),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&utils::internal_lints::OUTER_EXPN_EXPN_DATA),
|
2019-09-27 00:09:12 -05:00
|
|
|
|
LintId::of(&utils::internal_lints::PRODUCE_ICE),
|
2016-09-01 02:07:37 -05:00
|
|
|
|
]);
|
|
|
|
|
|
2019-10-10 20:46:22 -05:00
|
|
|
|
store.register_group(true, "clippy::all", Some("clippy"), vec![
|
|
|
|
|
LintId::of(&approx_const::APPROX_CONSTANT),
|
|
|
|
|
LintId::of(&assertions_on_constants::ASSERTIONS_ON_CONSTANTS),
|
|
|
|
|
LintId::of(&assign_ops::ASSIGN_OP_PATTERN),
|
|
|
|
|
LintId::of(&assign_ops::MISREFACTORED_ASSIGN_OP),
|
2020-09-10 10:47:07 -05:00
|
|
|
|
LintId::of(&async_yields_async::ASYNC_YIELDS_ASYNC),
|
2020-01-05 18:16:27 -06:00
|
|
|
|
LintId::of(&atomic_ordering::INVALID_ATOMIC_ORDERING),
|
2020-07-14 07:59:59 -05:00
|
|
|
|
LintId::of(&attrs::BLANKET_CLIPPY_RESTRICTION_LINTS),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&attrs::DEPRECATED_CFG_ATTR),
|
|
|
|
|
LintId::of(&attrs::DEPRECATED_SEMVER),
|
2020-04-22 16:01:25 -05:00
|
|
|
|
LintId::of(&attrs::MISMATCHED_TARGET_OS),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&attrs::UNKNOWN_CLIPPY_LINTS),
|
|
|
|
|
LintId::of(&attrs::USELESS_ATTRIBUTE),
|
2020-10-28 17:36:07 -05:00
|
|
|
|
LintId::of(&await_holding_invalid::AWAIT_HOLDING_LOCK),
|
|
|
|
|
LintId::of(&await_holding_invalid::AWAIT_HOLDING_REFCELL_REF),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&bit_mask::BAD_BIT_MASK),
|
|
|
|
|
LintId::of(&bit_mask::INEFFECTIVE_BIT_MASK),
|
|
|
|
|
LintId::of(&blacklisted_name::BLACKLISTED_NAME),
|
2020-05-17 10:36:26 -05:00
|
|
|
|
LintId::of(&blocks_in_if_conditions::BLOCKS_IN_IF_CONDITIONS),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&booleans::LOGIC_BUG),
|
|
|
|
|
LintId::of(&booleans::NONMINIMAL_BOOL),
|
|
|
|
|
LintId::of(&bytecount::NAIVE_BYTECOUNT),
|
|
|
|
|
LintId::of(&collapsible_if::COLLAPSIBLE_IF),
|
|
|
|
|
LintId::of(&comparison_chain::COMPARISON_CHAIN),
|
|
|
|
|
LintId::of(&copies::IFS_SAME_COND),
|
|
|
|
|
LintId::of(&copies::IF_SAME_THEN_ELSE),
|
2020-11-05 07:29:48 -06:00
|
|
|
|
LintId::of(&default::FIELD_REASSIGN_WITH_DEFAULT),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&derive::DERIVE_HASH_XOR_EQ),
|
2020-08-11 08:43:21 -05:00
|
|
|
|
LintId::of(&derive::DERIVE_ORD_XOR_PARTIAL_ORD),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&doc::MISSING_SAFETY_DOC),
|
|
|
|
|
LintId::of(&doc::NEEDLESS_DOCTEST_MAIN),
|
|
|
|
|
LintId::of(&double_comparison::DOUBLE_COMPARISONS),
|
|
|
|
|
LintId::of(&double_parens::DOUBLE_PARENS),
|
|
|
|
|
LintId::of(&drop_forget_ref::DROP_COPY),
|
|
|
|
|
LintId::of(&drop_forget_ref::DROP_REF),
|
|
|
|
|
LintId::of(&drop_forget_ref::FORGET_COPY),
|
|
|
|
|
LintId::of(&drop_forget_ref::FORGET_REF),
|
|
|
|
|
LintId::of(&duration_subsec::DURATION_SUBSEC),
|
|
|
|
|
LintId::of(&entry::MAP_ENTRY),
|
|
|
|
|
LintId::of(&enum_clike::ENUM_CLIKE_UNPORTABLE_VARIANT),
|
|
|
|
|
LintId::of(&enum_variants::ENUM_VARIANT_NAMES),
|
|
|
|
|
LintId::of(&enum_variants::MODULE_INCEPTION),
|
|
|
|
|
LintId::of(&eq_op::EQ_OP),
|
|
|
|
|
LintId::of(&eq_op::OP_REF),
|
|
|
|
|
LintId::of(&erasing_op::ERASING_OP),
|
|
|
|
|
LintId::of(&escape::BOXED_LOCAL),
|
|
|
|
|
LintId::of(&eta_reduction::REDUNDANT_CLOSURE),
|
|
|
|
|
LintId::of(&eval_order_dependence::DIVERGING_SUB_EXPRESSION),
|
|
|
|
|
LintId::of(&eval_order_dependence::EVAL_ORDER_DEPENDENCE),
|
|
|
|
|
LintId::of(&explicit_write::EXPLICIT_WRITE),
|
2020-08-28 09:10:16 -05:00
|
|
|
|
LintId::of(&float_equality_without_abs::FLOAT_EQUALITY_WITHOUT_ABS),
|
2020-02-20 20:32:06 -06:00
|
|
|
|
LintId::of(&float_literal::EXCESSIVE_PRECISION),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&format::USELESS_FORMAT),
|
|
|
|
|
LintId::of(&formatting::POSSIBLE_MISSING_COMMA),
|
|
|
|
|
LintId::of(&formatting::SUSPICIOUS_ASSIGNMENT_FORMATTING),
|
|
|
|
|
LintId::of(&formatting::SUSPICIOUS_ELSE_FORMATTING),
|
|
|
|
|
LintId::of(&formatting::SUSPICIOUS_UNARY_OP_FORMATTING),
|
|
|
|
|
LintId::of(&functions::DOUBLE_MUST_USE),
|
|
|
|
|
LintId::of(&functions::MUST_USE_UNIT),
|
|
|
|
|
LintId::of(&functions::NOT_UNSAFE_PTR_ARG_DEREF),
|
2020-10-23 15:16:59 -05:00
|
|
|
|
LintId::of(&functions::RESULT_UNIT_ERR),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&functions::TOO_MANY_ARGUMENTS),
|
|
|
|
|
LintId::of(&get_last_with_len::GET_LAST_WITH_LEN),
|
|
|
|
|
LintId::of(&identity_op::IDENTITY_OP),
|
2020-03-05 07:36:19 -06:00
|
|
|
|
LintId::of(&if_let_mutex::IF_LET_MUTEX),
|
2020-01-10 15:02:02 -06:00
|
|
|
|
LintId::of(&if_let_some_result::IF_LET_SOME_RESULT),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&indexing_slicing::OUT_OF_BOUNDS_INDEXING),
|
|
|
|
|
LintId::of(&infinite_iter::INFINITE_ITER),
|
|
|
|
|
LintId::of(&inherent_to_string::INHERENT_TO_STRING),
|
|
|
|
|
LintId::of(&inherent_to_string::INHERENT_TO_STRING_SHADOW_DISPLAY),
|
|
|
|
|
LintId::of(&inline_fn_without_body::INLINE_FN_WITHOUT_BODY),
|
|
|
|
|
LintId::of(&int_plus_one::INT_PLUS_ONE),
|
2020-02-29 11:41:18 -06:00
|
|
|
|
LintId::of(&large_const_arrays::LARGE_CONST_ARRAYS),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&large_enum_variant::LARGE_ENUM_VARIANT),
|
2020-11-05 07:29:48 -06:00
|
|
|
|
LintId::of(&len_zero::COMPARISON_TO_EMPTY),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&len_zero::LEN_WITHOUT_IS_EMPTY),
|
|
|
|
|
LintId::of(&len_zero::LEN_ZERO),
|
2020-01-27 08:34:30 -06:00
|
|
|
|
LintId::of(&let_underscore::LET_UNDERSCORE_LOCK),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&lifetimes::EXTRA_UNUSED_LIFETIMES),
|
|
|
|
|
LintId::of(&lifetimes::NEEDLESS_LIFETIMES),
|
|
|
|
|
LintId::of(&literal_representation::INCONSISTENT_DIGIT_GROUPING),
|
|
|
|
|
LintId::of(&literal_representation::MISTYPED_LITERAL_SUFFIXES),
|
2020-10-28 17:36:07 -05:00
|
|
|
|
LintId::of(&literal_representation::UNUSUAL_BYTE_GROUPINGS),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&loops::EMPTY_LOOP),
|
|
|
|
|
LintId::of(&loops::EXPLICIT_COUNTER_LOOP),
|
|
|
|
|
LintId::of(&loops::FOR_KV_MAP),
|
2020-05-17 10:36:26 -05:00
|
|
|
|
LintId::of(&loops::FOR_LOOPS_OVER_FALLIBLES),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&loops::ITER_NEXT_LOOP),
|
|
|
|
|
LintId::of(&loops::MANUAL_MEMCPY),
|
|
|
|
|
LintId::of(&loops::MUT_RANGE_BOUND),
|
|
|
|
|
LintId::of(&loops::NEEDLESS_COLLECT),
|
|
|
|
|
LintId::of(&loops::NEEDLESS_RANGE_LOOP),
|
|
|
|
|
LintId::of(&loops::NEVER_LOOP),
|
2020-08-11 08:43:21 -05:00
|
|
|
|
LintId::of(&loops::SAME_ITEM_PUSH),
|
2020-10-28 17:36:07 -05:00
|
|
|
|
LintId::of(&loops::SINGLE_ELEMENT_LOOP),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&loops::WHILE_IMMUTABLE_CONDITION),
|
|
|
|
|
LintId::of(&loops::WHILE_LET_LOOP),
|
|
|
|
|
LintId::of(&loops::WHILE_LET_ON_ITERATOR),
|
|
|
|
|
LintId::of(&main_recursion::MAIN_RECURSION),
|
2020-05-11 13:23:47 -05:00
|
|
|
|
LintId::of(&manual_async_fn::MANUAL_ASYNC_FN),
|
|
|
|
|
LintId::of(&manual_non_exhaustive::MANUAL_NON_EXHAUSTIVE),
|
2020-09-24 07:49:22 -05:00
|
|
|
|
LintId::of(&manual_strip::MANUAL_STRIP),
|
2020-10-23 15:16:59 -05:00
|
|
|
|
LintId::of(&manual_unwrap_or::MANUAL_UNWRAP_OR),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&map_clone::MAP_CLONE),
|
2020-07-14 07:59:59 -05:00
|
|
|
|
LintId::of(&map_identity::MAP_IDENTITY),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&map_unit_fn::OPTION_MAP_UNIT_FN),
|
|
|
|
|
LintId::of(&map_unit_fn::RESULT_MAP_UNIT_FN),
|
2020-01-19 04:07:13 -06:00
|
|
|
|
LintId::of(&matches::INFALLIBLE_DESTRUCTURING_MATCH),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&matches::MATCH_AS_REF),
|
2020-07-14 07:59:59 -05:00
|
|
|
|
LintId::of(&matches::MATCH_LIKE_MATCHES_MACRO),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&matches::MATCH_OVERLAPPING_ARM),
|
|
|
|
|
LintId::of(&matches::MATCH_REF_PATS),
|
2020-01-15 00:56:56 -06:00
|
|
|
|
LintId::of(&matches::MATCH_SINGLE_BINDING),
|
2020-07-14 07:59:59 -05:00
|
|
|
|
LintId::of(&matches::REDUNDANT_PATTERN_MATCHING),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&matches::SINGLE_MATCH),
|
2020-01-05 08:05:16 -06:00
|
|
|
|
LintId::of(&matches::WILDCARD_IN_OR_PATTERNS),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&mem_discriminant::MEM_DISCRIMINANT_NON_ENUM),
|
|
|
|
|
LintId::of(&mem_replace::MEM_REPLACE_OPTION_WITH_NONE),
|
2019-12-19 00:15:55 -06:00
|
|
|
|
LintId::of(&mem_replace::MEM_REPLACE_WITH_DEFAULT),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&mem_replace::MEM_REPLACE_WITH_UNINIT),
|
2020-05-17 10:36:26 -05:00
|
|
|
|
LintId::of(&methods::BIND_INSTEAD_OF_MAP),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&methods::CHARS_LAST_CMP),
|
|
|
|
|
LintId::of(&methods::CHARS_NEXT_CMP),
|
|
|
|
|
LintId::of(&methods::CLONE_DOUBLE_REF),
|
|
|
|
|
LintId::of(&methods::CLONE_ON_COPY),
|
|
|
|
|
LintId::of(&methods::EXPECT_FUN_CALL),
|
|
|
|
|
LintId::of(&methods::FILTER_NEXT),
|
|
|
|
|
LintId::of(&methods::FLAT_MAP_IDENTITY),
|
2020-11-05 07:29:48 -06:00
|
|
|
|
LintId::of(&methods::FROM_ITER_INSTEAD_OF_COLLECT),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&methods::INTO_ITER_ON_REF),
|
2019-12-18 10:59:43 -06:00
|
|
|
|
LintId::of(&methods::ITERATOR_STEP_BY_ZERO),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&methods::ITER_CLONED_COLLECT),
|
2020-06-09 09:36:01 -05:00
|
|
|
|
LintId::of(&methods::ITER_NEXT_SLICE),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&methods::ITER_NTH),
|
2019-12-28 16:37:23 -06:00
|
|
|
|
LintId::of(&methods::ITER_NTH_ZERO),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&methods::ITER_SKIP_NEXT),
|
|
|
|
|
LintId::of(&methods::MANUAL_SATURATING_ARITHMETIC),
|
2020-11-05 07:29:48 -06:00
|
|
|
|
LintId::of(&methods::MAP_COLLECT_RESULT_UNIT),
|
2020-04-09 12:38:20 -05:00
|
|
|
|
LintId::of(&methods::NEW_RET_NO_SELF),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&methods::OK_EXPECT),
|
2019-12-22 22:48:15 -06:00
|
|
|
|
LintId::of(&methods::OPTION_AS_REF_DEREF),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&methods::OPTION_MAP_OR_NONE),
|
|
|
|
|
LintId::of(&methods::OR_FUN_CALL),
|
2020-04-04 01:59:52 -05:00
|
|
|
|
LintId::of(&methods::RESULT_MAP_OR_INTO_OPTION),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&methods::SEARCH_IS_SOME),
|
|
|
|
|
LintId::of(&methods::SHOULD_IMPLEMENT_TRAIT),
|
2020-11-05 07:29:48 -06:00
|
|
|
|
LintId::of(&methods::SINGLE_CHAR_ADD_STR),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&methods::SINGLE_CHAR_PATTERN),
|
2020-01-19 19:54:54 -06:00
|
|
|
|
LintId::of(&methods::SKIP_WHILE_NEXT),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&methods::STRING_EXTEND_CHARS),
|
|
|
|
|
LintId::of(&methods::SUSPICIOUS_MAP),
|
|
|
|
|
LintId::of(&methods::UNINIT_ASSUMED_INIT),
|
|
|
|
|
LintId::of(&methods::UNNECESSARY_FILTER_MAP),
|
|
|
|
|
LintId::of(&methods::UNNECESSARY_FOLD),
|
2020-08-28 09:10:16 -05:00
|
|
|
|
LintId::of(&methods::UNNECESSARY_LAZY_EVALUATIONS),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&methods::USELESS_ASREF),
|
|
|
|
|
LintId::of(&methods::WRONG_SELF_CONVENTION),
|
2019-11-14 13:18:24 -06:00
|
|
|
|
LintId::of(&methods::ZST_OFFSET),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&minmax::MIN_MAX),
|
|
|
|
|
LintId::of(&misc::CMP_NAN),
|
|
|
|
|
LintId::of(&misc::CMP_OWNED),
|
|
|
|
|
LintId::of(&misc::FLOAT_CMP),
|
|
|
|
|
LintId::of(&misc::MODULO_ONE),
|
|
|
|
|
LintId::of(&misc::SHORT_CIRCUIT_STATEMENT),
|
|
|
|
|
LintId::of(&misc::TOPLEVEL_REF_ARG),
|
|
|
|
|
LintId::of(&misc::ZERO_PTR),
|
|
|
|
|
LintId::of(&misc_early::BUILTIN_TYPE_SHADOW),
|
|
|
|
|
LintId::of(&misc_early::DOUBLE_NEG),
|
|
|
|
|
LintId::of(&misc_early::DUPLICATE_UNDERSCORE_ARGUMENT),
|
|
|
|
|
LintId::of(&misc_early::MIXED_CASE_HEX_LITERALS),
|
|
|
|
|
LintId::of(&misc_early::REDUNDANT_PATTERN),
|
|
|
|
|
LintId::of(&misc_early::UNNEEDED_WILDCARD_PATTERN),
|
|
|
|
|
LintId::of(&misc_early::ZERO_PREFIXED_LITERAL),
|
2019-12-06 12:45:33 -06:00
|
|
|
|
LintId::of(&mut_key::MUTABLE_KEY_TYPE),
|
2020-10-28 17:36:07 -05:00
|
|
|
|
LintId::of(&mut_mutex_lock::MUT_MUTEX_LOCK),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&mut_reference::UNNECESSARY_MUT_PASSED),
|
|
|
|
|
LintId::of(&mutex_atomic::MUTEX_ATOMIC),
|
2020-08-11 08:43:21 -05:00
|
|
|
|
LintId::of(&needless_arbitrary_self_type::NEEDLESS_ARBITRARY_SELF_TYPE),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&needless_bool::BOOL_COMPARISON),
|
|
|
|
|
LintId::of(&needless_bool::NEEDLESS_BOOL),
|
|
|
|
|
LintId::of(&needless_borrowed_ref::NEEDLESS_BORROWED_REFERENCE),
|
|
|
|
|
LintId::of(&needless_update::NEEDLESS_UPDATE),
|
|
|
|
|
LintId::of(&neg_cmp_op_on_partial_ord::NEG_CMP_OP_ON_PARTIAL_ORD),
|
|
|
|
|
LintId::of(&neg_multiply::NEG_MULTIPLY),
|
|
|
|
|
LintId::of(&new_without_default::NEW_WITHOUT_DEFAULT),
|
|
|
|
|
LintId::of(&no_effect::NO_EFFECT),
|
|
|
|
|
LintId::of(&no_effect::UNNECESSARY_OPERATION),
|
|
|
|
|
LintId::of(&non_copy_const::BORROW_INTERIOR_MUTABLE_CONST),
|
|
|
|
|
LintId::of(&non_copy_const::DECLARE_INTERIOR_MUTABLE_CONST),
|
|
|
|
|
LintId::of(&non_expressive_names::JUST_UNDERSCORES_AND_DIGITS),
|
|
|
|
|
LintId::of(&non_expressive_names::MANY_SINGLE_CHAR_NAMES),
|
|
|
|
|
LintId::of(&open_options::NONSENSICAL_OPEN_OPTIONS),
|
2020-02-08 18:44:35 -06:00
|
|
|
|
LintId::of(&option_env_unwrap::OPTION_ENV_UNWRAP),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&overflow_check_conditional::OVERFLOW_CHECK_CONDITIONAL),
|
|
|
|
|
LintId::of(&partialeq_ne_impl::PARTIALEQ_NE_IMPL),
|
|
|
|
|
LintId::of(&precedence::PRECEDENCE),
|
|
|
|
|
LintId::of(&ptr::CMP_NULL),
|
|
|
|
|
LintId::of(&ptr::MUT_FROM_REF),
|
|
|
|
|
LintId::of(&ptr::PTR_ARG),
|
2020-10-23 15:16:59 -05:00
|
|
|
|
LintId::of(&ptr_eq::PTR_EQ),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&ptr_offset_with_cast::PTR_OFFSET_WITH_CAST),
|
|
|
|
|
LintId::of(&question_mark::QUESTION_MARK),
|
2020-10-28 17:36:07 -05:00
|
|
|
|
LintId::of(&ranges::MANUAL_RANGE_CONTAINS),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&ranges::RANGE_ZIP_WITH_LEN),
|
2020-05-17 10:36:26 -05:00
|
|
|
|
LintId::of(&ranges::REVERSED_EMPTY_RANGES),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&redundant_clone::REDUNDANT_CLONE),
|
2020-07-26 14:07:07 -05:00
|
|
|
|
LintId::of(&redundant_closure_call::REDUNDANT_CLOSURE_CALL),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&redundant_field_names::REDUNDANT_FIELD_NAMES),
|
|
|
|
|
LintId::of(&redundant_static_lifetimes::REDUNDANT_STATIC_LIFETIMES),
|
|
|
|
|
LintId::of(&reference::DEREF_ADDROF),
|
|
|
|
|
LintId::of(&reference::REF_IN_DEREF),
|
|
|
|
|
LintId::of(®ex::INVALID_REGEX),
|
|
|
|
|
LintId::of(®ex::TRIVIAL_REGEX),
|
2020-07-14 07:59:59 -05:00
|
|
|
|
LintId::of(&repeat_once::REPEAT_ONCE),
|
2020-08-28 09:10:16 -05:00
|
|
|
|
LintId::of(&returns::LET_AND_RETURN),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&returns::NEEDLESS_RETURN),
|
2020-08-28 09:10:16 -05:00
|
|
|
|
LintId::of(&self_assignment::SELF_ASSIGNMENT),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&serde_api::SERDE_API_MISUSE),
|
2020-01-29 10:21:29 -06:00
|
|
|
|
LintId::of(&single_component_path_imports::SINGLE_COMPONENT_PATH_IMPORTS),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&slow_vector_initialization::SLOW_VECTOR_INITIALIZATION),
|
2020-08-11 08:43:21 -05:00
|
|
|
|
LintId::of(&stable_sort_primitive::STABLE_SORT_PRIMITIVE),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&suspicious_trait_impl::SUSPICIOUS_ARITHMETIC_IMPL),
|
|
|
|
|
LintId::of(&suspicious_trait_impl::SUSPICIOUS_OP_ASSIGN_IMPL),
|
|
|
|
|
LintId::of(&swap::ALMOST_SWAPPED),
|
|
|
|
|
LintId::of(&swap::MANUAL_SWAP),
|
2019-11-15 09:20:21 -06:00
|
|
|
|
LintId::of(&tabs_in_doc_comments::TABS_IN_DOC_COMMENTS),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&temporary_assignment::TEMPORARY_ASSIGNMENT),
|
2019-11-10 07:12:05 -06:00
|
|
|
|
LintId::of(&to_digit_is_some::TO_DIGIT_IS_SOME),
|
2020-08-28 09:10:16 -05:00
|
|
|
|
LintId::of(&to_string_in_display::TO_STRING_IN_DISPLAY),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&transmute::CROSSPOINTER_TRANSMUTE),
|
2020-08-06 07:11:23 -05:00
|
|
|
|
LintId::of(&transmute::TRANSMUTES_EXPRESSIBLE_AS_PTR_CASTS),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&transmute::TRANSMUTE_BYTES_TO_STR),
|
2020-01-07 17:53:19 -06:00
|
|
|
|
LintId::of(&transmute::TRANSMUTE_FLOAT_TO_INT),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&transmute::TRANSMUTE_INT_TO_BOOL),
|
|
|
|
|
LintId::of(&transmute::TRANSMUTE_INT_TO_CHAR),
|
|
|
|
|
LintId::of(&transmute::TRANSMUTE_INT_TO_FLOAT),
|
|
|
|
|
LintId::of(&transmute::TRANSMUTE_PTR_TO_PTR),
|
|
|
|
|
LintId::of(&transmute::TRANSMUTE_PTR_TO_REF),
|
|
|
|
|
LintId::of(&transmute::UNSOUND_COLLECTION_TRANSMUTE),
|
|
|
|
|
LintId::of(&transmute::WRONG_TRANSMUTE),
|
|
|
|
|
LintId::of(&transmuting_null::TRANSMUTING_NULL),
|
|
|
|
|
LintId::of(&try_err::TRY_ERR),
|
|
|
|
|
LintId::of(&types::ABSURD_EXTREME_COMPARISONS),
|
|
|
|
|
LintId::of(&types::BORROWED_BOX),
|
|
|
|
|
LintId::of(&types::BOX_VEC),
|
|
|
|
|
LintId::of(&types::CAST_REF_TO_MUT),
|
|
|
|
|
LintId::of(&types::CHAR_LIT_AS_U8),
|
|
|
|
|
LintId::of(&types::FN_TO_NUMERIC_CAST),
|
|
|
|
|
LintId::of(&types::FN_TO_NUMERIC_CAST_WITH_TRUNCATION),
|
2020-03-12 15:41:13 -05:00
|
|
|
|
LintId::of(&types::REDUNDANT_ALLOCATION),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&types::TYPE_COMPLEXITY),
|
|
|
|
|
LintId::of(&types::UNIT_ARG),
|
|
|
|
|
LintId::of(&types::UNIT_CMP),
|
|
|
|
|
LintId::of(&types::UNNECESSARY_CAST),
|
|
|
|
|
LintId::of(&types::VEC_BOX),
|
2020-10-28 17:36:07 -05:00
|
|
|
|
LintId::of(&undropped_manually_drops::UNDROPPED_MANUALLY_DROPS),
|
2020-10-09 05:45:29 -05:00
|
|
|
|
LintId::of(&unicode::INVISIBLE_CHARACTERS),
|
2020-07-26 14:07:07 -05:00
|
|
|
|
LintId::of(&unit_return_expecting_ord::UNIT_RETURN_EXPECTING_ORD),
|
2020-03-11 19:00:00 -05:00
|
|
|
|
LintId::of(&unnamed_address::FN_ADDRESS_COMPARISONS),
|
|
|
|
|
LintId::of(&unnamed_address::VTABLE_ADDRESS_COMPARISONS),
|
2020-06-09 09:36:01 -05:00
|
|
|
|
LintId::of(&unnecessary_sort_by::UNNECESSARY_SORT_BY),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&unsafe_removed_from_name::UNSAFE_REMOVED_FROM_NAME),
|
|
|
|
|
LintId::of(&unused_io_amount::UNUSED_IO_AMOUNT),
|
2020-08-28 09:10:16 -05:00
|
|
|
|
LintId::of(&unused_unit::UNUSED_UNIT),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&unwrap::PANICKING_UNWRAP),
|
|
|
|
|
LintId::of(&unwrap::UNNECESSARY_UNWRAP),
|
2020-05-17 10:36:26 -05:00
|
|
|
|
LintId::of(&useless_conversion::USELESS_CONVERSION),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&vec::USELESS_VEC),
|
2020-06-09 09:36:01 -05:00
|
|
|
|
LintId::of(&vec_resize_to_zero::VEC_RESIZE_TO_ZERO),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&write::PRINTLN_EMPTY_STRING),
|
|
|
|
|
LintId::of(&write::PRINT_LITERAL),
|
|
|
|
|
LintId::of(&write::PRINT_WITH_NEWLINE),
|
|
|
|
|
LintId::of(&write::WRITELN_EMPTY_STRING),
|
|
|
|
|
LintId::of(&write::WRITE_LITERAL),
|
|
|
|
|
LintId::of(&write::WRITE_WITH_NEWLINE),
|
|
|
|
|
LintId::of(&zero_div_zero::ZERO_DIVIDED_BY_ZERO),
|
2018-03-28 08:24:26 -05:00
|
|
|
|
]);
|
|
|
|
|
|
2019-10-10 20:46:22 -05:00
|
|
|
|
store.register_group(true, "clippy::style", Some("clippy_style"), vec![
|
|
|
|
|
LintId::of(&assertions_on_constants::ASSERTIONS_ON_CONSTANTS),
|
|
|
|
|
LintId::of(&assign_ops::ASSIGN_OP_PATTERN),
|
2020-07-14 07:59:59 -05:00
|
|
|
|
LintId::of(&attrs::BLANKET_CLIPPY_RESTRICTION_LINTS),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&attrs::UNKNOWN_CLIPPY_LINTS),
|
|
|
|
|
LintId::of(&blacklisted_name::BLACKLISTED_NAME),
|
2020-05-17 10:36:26 -05:00
|
|
|
|
LintId::of(&blocks_in_if_conditions::BLOCKS_IN_IF_CONDITIONS),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&collapsible_if::COLLAPSIBLE_IF),
|
|
|
|
|
LintId::of(&comparison_chain::COMPARISON_CHAIN),
|
2020-11-05 07:29:48 -06:00
|
|
|
|
LintId::of(&default::FIELD_REASSIGN_WITH_DEFAULT),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&doc::MISSING_SAFETY_DOC),
|
|
|
|
|
LintId::of(&doc::NEEDLESS_DOCTEST_MAIN),
|
|
|
|
|
LintId::of(&enum_variants::ENUM_VARIANT_NAMES),
|
|
|
|
|
LintId::of(&enum_variants::MODULE_INCEPTION),
|
|
|
|
|
LintId::of(&eq_op::OP_REF),
|
|
|
|
|
LintId::of(&eta_reduction::REDUNDANT_CLOSURE),
|
2020-02-20 20:32:06 -06:00
|
|
|
|
LintId::of(&float_literal::EXCESSIVE_PRECISION),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&formatting::SUSPICIOUS_ASSIGNMENT_FORMATTING),
|
|
|
|
|
LintId::of(&formatting::SUSPICIOUS_ELSE_FORMATTING),
|
|
|
|
|
LintId::of(&formatting::SUSPICIOUS_UNARY_OP_FORMATTING),
|
|
|
|
|
LintId::of(&functions::DOUBLE_MUST_USE),
|
|
|
|
|
LintId::of(&functions::MUST_USE_UNIT),
|
2020-10-23 15:16:59 -05:00
|
|
|
|
LintId::of(&functions::RESULT_UNIT_ERR),
|
2020-01-10 15:02:02 -06:00
|
|
|
|
LintId::of(&if_let_some_result::IF_LET_SOME_RESULT),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&inherent_to_string::INHERENT_TO_STRING),
|
2020-11-05 07:29:48 -06:00
|
|
|
|
LintId::of(&len_zero::COMPARISON_TO_EMPTY),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&len_zero::LEN_WITHOUT_IS_EMPTY),
|
|
|
|
|
LintId::of(&len_zero::LEN_ZERO),
|
|
|
|
|
LintId::of(&literal_representation::INCONSISTENT_DIGIT_GROUPING),
|
2020-10-28 17:36:07 -05:00
|
|
|
|
LintId::of(&literal_representation::UNUSUAL_BYTE_GROUPINGS),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&loops::EMPTY_LOOP),
|
|
|
|
|
LintId::of(&loops::FOR_KV_MAP),
|
|
|
|
|
LintId::of(&loops::NEEDLESS_RANGE_LOOP),
|
2020-08-11 08:43:21 -05:00
|
|
|
|
LintId::of(&loops::SAME_ITEM_PUSH),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&loops::WHILE_LET_ON_ITERATOR),
|
|
|
|
|
LintId::of(&main_recursion::MAIN_RECURSION),
|
2020-05-11 13:23:47 -05:00
|
|
|
|
LintId::of(&manual_async_fn::MANUAL_ASYNC_FN),
|
|
|
|
|
LintId::of(&manual_non_exhaustive::MANUAL_NON_EXHAUSTIVE),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&map_clone::MAP_CLONE),
|
2020-01-19 04:07:13 -06:00
|
|
|
|
LintId::of(&matches::INFALLIBLE_DESTRUCTURING_MATCH),
|
2020-07-14 07:59:59 -05:00
|
|
|
|
LintId::of(&matches::MATCH_LIKE_MATCHES_MACRO),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&matches::MATCH_OVERLAPPING_ARM),
|
|
|
|
|
LintId::of(&matches::MATCH_REF_PATS),
|
2020-07-14 07:59:59 -05:00
|
|
|
|
LintId::of(&matches::REDUNDANT_PATTERN_MATCHING),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&matches::SINGLE_MATCH),
|
|
|
|
|
LintId::of(&mem_replace::MEM_REPLACE_OPTION_WITH_NONE),
|
2019-12-19 00:15:55 -06:00
|
|
|
|
LintId::of(&mem_replace::MEM_REPLACE_WITH_DEFAULT),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&methods::CHARS_LAST_CMP),
|
2020-02-12 19:03:49 -06:00
|
|
|
|
LintId::of(&methods::CHARS_NEXT_CMP),
|
2020-11-05 07:29:48 -06:00
|
|
|
|
LintId::of(&methods::FROM_ITER_INSTEAD_OF_COLLECT),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&methods::INTO_ITER_ON_REF),
|
|
|
|
|
LintId::of(&methods::ITER_CLONED_COLLECT),
|
2020-06-09 09:36:01 -05:00
|
|
|
|
LintId::of(&methods::ITER_NEXT_SLICE),
|
2019-12-28 16:37:23 -06:00
|
|
|
|
LintId::of(&methods::ITER_NTH_ZERO),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&methods::ITER_SKIP_NEXT),
|
|
|
|
|
LintId::of(&methods::MANUAL_SATURATING_ARITHMETIC),
|
2020-11-05 07:29:48 -06:00
|
|
|
|
LintId::of(&methods::MAP_COLLECT_RESULT_UNIT),
|
2020-04-09 12:38:20 -05:00
|
|
|
|
LintId::of(&methods::NEW_RET_NO_SELF),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&methods::OK_EXPECT),
|
|
|
|
|
LintId::of(&methods::OPTION_MAP_OR_NONE),
|
2020-04-04 01:59:52 -05:00
|
|
|
|
LintId::of(&methods::RESULT_MAP_OR_INTO_OPTION),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&methods::SHOULD_IMPLEMENT_TRAIT),
|
2020-11-05 07:29:48 -06:00
|
|
|
|
LintId::of(&methods::SINGLE_CHAR_ADD_STR),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&methods::STRING_EXTEND_CHARS),
|
|
|
|
|
LintId::of(&methods::UNNECESSARY_FOLD),
|
2020-08-28 09:10:16 -05:00
|
|
|
|
LintId::of(&methods::UNNECESSARY_LAZY_EVALUATIONS),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&methods::WRONG_SELF_CONVENTION),
|
|
|
|
|
LintId::of(&misc::TOPLEVEL_REF_ARG),
|
|
|
|
|
LintId::of(&misc::ZERO_PTR),
|
|
|
|
|
LintId::of(&misc_early::BUILTIN_TYPE_SHADOW),
|
|
|
|
|
LintId::of(&misc_early::DOUBLE_NEG),
|
|
|
|
|
LintId::of(&misc_early::DUPLICATE_UNDERSCORE_ARGUMENT),
|
|
|
|
|
LintId::of(&misc_early::MIXED_CASE_HEX_LITERALS),
|
|
|
|
|
LintId::of(&misc_early::REDUNDANT_PATTERN),
|
2020-10-28 17:36:07 -05:00
|
|
|
|
LintId::of(&mut_mutex_lock::MUT_MUTEX_LOCK),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&mut_reference::UNNECESSARY_MUT_PASSED),
|
|
|
|
|
LintId::of(&neg_multiply::NEG_MULTIPLY),
|
|
|
|
|
LintId::of(&new_without_default::NEW_WITHOUT_DEFAULT),
|
2020-10-09 05:45:29 -05:00
|
|
|
|
LintId::of(&non_copy_const::BORROW_INTERIOR_MUTABLE_CONST),
|
|
|
|
|
LintId::of(&non_copy_const::DECLARE_INTERIOR_MUTABLE_CONST),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&non_expressive_names::JUST_UNDERSCORES_AND_DIGITS),
|
|
|
|
|
LintId::of(&non_expressive_names::MANY_SINGLE_CHAR_NAMES),
|
|
|
|
|
LintId::of(&ptr::CMP_NULL),
|
|
|
|
|
LintId::of(&ptr::PTR_ARG),
|
2020-10-23 15:16:59 -05:00
|
|
|
|
LintId::of(&ptr_eq::PTR_EQ),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&question_mark::QUESTION_MARK),
|
2020-10-28 17:36:07 -05:00
|
|
|
|
LintId::of(&ranges::MANUAL_RANGE_CONTAINS),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&redundant_field_names::REDUNDANT_FIELD_NAMES),
|
|
|
|
|
LintId::of(&redundant_static_lifetimes::REDUNDANT_STATIC_LIFETIMES),
|
|
|
|
|
LintId::of(®ex::TRIVIAL_REGEX),
|
2020-08-28 09:10:16 -05:00
|
|
|
|
LintId::of(&returns::LET_AND_RETURN),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&returns::NEEDLESS_RETURN),
|
2020-01-29 10:21:29 -06:00
|
|
|
|
LintId::of(&single_component_path_imports::SINGLE_COMPONENT_PATH_IMPORTS),
|
2019-11-15 09:20:21 -06:00
|
|
|
|
LintId::of(&tabs_in_doc_comments::TABS_IN_DOC_COMMENTS),
|
2019-11-10 07:12:05 -06:00
|
|
|
|
LintId::of(&to_digit_is_some::TO_DIGIT_IS_SOME),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&try_err::TRY_ERR),
|
|
|
|
|
LintId::of(&types::FN_TO_NUMERIC_CAST),
|
|
|
|
|
LintId::of(&types::FN_TO_NUMERIC_CAST_WITH_TRUNCATION),
|
|
|
|
|
LintId::of(&unsafe_removed_from_name::UNSAFE_REMOVED_FROM_NAME),
|
2020-08-28 09:10:16 -05:00
|
|
|
|
LintId::of(&unused_unit::UNUSED_UNIT),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&write::PRINTLN_EMPTY_STRING),
|
|
|
|
|
LintId::of(&write::PRINT_LITERAL),
|
|
|
|
|
LintId::of(&write::PRINT_WITH_NEWLINE),
|
|
|
|
|
LintId::of(&write::WRITELN_EMPTY_STRING),
|
|
|
|
|
LintId::of(&write::WRITE_LITERAL),
|
|
|
|
|
LintId::of(&write::WRITE_WITH_NEWLINE),
|
2018-03-28 08:24:26 -05:00
|
|
|
|
]);
|
|
|
|
|
|
2019-10-10 20:46:22 -05:00
|
|
|
|
store.register_group(true, "clippy::complexity", Some("clippy_complexity"), vec![
|
|
|
|
|
LintId::of(&assign_ops::MISREFACTORED_ASSIGN_OP),
|
|
|
|
|
LintId::of(&attrs::DEPRECATED_CFG_ATTR),
|
|
|
|
|
LintId::of(&booleans::NONMINIMAL_BOOL),
|
|
|
|
|
LintId::of(&double_comparison::DOUBLE_COMPARISONS),
|
|
|
|
|
LintId::of(&double_parens::DOUBLE_PARENS),
|
|
|
|
|
LintId::of(&duration_subsec::DURATION_SUBSEC),
|
|
|
|
|
LintId::of(&eval_order_dependence::DIVERGING_SUB_EXPRESSION),
|
|
|
|
|
LintId::of(&eval_order_dependence::EVAL_ORDER_DEPENDENCE),
|
|
|
|
|
LintId::of(&explicit_write::EXPLICIT_WRITE),
|
|
|
|
|
LintId::of(&format::USELESS_FORMAT),
|
|
|
|
|
LintId::of(&functions::TOO_MANY_ARGUMENTS),
|
|
|
|
|
LintId::of(&get_last_with_len::GET_LAST_WITH_LEN),
|
|
|
|
|
LintId::of(&identity_op::IDENTITY_OP),
|
|
|
|
|
LintId::of(&int_plus_one::INT_PLUS_ONE),
|
|
|
|
|
LintId::of(&lifetimes::EXTRA_UNUSED_LIFETIMES),
|
|
|
|
|
LintId::of(&lifetimes::NEEDLESS_LIFETIMES),
|
|
|
|
|
LintId::of(&loops::EXPLICIT_COUNTER_LOOP),
|
|
|
|
|
LintId::of(&loops::MUT_RANGE_BOUND),
|
2020-10-28 17:36:07 -05:00
|
|
|
|
LintId::of(&loops::SINGLE_ELEMENT_LOOP),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&loops::WHILE_LET_LOOP),
|
2020-09-24 07:49:22 -05:00
|
|
|
|
LintId::of(&manual_strip::MANUAL_STRIP),
|
2020-10-23 15:16:59 -05:00
|
|
|
|
LintId::of(&manual_unwrap_or::MANUAL_UNWRAP_OR),
|
2020-07-14 07:59:59 -05:00
|
|
|
|
LintId::of(&map_identity::MAP_IDENTITY),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&map_unit_fn::OPTION_MAP_UNIT_FN),
|
|
|
|
|
LintId::of(&map_unit_fn::RESULT_MAP_UNIT_FN),
|
|
|
|
|
LintId::of(&matches::MATCH_AS_REF),
|
2020-01-15 00:56:56 -06:00
|
|
|
|
LintId::of(&matches::MATCH_SINGLE_BINDING),
|
2020-01-05 08:05:16 -06:00
|
|
|
|
LintId::of(&matches::WILDCARD_IN_OR_PATTERNS),
|
2020-05-17 10:36:26 -05:00
|
|
|
|
LintId::of(&methods::BIND_INSTEAD_OF_MAP),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&methods::CLONE_ON_COPY),
|
|
|
|
|
LintId::of(&methods::FILTER_NEXT),
|
|
|
|
|
LintId::of(&methods::FLAT_MAP_IDENTITY),
|
2019-12-22 22:48:15 -06:00
|
|
|
|
LintId::of(&methods::OPTION_AS_REF_DEREF),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&methods::SEARCH_IS_SOME),
|
2020-01-19 19:54:54 -06:00
|
|
|
|
LintId::of(&methods::SKIP_WHILE_NEXT),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&methods::SUSPICIOUS_MAP),
|
|
|
|
|
LintId::of(&methods::UNNECESSARY_FILTER_MAP),
|
|
|
|
|
LintId::of(&methods::USELESS_ASREF),
|
|
|
|
|
LintId::of(&misc::SHORT_CIRCUIT_STATEMENT),
|
|
|
|
|
LintId::of(&misc_early::UNNEEDED_WILDCARD_PATTERN),
|
|
|
|
|
LintId::of(&misc_early::ZERO_PREFIXED_LITERAL),
|
2020-08-11 08:43:21 -05:00
|
|
|
|
LintId::of(&needless_arbitrary_self_type::NEEDLESS_ARBITRARY_SELF_TYPE),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&needless_bool::BOOL_COMPARISON),
|
|
|
|
|
LintId::of(&needless_bool::NEEDLESS_BOOL),
|
|
|
|
|
LintId::of(&needless_borrowed_ref::NEEDLESS_BORROWED_REFERENCE),
|
|
|
|
|
LintId::of(&needless_update::NEEDLESS_UPDATE),
|
|
|
|
|
LintId::of(&neg_cmp_op_on_partial_ord::NEG_CMP_OP_ON_PARTIAL_ORD),
|
|
|
|
|
LintId::of(&no_effect::NO_EFFECT),
|
|
|
|
|
LintId::of(&no_effect::UNNECESSARY_OPERATION),
|
|
|
|
|
LintId::of(&overflow_check_conditional::OVERFLOW_CHECK_CONDITIONAL),
|
|
|
|
|
LintId::of(&partialeq_ne_impl::PARTIALEQ_NE_IMPL),
|
|
|
|
|
LintId::of(&precedence::PRECEDENCE),
|
|
|
|
|
LintId::of(&ptr_offset_with_cast::PTR_OFFSET_WITH_CAST),
|
|
|
|
|
LintId::of(&ranges::RANGE_ZIP_WITH_LEN),
|
2020-07-26 14:07:07 -05:00
|
|
|
|
LintId::of(&redundant_closure_call::REDUNDANT_CLOSURE_CALL),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&reference::DEREF_ADDROF),
|
|
|
|
|
LintId::of(&reference::REF_IN_DEREF),
|
2020-07-14 07:59:59 -05:00
|
|
|
|
LintId::of(&repeat_once::REPEAT_ONCE),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&swap::MANUAL_SWAP),
|
|
|
|
|
LintId::of(&temporary_assignment::TEMPORARY_ASSIGNMENT),
|
|
|
|
|
LintId::of(&transmute::CROSSPOINTER_TRANSMUTE),
|
2020-08-06 07:11:23 -05:00
|
|
|
|
LintId::of(&transmute::TRANSMUTES_EXPRESSIBLE_AS_PTR_CASTS),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&transmute::TRANSMUTE_BYTES_TO_STR),
|
2020-01-07 17:53:19 -06:00
|
|
|
|
LintId::of(&transmute::TRANSMUTE_FLOAT_TO_INT),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&transmute::TRANSMUTE_INT_TO_BOOL),
|
|
|
|
|
LintId::of(&transmute::TRANSMUTE_INT_TO_CHAR),
|
|
|
|
|
LintId::of(&transmute::TRANSMUTE_INT_TO_FLOAT),
|
|
|
|
|
LintId::of(&transmute::TRANSMUTE_PTR_TO_PTR),
|
|
|
|
|
LintId::of(&transmute::TRANSMUTE_PTR_TO_REF),
|
|
|
|
|
LintId::of(&types::BORROWED_BOX),
|
|
|
|
|
LintId::of(&types::CHAR_LIT_AS_U8),
|
|
|
|
|
LintId::of(&types::TYPE_COMPLEXITY),
|
|
|
|
|
LintId::of(&types::UNIT_ARG),
|
|
|
|
|
LintId::of(&types::UNNECESSARY_CAST),
|
|
|
|
|
LintId::of(&types::VEC_BOX),
|
2020-06-09 09:36:01 -05:00
|
|
|
|
LintId::of(&unnecessary_sort_by::UNNECESSARY_SORT_BY),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&unwrap::UNNECESSARY_UNWRAP),
|
2020-05-17 10:36:26 -05:00
|
|
|
|
LintId::of(&useless_conversion::USELESS_CONVERSION),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&zero_div_zero::ZERO_DIVIDED_BY_ZERO),
|
2016-05-24 11:25:25 -05:00
|
|
|
|
]);
|
2018-03-27 10:13:55 -05:00
|
|
|
|
|
2019-10-10 20:46:22 -05:00
|
|
|
|
store.register_group(true, "clippy::correctness", Some("clippy_correctness"), vec![
|
|
|
|
|
LintId::of(&approx_const::APPROX_CONSTANT),
|
2020-09-10 10:47:07 -05:00
|
|
|
|
LintId::of(&async_yields_async::ASYNC_YIELDS_ASYNC),
|
2020-01-05 18:16:27 -06:00
|
|
|
|
LintId::of(&atomic_ordering::INVALID_ATOMIC_ORDERING),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&attrs::DEPRECATED_SEMVER),
|
2020-04-22 16:01:25 -05:00
|
|
|
|
LintId::of(&attrs::MISMATCHED_TARGET_OS),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&attrs::USELESS_ATTRIBUTE),
|
2020-10-28 17:36:07 -05:00
|
|
|
|
LintId::of(&await_holding_invalid::AWAIT_HOLDING_LOCK),
|
|
|
|
|
LintId::of(&await_holding_invalid::AWAIT_HOLDING_REFCELL_REF),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&bit_mask::BAD_BIT_MASK),
|
|
|
|
|
LintId::of(&bit_mask::INEFFECTIVE_BIT_MASK),
|
|
|
|
|
LintId::of(&booleans::LOGIC_BUG),
|
|
|
|
|
LintId::of(&copies::IFS_SAME_COND),
|
|
|
|
|
LintId::of(&copies::IF_SAME_THEN_ELSE),
|
|
|
|
|
LintId::of(&derive::DERIVE_HASH_XOR_EQ),
|
2020-08-11 08:43:21 -05:00
|
|
|
|
LintId::of(&derive::DERIVE_ORD_XOR_PARTIAL_ORD),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&drop_forget_ref::DROP_COPY),
|
|
|
|
|
LintId::of(&drop_forget_ref::DROP_REF),
|
|
|
|
|
LintId::of(&drop_forget_ref::FORGET_COPY),
|
|
|
|
|
LintId::of(&drop_forget_ref::FORGET_REF),
|
|
|
|
|
LintId::of(&enum_clike::ENUM_CLIKE_UNPORTABLE_VARIANT),
|
|
|
|
|
LintId::of(&eq_op::EQ_OP),
|
|
|
|
|
LintId::of(&erasing_op::ERASING_OP),
|
2020-08-28 09:10:16 -05:00
|
|
|
|
LintId::of(&float_equality_without_abs::FLOAT_EQUALITY_WITHOUT_ABS),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&formatting::POSSIBLE_MISSING_COMMA),
|
|
|
|
|
LintId::of(&functions::NOT_UNSAFE_PTR_ARG_DEREF),
|
2020-03-05 07:36:19 -06:00
|
|
|
|
LintId::of(&if_let_mutex::IF_LET_MUTEX),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&indexing_slicing::OUT_OF_BOUNDS_INDEXING),
|
|
|
|
|
LintId::of(&infinite_iter::INFINITE_ITER),
|
|
|
|
|
LintId::of(&inherent_to_string::INHERENT_TO_STRING_SHADOW_DISPLAY),
|
|
|
|
|
LintId::of(&inline_fn_without_body::INLINE_FN_WITHOUT_BODY),
|
2020-01-27 08:34:30 -06:00
|
|
|
|
LintId::of(&let_underscore::LET_UNDERSCORE_LOCK),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&literal_representation::MISTYPED_LITERAL_SUFFIXES),
|
2020-05-17 10:36:26 -05:00
|
|
|
|
LintId::of(&loops::FOR_LOOPS_OVER_FALLIBLES),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&loops::ITER_NEXT_LOOP),
|
|
|
|
|
LintId::of(&loops::NEVER_LOOP),
|
|
|
|
|
LintId::of(&loops::WHILE_IMMUTABLE_CONDITION),
|
|
|
|
|
LintId::of(&mem_discriminant::MEM_DISCRIMINANT_NON_ENUM),
|
|
|
|
|
LintId::of(&mem_replace::MEM_REPLACE_WITH_UNINIT),
|
|
|
|
|
LintId::of(&methods::CLONE_DOUBLE_REF),
|
2019-12-18 10:59:43 -06:00
|
|
|
|
LintId::of(&methods::ITERATOR_STEP_BY_ZERO),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&methods::UNINIT_ASSUMED_INIT),
|
2019-11-14 13:18:24 -06:00
|
|
|
|
LintId::of(&methods::ZST_OFFSET),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&minmax::MIN_MAX),
|
|
|
|
|
LintId::of(&misc::CMP_NAN),
|
|
|
|
|
LintId::of(&misc::FLOAT_CMP),
|
|
|
|
|
LintId::of(&misc::MODULO_ONE),
|
2019-12-06 12:45:33 -06:00
|
|
|
|
LintId::of(&mut_key::MUTABLE_KEY_TYPE),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&open_options::NONSENSICAL_OPEN_OPTIONS),
|
2020-02-08 18:44:35 -06:00
|
|
|
|
LintId::of(&option_env_unwrap::OPTION_ENV_UNWRAP),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&ptr::MUT_FROM_REF),
|
2020-05-17 10:36:26 -05:00
|
|
|
|
LintId::of(&ranges::REVERSED_EMPTY_RANGES),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(®ex::INVALID_REGEX),
|
2020-08-28 09:10:16 -05:00
|
|
|
|
LintId::of(&self_assignment::SELF_ASSIGNMENT),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&serde_api::SERDE_API_MISUSE),
|
|
|
|
|
LintId::of(&suspicious_trait_impl::SUSPICIOUS_ARITHMETIC_IMPL),
|
|
|
|
|
LintId::of(&suspicious_trait_impl::SUSPICIOUS_OP_ASSIGN_IMPL),
|
|
|
|
|
LintId::of(&swap::ALMOST_SWAPPED),
|
2020-08-28 09:10:16 -05:00
|
|
|
|
LintId::of(&to_string_in_display::TO_STRING_IN_DISPLAY),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&transmute::UNSOUND_COLLECTION_TRANSMUTE),
|
|
|
|
|
LintId::of(&transmute::WRONG_TRANSMUTE),
|
|
|
|
|
LintId::of(&transmuting_null::TRANSMUTING_NULL),
|
|
|
|
|
LintId::of(&types::ABSURD_EXTREME_COMPARISONS),
|
|
|
|
|
LintId::of(&types::CAST_REF_TO_MUT),
|
|
|
|
|
LintId::of(&types::UNIT_CMP),
|
2020-10-28 17:36:07 -05:00
|
|
|
|
LintId::of(&undropped_manually_drops::UNDROPPED_MANUALLY_DROPS),
|
2020-10-09 05:45:29 -05:00
|
|
|
|
LintId::of(&unicode::INVISIBLE_CHARACTERS),
|
2020-07-26 14:07:07 -05:00
|
|
|
|
LintId::of(&unit_return_expecting_ord::UNIT_RETURN_EXPECTING_ORD),
|
2020-03-11 19:00:00 -05:00
|
|
|
|
LintId::of(&unnamed_address::FN_ADDRESS_COMPARISONS),
|
|
|
|
|
LintId::of(&unnamed_address::VTABLE_ADDRESS_COMPARISONS),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&unused_io_amount::UNUSED_IO_AMOUNT),
|
|
|
|
|
LintId::of(&unwrap::PANICKING_UNWRAP),
|
2020-06-09 09:36:01 -05:00
|
|
|
|
LintId::of(&vec_resize_to_zero::VEC_RESIZE_TO_ZERO),
|
2018-03-27 10:13:55 -05:00
|
|
|
|
]);
|
|
|
|
|
|
2019-10-10 20:46:22 -05:00
|
|
|
|
store.register_group(true, "clippy::perf", Some("clippy_perf"), vec![
|
|
|
|
|
LintId::of(&bytecount::NAIVE_BYTECOUNT),
|
|
|
|
|
LintId::of(&entry::MAP_ENTRY),
|
|
|
|
|
LintId::of(&escape::BOXED_LOCAL),
|
2020-02-29 11:41:18 -06:00
|
|
|
|
LintId::of(&large_const_arrays::LARGE_CONST_ARRAYS),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&large_enum_variant::LARGE_ENUM_VARIANT),
|
|
|
|
|
LintId::of(&loops::MANUAL_MEMCPY),
|
|
|
|
|
LintId::of(&loops::NEEDLESS_COLLECT),
|
|
|
|
|
LintId::of(&methods::EXPECT_FUN_CALL),
|
|
|
|
|
LintId::of(&methods::ITER_NTH),
|
|
|
|
|
LintId::of(&methods::OR_FUN_CALL),
|
|
|
|
|
LintId::of(&methods::SINGLE_CHAR_PATTERN),
|
|
|
|
|
LintId::of(&misc::CMP_OWNED),
|
|
|
|
|
LintId::of(&mutex_atomic::MUTEX_ATOMIC),
|
|
|
|
|
LintId::of(&redundant_clone::REDUNDANT_CLONE),
|
|
|
|
|
LintId::of(&slow_vector_initialization::SLOW_VECTOR_INITIALIZATION),
|
2020-08-11 08:43:21 -05:00
|
|
|
|
LintId::of(&stable_sort_primitive::STABLE_SORT_PRIMITIVE),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&types::BOX_VEC),
|
2020-03-12 15:41:13 -05:00
|
|
|
|
LintId::of(&types::REDUNDANT_ALLOCATION),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&vec::USELESS_VEC),
|
2018-03-28 08:24:26 -05:00
|
|
|
|
]);
|
|
|
|
|
|
2019-10-10 20:46:22 -05:00
|
|
|
|
store.register_group(true, "clippy::cargo", Some("clippy_cargo"), vec![
|
|
|
|
|
LintId::of(&cargo_common_metadata::CARGO_COMMON_METADATA),
|
|
|
|
|
LintId::of(&multiple_crate_versions::MULTIPLE_CRATE_VERSIONS),
|
|
|
|
|
LintId::of(&wildcard_dependencies::WILDCARD_DEPENDENCIES),
|
2018-04-29 18:20:39 -05:00
|
|
|
|
]);
|
|
|
|
|
|
2019-10-10 20:46:22 -05:00
|
|
|
|
store.register_group(true, "clippy::nursery", Some("clippy_nursery"), vec![
|
|
|
|
|
LintId::of(&attrs::EMPTY_LINE_AFTER_OUTER_ATTR),
|
2020-04-06 17:46:40 -05:00
|
|
|
|
LintId::of(&cognitive_complexity::COGNITIVE_COMPLEXITY),
|
2020-10-09 05:45:29 -05:00
|
|
|
|
LintId::of(&disallowed_method::DISALLOWED_METHOD),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&fallible_impl_from::FALLIBLE_IMPL_FROM),
|
2020-02-23 23:06:55 -06:00
|
|
|
|
LintId::of(&floating_point_arithmetic::IMPRECISE_FLOPS),
|
2020-02-17 14:56:55 -06:00
|
|
|
|
LintId::of(&floating_point_arithmetic::SUBOPTIMAL_FLOPS),
|
2020-04-07 08:39:07 -05:00
|
|
|
|
LintId::of(&future_not_send::FUTURE_NOT_SEND),
|
2020-05-17 10:36:26 -05:00
|
|
|
|
LintId::of(&let_if_seq::USELESS_LET_IF_SEQ),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&missing_const_for_fn::MISSING_CONST_FOR_FN),
|
2020-01-31 03:42:31 -06:00
|
|
|
|
LintId::of(&mutable_debug_assertion::DEBUG_ASSERT_WITH_MUT_CALL),
|
2019-10-10 20:46:22 -05:00
|
|
|
|
LintId::of(&mutex_atomic::MUTEX_INTEGER),
|
|
|
|
|
LintId::of(&needless_borrow::NEEDLESS_BORROW),
|
|
|
|
|
LintId::of(&path_buf_push_overwrite::PATH_BUF_PUSH_OVERWRITE),
|
2020-03-25 12:09:25 -05:00
|
|
|
|
LintId::of(&redundant_pub_crate::REDUNDANT_PUB_CRATE),
|
2020-10-09 05:45:29 -05:00
|
|
|
|
LintId::of(&strings::STRING_LIT_AS_BYTES),
|
2020-03-23 14:08:07 -05:00
|
|
|
|
LintId::of(&transmute::USELESS_TRANSMUTE),
|
2019-11-29 07:50:19 -06:00
|
|
|
|
LintId::of(&use_self::USE_SELF),
|
2018-03-27 10:13:55 -05:00
|
|
|
|
]);
|
2018-12-17 06:58:41 -06:00
|
|
|
|
}
|
2018-12-16 15:49:46 -06:00
|
|
|
|
|
2019-08-12 00:28:07 -05:00
|
|
|
|
#[rustfmt::skip]
|
2020-01-12 00:08:41 -06:00
|
|
|
|
fn register_removed_non_tool_lints(store: &mut rustc_lint::LintStore) {
|
2019-08-12 00:28:07 -05:00
|
|
|
|
store.register_removed(
|
|
|
|
|
"should_assert_eq",
|
|
|
|
|
"`assert!()` will be more flexible with RFC 2011",
|
|
|
|
|
);
|
|
|
|
|
store.register_removed(
|
|
|
|
|
"extend_from_slice",
|
|
|
|
|
"`.extend_from_slice(_)` is a faster way to extend a Vec by a slice",
|
|
|
|
|
);
|
|
|
|
|
store.register_removed(
|
|
|
|
|
"range_step_by_zero",
|
|
|
|
|
"`iterator.step_by(0)` panics nowadays",
|
|
|
|
|
);
|
|
|
|
|
store.register_removed(
|
|
|
|
|
"unstable_as_slice",
|
|
|
|
|
"`Vec::as_slice` has been stabilized in 1.7",
|
|
|
|
|
);
|
|
|
|
|
store.register_removed(
|
|
|
|
|
"unstable_as_mut_slice",
|
|
|
|
|
"`Vec::as_mut_slice` has been stabilized in 1.7",
|
|
|
|
|
);
|
|
|
|
|
store.register_removed(
|
|
|
|
|
"str_to_string",
|
|
|
|
|
"using `str::to_string` is common even today and specialization will likely happen soon",
|
|
|
|
|
);
|
|
|
|
|
store.register_removed(
|
|
|
|
|
"string_to_string",
|
|
|
|
|
"using `string::to_string` is common even today and specialization will likely happen soon",
|
|
|
|
|
);
|
|
|
|
|
store.register_removed(
|
|
|
|
|
"misaligned_transmute",
|
|
|
|
|
"this lint has been split into cast_ptr_alignment and transmute_ptr_to_ptr",
|
|
|
|
|
);
|
|
|
|
|
store.register_removed(
|
|
|
|
|
"assign_ops",
|
|
|
|
|
"using compound assignment operators (e.g., `+=`) is harmless",
|
|
|
|
|
);
|
|
|
|
|
store.register_removed(
|
|
|
|
|
"if_let_redundant_pattern_matching",
|
|
|
|
|
"this lint has been changed to redundant_pattern_matching",
|
|
|
|
|
);
|
|
|
|
|
store.register_removed(
|
|
|
|
|
"unsafe_vector_initialization",
|
|
|
|
|
"the replacement suggested by this lint had substantially different behavior",
|
|
|
|
|
);
|
2020-05-17 10:36:26 -05:00
|
|
|
|
store.register_removed(
|
|
|
|
|
"reverse_range_loop",
|
|
|
|
|
"this lint is now included in reversed_empty_ranges",
|
|
|
|
|
);
|
2019-08-12 00:28:07 -05:00
|
|
|
|
}
|
|
|
|
|
|
2019-02-11 00:59:57 -06:00
|
|
|
|
/// Register renamed lints.
|
|
|
|
|
///
|
|
|
|
|
/// Used in `./src/driver.rs`.
|
2020-01-12 00:08:41 -06:00
|
|
|
|
pub fn register_renamed(ls: &mut rustc_lint::LintStore) {
|
2018-12-17 07:29:19 -06:00
|
|
|
|
ls.register_renamed("clippy::stutter", "clippy::module_name_repetitions");
|
2018-12-17 17:25:49 -06:00
|
|
|
|
ls.register_renamed("clippy::new_without_default_derive", "clippy::new_without_default");
|
2019-02-22 19:19:50 -06:00
|
|
|
|
ls.register_renamed("clippy::cyclomatic_complexity", "clippy::cognitive_complexity");
|
2019-06-13 16:54:05 -05:00
|
|
|
|
ls.register_renamed("clippy::const_static_lifetime", "clippy::redundant_static_lifetimes");
|
2020-05-17 10:36:26 -05:00
|
|
|
|
ls.register_renamed("clippy::option_and_then_some", "clippy::bind_instead_of_map");
|
|
|
|
|
ls.register_renamed("clippy::block_in_if_condition_expr", "clippy::blocks_in_if_conditions");
|
|
|
|
|
ls.register_renamed("clippy::block_in_if_condition_stmt", "clippy::blocks_in_if_conditions");
|
|
|
|
|
ls.register_renamed("clippy::option_map_unwrap_or", "clippy::map_unwrap_or");
|
|
|
|
|
ls.register_renamed("clippy::option_map_unwrap_or_else", "clippy::map_unwrap_or");
|
|
|
|
|
ls.register_renamed("clippy::result_map_unwrap_or_else", "clippy::map_unwrap_or");
|
|
|
|
|
ls.register_renamed("clippy::option_unwrap_used", "clippy::unwrap_used");
|
|
|
|
|
ls.register_renamed("clippy::result_unwrap_used", "clippy::unwrap_used");
|
|
|
|
|
ls.register_renamed("clippy::option_expect_used", "clippy::expect_used");
|
|
|
|
|
ls.register_renamed("clippy::result_expect_used", "clippy::expect_used");
|
|
|
|
|
ls.register_renamed("clippy::for_loop_over_option", "clippy::for_loops_over_fallibles");
|
|
|
|
|
ls.register_renamed("clippy::for_loop_over_result", "clippy::for_loops_over_fallibles");
|
|
|
|
|
ls.register_renamed("clippy::identity_conversion", "clippy::useless_conversion");
|
2020-10-09 05:45:29 -05:00
|
|
|
|
ls.register_renamed("clippy::zero_width_space", "clippy::invisible_characters");
|
2020-11-05 07:29:48 -06:00
|
|
|
|
ls.register_renamed("clippy::single_char_push_str", "clippy::single_char_add_str");
|
2016-05-24 11:25:25 -05:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// only exists to let the dogfood integration test works.
|
|
|
|
|
// Don't run clippy as an executable directly
|
2018-11-17 06:47:27 -06:00
|
|
|
|
#[allow(dead_code)]
|
2016-05-24 11:25:25 -05:00
|
|
|
|
fn main() {
|
|
|
|
|
panic!("Please use the cargo-clippy executable");
|
|
|
|
|
}
|