All notable changes to this project will be documented in this file.
Current beta
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_fn_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
#3931Current stable, released 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