All notable changes to this project will be documented in this file. See Changelog Update if you want to update this document.
Current beta, release 2020-07-16
match_wildcard_for_single_variants
#5582unsafe_derive_deserialize
#5493if_let_mutex
#5332mismatched_target_os
#5506await_holding_lock
#5439match_on_vec_items
#5522manual_async_fn
#5576reversed_empty_ranges
#5583manual_non_exhaustive
#5550match_bool
to pedantic #5408match_wild_err_arm
to pedantic and update help messages. #5622useless_let_if_seq
to nursery. #5599option_and_then_some
and rename to bind_instead_of_map
. #5529identity_conversion
to useless_conversion
. #5568block_in_if_condition_expr
and block_in_if_condition_stmt
into blocks_in_if_conditions
. #5563option_map_unwrap_or
, option_map_unwrap_or_else
and result_map_unwrap_or_else
into map_unwrap_or
. #5563option_unwrap_used
and result_unwrap_used
into unwrap_used
. #5563option_expect_used
and result_expect_used
into expect_used
. #5563for_loop_over_option
and for_loop_over_result
into for_loops_over_fallibles
. #5563useless_conversion
with TryFrom
and TryInto
. #5631unused_unit
. #5592Default
in new_without_default
. #5616while_let_on_iterator
#5525empty_line_after_outer_attr
#5609unnecessary_unwrap
#5558comparison_chain
#5596used_underscore_binding
in await desugaring. #5535borrowed_box
on mutable references. #54911 << 0
in identity_op
. #5602use super::*;
glob imports in wildcard_imports
. #5564doc_markdown
. #5611multiple_crate_versions
. #5636allow
attribute on arguments in ptr_arg
. #5647redundant_field_names
, just_underscores_and_digits
, many_single_char_names
and similar_names
. #5651len
in or_fun_call
. #4429manual_memcpy
. #5536redundant_pattern_matching
for macros. #5511copied()
for mutable references in map_clone
. #5530clone_double_ref
. #5547unnecessary_mut_passed
. #5639unneeded_field_pattern
. #5541Current stable, released 2020-06-04
explicit_deref_methods
#5226implicit_saturating_sub
#5427macro_use_imports
#5230verbose_file_reads
#5272future_not_send
#5423redundant_pub_crate
#5319large_const_arrays
#5248result_map_or_into_option
#5415redundant_allocation
#5349fn_address_comparisons
#5294vtable_address_comparisons
#5294replace_consts
lint #5380cognitive_complexity
to nursery #5428useless_transmute
to nursery #5364inefficient_to_string
to pedantic #5412option_option
to pedantic #5401unreadable_literal
to pedantic #5419let_unit_value
to pedantic #5409trivially_copy_pass_by_ref
to pedantic #5410implicit_hasher
to pedantic #5411cargo clippy --fix -Z unstable-options
to auto-fix lints that support this #5363redundant_clone
also trigger on cases where the cloned value is not consumed. #5304integer_arithmetic
to also disallow bit-shifting #5430option_as_ref_deref
now detects more deref cases #5425large_enum_variant
now report the sizes of the largest and second-largest variants #5466bool_comparison
now also checks for inequality comparisons that can be written more concisely #5365clone_on_copy
to work in method call arguments as well #5441redundant_pattern_matching
now also handles while let
#5483integer_arithmetic
now also lints references of integers #5329float_cmp_const
to also work on arrays #5345map_flatten
when map is called on an Option
#5473many_single_char_names
#5468should_implement_trait
#5437unused_self
#5387redundant_clone
#5453precedence
#5445suspicious_op_assign_impl
#5424needless_lifetimes
#5293redundant_pattern
#5287inconsistent_digit_grouping
#5451question_mark
lint suggestion so that it doesn't add redundant as_ref()
#5481option_map_unit_fn
#5292match_single_binding
when triggered inside a closure #5350new_ret_no_self
#5448option_option
now suggest using a tri-state enum #5403verbose_bit_mask
documentation #5454wildcard_imports
documentation now mentions that use ...::prelude::*
is not linted #5312Released 2020-04-23
imprecise_flops
#4897suboptimal_flops
#4897wildcard_imports
#5029single_component_path_imports
#5058match_single_binding
#5061let_underscore_lock
#5101struct_excessive_bools
#5125fn_params_excessive_bools
#5125option_env_unwrap
#5148lossy_float_literal
#5202rest_pat_in_fully_bound_structs
#5258unneeded_field_pattern
to pedantic group #5200missing_errors_doc
lint also trigger on async
functions #5181approx_constant
#5193question_mark
lint #5266misc_early
lints #5129missing_errors_doc
#5213usize
s #5256iter_nth_zero
Released 2020-03-12
filetype_is_file
#4543let_underscore_must_use
#4823modulo_arithmetic
#4867mem_replace_with_default
#4881mutable_key_type
#4885option_as_ref_deref
#4945wildcard_in_or_patterns
#4960iter_nth_zero
#4966invalid_atomic_ordering
#4999skip_while_next
#5067transmute_float_to_int
from nursery to complexity group #5015range_plus_one
to pedantic group #5057debug_assert_with_mut_call
to nursery group #5106unused_label
#4930unused_io_amount
#5027vec_box
configurable by adding a size threshold #5081cmp_nan
#4910expect_fun_call
#4915redundant_clone
#5017map_clone
#4937replace_consts
#4977let_and_return
#5008eq_op
#5079possible_missing_comma
#5083debug_assert_with_mut_call
#5106let_underscore_must_use
in external macros #5082empty_loop
in no_std
crates #5086option_map_unwrap_or
#4634wildcard_enum_match_arm
#4934cognitive_complexity
#4935decimal_literal_representation
#4956unknown_clippy_lints
#4963explicit_into_iter_loop
#4978useless_attribute
#5022if_let_some_result
#5032empty_enum
, replace_consts
, redundant_clone
, and iterator_step_by_zero
Released 2020-01-30
use_self
to nursery group #4863into_iter_on_array
#4788string_lit_as_bytes
to also trigger when literal has escapes #4808comparison_chain
#4842while_immutable_condition
#4730explicit_counter_loop
#4803must_use_candidate
#4794print_with_newline
and write_with_newline
#4769derive_hash_xor_eq
#4766missing_inline_in_public_items
#4870string_add
#4880float_arithmetic
#4851cast_sign_loss
#4883manual_swap
#4877use_self
#4776const_generics
#4780clippy-driver
without arguments, instead of ICEing #4810Released 2019-12-19
unneeded_wildcard_pattern
#4537needless_doctest_main
#4603suspicious_unary_op_formatting
#4615debug_assert_with_mut_call
#4680unused_self
#4619inefficient_to_string
#4683must_use_unit
#4560must_use_candidate
#4560double_must_use
#4560comparison_chain
#4569unsound_collection_transmute
#4592panic
#4657unreachable
#4657todo
#4657option_expect_used
#4657result_expect_used
#4657redundant_clone
to perf group #4509manual_mul_add
to nursery group #4736unit_cmp
to also work with assert_eq!
, debug_assert_eq!
, assert_ne!
and debug_assert_ne!
#4613integer_arithmetic
to also detect mutating arithmetic like +=
#4585nonminimal_bool
#4568missing_safety_doc
#4611cast_sign_loss
#4614redundant_clone
#4509try_err
#4721toplevel_ref_arg
#4570multiple_inherent_impl
#4593cargo fix --clippy
#4575zero_ptr
#4599explicit_counter_loop
#4691mul_add
#4602assertions_on_constants
#4635use_self
#4671Released 2019-11-07
unused_collect
lint. This is fully covered by rustc's #[must_use]
on collect
#4348type_repetition_in_bounds
to pedantic group #4403cast_lossless
to pedantic group #4539temporary_cstring_as_ptr
now catches more cases #4425use_self
now works in constructors, too #4525cargo_common_metadata
now checks for license files #4518cognitive_complexity
now includes the measured complexity in the warning message #4469block_in_if_*
lints #4458cast_lossless
#4473clone_on_copy
#4411deref_addrof
#4487too_many_lines
#4490new_ret_no_self
#4365manual_swap
#4478missing_const_for_fn
#4450extra_unused_lifetimes
#4477inherent_to_string
#4460map_entry
#4495unused_unit
#4445redundant_pattern
#4489wrong_self_convention
#4369cargo fix --clippy
#4558redundant_pattern_matching
#4352explicit_write
#4544or_fun_call
#4522match_as_ref
#4446unnecessary_fold_span
#4382unseparated_literal_suffix
#4401char_lit_as_u8
#4418Released 2019-09-26
{unnnecessary,panicking}_unwrap
out of nursery #4307use_self
lint to suggest uses of Self::Variant
#4308let_unit
#4337pub_enum_variant_names
and enum_variant_names
#4345cast_ptr_alignment
#4257string_lit_as_bytes
#4233needless_lifetimes
#4266float_cmp
#4275needless_return
#4274match_same_arms
#4246needless_bool
#4335cast_ptr_alignment
#4257single_char_literal
#4361len_zero
#4314implicit_hasher
#4268trivially_copy_pass_by_ref
#4250Released 2019-08-15
const_static_lifetime
is now called redundant_static_lifetimes
. The lint now covers statics in addition to consts #4162match_same_arms
now warns for all identical arms, instead of only the first one #4102needless_return
now works with void functions #4220redundant_closure
#4190useless_attribute
#4107float_cmp
#4214print_with_newline
and write_with_newline
#4136option_map_unwrap_or_else
and result_map_unwrap_or_else
#4164non_ascii_literal
#4119let_and_return
#4137trivially_copy_pass_by_ref
#4071unreadable_literal
#4099Released 2019-07-04
find_map
, filter_map_next
#4039path_buf_push_overwrite
#3954path_buf_push_overwrite
to the nursery #4013redundant_closure
into redundant_closure
and redundant_closure_for_method_calls
#4110toplevel_ref_arg
lint #4007or_fun_call
pertaining to nested constructors #4084or_fun_call
pertaining to enum variant constructors #4018useless_let_if_seq
pertaining to interior mutability #4035redundant_closure
pertaining to non-function types #4008let_and_return
pertaining to attributes on let
s #4024module_name_repetitions
lint pertaining to attributes #4006assertions_on_constants
pertaining to debug_assert!
#3989map_clone
to suggest .copied()
where applicable #3970 #4043search_is_some
#4049naive_bytecount
#3984while_let_loop
#3975too_many_arguments
#4053cast_lossless
#4021unnecessary_cast
#4026approx_constant
‘s documentation’s “Known problems” section. #4027suspicious_else_formatting
#3960decimal_literal_representation
#3931Released 2019-05-20
drop_bounds
to detect T: Drop
boundsredundant_closure
into redundant_closure
and redundant_closure_for_method_calls
#4110cyclomatic_complexity
to cognitive_complexity
, start work on making lint more practical for Rust codeget_unwrap
to the restriction categoryiter_cloned_collect
cast_lossless
to suggest suffixed literalsprint_with_newline
and write_with_newline
pertaining to raw stringsneedless_range_loop
pertaining to structs without a .iter()
bool_comparison
pertaining to non-bool typesredundant_closure
pertaining to differences in borrowsoption_map_unwrap_or
on non-copy typesmissing_const_for_fn
pertaining to macros and trait method implsneedless_pass_by_value
pertaining to procedural macrosneedless_continue
pertaining to loop labelsboxed_local
pertaining to arguments moved into closuresuse_self
in nested functionsexpect_fun_call
(https://github.com/rust-lang/rust-clippy/pull/3846)explicit_counter_loop
to deal with parenthesizing range variablessingle_char_pattern
to correctly escape single quotesredundant_closure
in macrosReleased 2019-04-10
assertions_on_constants
to detect for example assert!(true)
dbg_macro
to detect uses of the dbg!
macromissing_const_for_fn
that can suggest functions to be made const
too_many_lines
to detect functions with excessive LOC. It can be configured using the too-many-lines-threshold
configuration.wildcard_enum_match_arm
to check for wildcard enum matches using _
redundant_closure
to also work for methods (not only functions)vec_box
, needless_pass_by_value
and implicit_hasher
cast_sign_loss
integer_arithmetic
unit_arg
implicit_return
explicit_write
question_mark
lintcast_lossless
expect_fun_call
needless_bool
needless_range_loop
use_self
while_let_on_iterator
Released 2019-02-26
implicit_return
, vec_box
, cast_ref_to_mut
rust-clippy
repository is now part of the rust-lang
org.stutter
to module_name_repetitions
new_without_default_derive
into new_without_default
lintlarge_digit_groups
from style
group to pedantic
bool_comparison
to check for <
, <=
, >
, >=
, and !=
comparisons against booleansno_effect
to detect writes to constants such as A_CONST.field = 2
redundant_clone
to work on struct fieldssuspicious_else_formatting
to detect if .. {..} {..}
use_self
to work on tuple structs and also in local macrosresult_map_unit_fn
and option_map_unit_fn
implicit_return
use_self
clone_on_copy
doc_markdown
empty_loop
if_same_then_else
infinite_iter
question_mark
useless_asref
wildcard_dependencies
write_with_newline
explicit_write
question_mark
lintget_unwrap
Released 2019-01-17
slow_vector_initialization
, mem_discriminant_non_enum
, redundant_clone
, wildcard_dependencies
, into_iter_on_ref
, into_iter_on_array
, deprecated_cfg_attr
, mem_discriminant_non_enum
, cargo_common_metadata
u128
and i128
to integer related lintsmistyped_literal_suffixes
use_self
missing_comma
new_ret_no_self
possible_missing_comma
integer_arithmetic
in constant itemsneedless_borrow
out_of_bounds_indexing
new_without_default_derive
string_lit_as_bytes
out_of_bounds_indexing
use_self
. It will now also check existential typesredundant_closure_call
bool_comparison
triggering 3 times on on on the same codetrivially_copy_pass_by_ref
to work on trait methodsneedless_range_loop
needless_pass_by_value
from pedantic
group to style
Released 2018-12-06
rustup component add clippy
.redundant_pattern_matching
, unnecessary_filter_map
, unused_unit
, map_flatten
, mem_replace_option_with_none
if_let_redundant_pattern_matching
needless_pass_by_value
when encountering a generic function argument with a lifetime parameterneedless_range_loop
single_char_pattern
when encountering a constant valueassign_op_pattern
boxed_local
on trait implementationscmp_owned
collapsible_if
when conditionals have commentsdouble_parens
excessive_precision
explicit_counter_loop
fn_to_numeric_cast_with_truncation
map_clone
new_ret_no_self
new_without_default
when new
is unsafetype_complexity
when using extern typesuseless_format
wrong_self_convention
excessive_precision
expect_fun_call
get_unwrap
useless_format
fn_to_numeric_cast_with_truncation
lint can be disabled againmanual_memcpy
needless_lifetimes
Released 2018-10-25
assign_ops
lintmistyped_literal_suffixes
, ptr_offset_with_cast
, needless_collect
, copy_iterator
cargo clippy -V
now includes the Clippy commit hash of the Rust Clippy componentimplicit_hasher
println!("{}" a);
default_trait_access
trivially_copy_pass_by_ref
similar_names
redundant_field_name
expect_fun_call
identity_conversion
explicit_counter_loop
range_plus_one
suggestion and false negativeprint_with_newline
/ write_with_newline
: don't warn about string with several \n
s in themuseless_attribute
to also whitelist unused_extern_crates
single_char_pattern
identity_conversion
lintexplicit_iter_loop
and explicit_into_iter_loop
from style
group to pedantic
range_plus_one
and range_minus_one
from nursery
group to complexity
shadow_unrelated
from restriction
group to pedantic
indexing_slicing
from pedantic
group to restriction
Released 2018-09-13
rustup component add clippy-preview
and then cargo clippy
to run Clippy. This should put an end to the continuous nightly upgrades for Clippy users.while let (..) = x.iter()
constructuse_self
trivially_copy_pass_by_ref
useless_attribute
lintprint_literal
use_self
regressionsneg_cmp_op_on_partial_ord
single_char_pattern
unused_lifetimes
to extra_unused_lifetimes
because of naming conflict with new rustc lintclippy::cyclomatic_complexity
instead of clippy(cyclomatic_complexity)
cast_ptr_alignment
, transmute_ptr_to_ptr
, write_literal
, write_with_newline
, writeln_empty_string
print_literal
while_immutable_condition
redundant_field_names
, suspicious_arithmetic_impl
, suspicious_op_assign_impl
question_mark
double_comparisons
, empty_line_after_outer_attr
misaligned_transmute
decimal_literal_representation
else_if_without_else
, option_option
, unit_arg
, unnecessary_fold
unit_expr
needless_pass_by_value
match_as_ref
just_underscores_and_digits
, result_map_unwrap_or_else
, transmute_bytes_to_str
const_static_lifetime
, erasing_op
, fallible_impl_from
, println_empty_string
, useless_asref
explicit_write
, identity_conversion
, implicit_hasher
, invalid_ref
, option_map_or_none
, range_minus_one
, range_plus_one
, transmute_int_to_bool
, transmute_int_to_char
, transmute_int_to_float
mut_range_bound
int_plus_one
chars_last_cmp
needless_borrow
, ptr_arg
,clone_on_ref_ptr
manual_memcpy
cast_lossless
no longer has redundant parentheses in its suggestionsunit_expr
infinite_iter
, maybe_infinite_iter
, cast_lossless
use_self
triggering inside derivescargo clippy --all
naive_bytecount
use_self
unreadable_literal
, inconsistent_digit_grouping
, large_digit_groups
inline_always
panic_params
cargo clippy
crashing on dylib
projectsnested_while_let
and never_loop
doc_markdown
lint.range_step_by_zero
iterator_step_by_zero
needless_borrowed_reference
AsRef
/AsMut
arguments in wrong_self_convention
needless_continue
op_ref
cargo clippy
on 64 bit windows systemszero_ptr
, never_loop
, mut_from_ref
large_enum_variant
explicit_into_iter_loop
provides suggestionsCargo.toml
&&mut
by &ref
for (_, x) in &mut hash_map
-> for x in hash_map.values_mut()
unused_io_amount
, forget_ref
, short_circuit_statement
wrong_self_convention
deref_addrof
, double_parens
, pub_enum_variant_names
new_without_default
absurd_extreme_comparisons
string_extend_chars
get_unwrap
--sysroot
, which broke cargo clippy
cargo clippy
defines a cargo-clippy
feature. This was previously added for a short time under the name clippy
but removed for compatibility.cargo clippy --help
is more helping (and less helpful :smile:)if_let_redundant_pattern_matching
, partialeq_ne_impl
iter_skip_next
option_map_unwrap_or
and option_map_unwrap_or_else
are now allowed by default.explicit_into_iter_loop
clippy
lint groups: filter_next
, for_loop_over_option
, for_loop_over_result
and match_overlapping_arm
. You should now be able to #[allow/deny]
them individually and they are available directly through cargo clippy
.builtin_type_shadow
zero_prefixed_literal
and 0b
/0o
missing_docs_in_private_items
, zero_prefixed_literal
useless_attribute
useless_attribute
ignores unused_imports
on use
statementsprint_with_newline
, useless_attribute
module_inception
eval_order_dependence
, mixed_case_hex_literals
, unseparated_literal_suffix
too_many_arguments
needless_borrow
clone_on_copy
wrong_self_convention
misrefactored_assign_op
, serde_api_misuse
wrong_transmute
, double_neg
, filter_map
cargo clippy
does not defines the clippy
feature introduced in 0.0.76 anymorecollapsible_if
now considers if let
stutter
and iter_nth
cargo clippy
now automatically defines the clippy
featurenot_unsafe_ptr_arg_deref
cargo-clippy
JSON parsingCLIPPY_DISABLE_DOCS_LINKS
environment variable to deactivate the “for further information visit lint-link” message.useless_let_if_seq
useless_let_if_seq
useless_let_if_seq
invalid_regex
and trivial_regex
can now warn on RegexSet::new
, RegexBuilder::new
and byte regexesused_underscore_binding
has been made Allow
temporarilyunnecessary_operation
cargo clippy
subcommandassign_op_pattern
, assign_ops
, needless_borrow
float_arithmetic
, integer_arithmetic
temporary_cstring_as_ptr
, unsafe_removed_from_name
, and mem_forget
invalid_upcast_comparisons
logic_bug
, nonminimal_bool
match_same_arms
now ignores arms with guardsuseless_vec
now warns on for … in vec![…]
doc_markdown
str_to_string
, string_to_string
, unstable_as_slice
, unstable_as_mut_slice
crosspointer_transmute
many_single_char_names
and similar_names
str
to types considered by len_zero
indexing_slicing
overflow_check_conditional
, unused_label
, new_without_default
needless_range_loop
with globalsredundant_closure_call