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 2021-09-09
- Stabilized
cargo clippy --fix🎉 #7405
rc_mutex#7316nonstandard_macro_braces#7299strlen_on_c_strings#7243self_named_constructors#7403disallowed_script_idents#7400disallowed_type#7315missing_enforced_import_renames#7300extend_with_drain#7270
- Moved
from_iter_instead_of_collecttopedantic#7375 - Added
suspiciousas a new lint group for code that is most likely wrong or useless #7350- Moved
blanket_clippy_restriction_lintstosuspicious - Moved
empty_looptosuspicious - Moved
eval_order_dependencetosuspicious - Moved
float_equality_without_abstosuspicious - Moved
for_loops_over_falliblestosuspicious - Moved
misrefactored_assign_optosuspicious - Moved
mut_range_boundtosuspicious - Moved
mutable_key_typetosuspicious - Moved
suspicious_arithmetic_impltosuspicious - Moved
suspicious_assignment_formattingtosuspicious - Moved
suspicious_else_formattingtosuspicious - Moved
suspicious_maptosuspicious - Moved
suspicious_op_assign_impltosuspicious - Moved
suspicious_unary_op_formattingtosuspicious
- Moved
while_let_on_iterator: Now suggests&mut iterinside closures #7262doc_markdown:wildcard_enum_match_arm,match_wildcard_for_single_variants: Now allows wildcards for enums with unstable or hidden variants #7407redundant_allocation: Now additionally supports theArc<>type #7308blacklisted_name: Now allows blacklisted names in test code #7379redundant_closure: Suggests&mutforFnMut#7437disallowed_method,disallowed_type: The configuration valuesdisallowed-methodanddisallowed-typeno longer require fully qualified paths #7345zst_offset: Fixed lint invocation after it was accidentally suppressed #7396
default_numeric_fallback: No longer lints on float literals as function arguments #7446use_self: No longer lints on type parameters #7288unimplemented: Now ignores theassertanddebug_assertmacros #7439branches_sharing_code: Now always checks for block expressions #7462field_reassign_with_default: No longer triggers in macros #7160redundant_clone: No longer lints on required clones for borrowed data #7346default_numeric_fallback: No longer triggers in external macros #7325needless_bool: No longer lints in macros #7442useless_format: No longer triggers when additional text is being appended #7442assertions_on_constants:cfg!(...)is no longer considered to be a constant #7319
needless_collect: Now show correct lint messages for shadowed values #7289wrong_pub_self_convention: The deprecated message now suggest the correct configuration value #7382semicolon_if_nothing_returned: Allow missing semicolon in blocks with only one expression #7326
- Reworked Clippy's website:
#7279
#7172
- Added applicability information about lints
- Added a link to jump into the implementation
- Improved loading times
- Adapted some styling
- Clippy now uses a lint to generate its documentation #7298
Current stable, released 2021-07-29
ref_binding_to_reference#7105needless_bitwise_bool#7133unused_async#7225manual_str_repeat#7265suspicious_splitn#7292
- Deprecate
pub_enum_variant_namesandwrong_pub_self_conventionin favor of the newavoid-breaking-exported-apiconfig option (see Enhancements) #7187 - Move
inconsistent_struct_constructortopedantic#7193 - Move
needless_borrowtostyle(now warn-by-default) #7254 - Move
suspicious_operation_groupingstonursery#7266 - Move
semicolon_if_nothing_returnedtopedantic#7268
while_let_on_iterator: Now also lints in nested loops #6966single_char_pattern: Now also lints onstrip_prefixandstrip_suffix#7156needless_collect: Now also lints on assignments with type annotations #7163if_then_some_else_none: Now works with the MSRV config #7177- Add
avoid-breaking-exported-apiconfig option for the lintsenum_variant_names,large_types_passed_by_value,trivially_copy_pass_by_ref,unnecessary_wraps,upper_case_acronyms, andwrong_self_convention. We recommend to set this configuration option tofalsebefore a major release (1.0/2.0/...) to clean up the API #7187 needless_collect: Now lints on even more data structures #7188missing_docs_in_private_items: No longer sees#[<name> = "<value>"]like attributes as sufficient documentation #7281needless_collect,short_circuit_statement,unnecessary_operation: Now work as expected when used withallow#7282
implicit_return: Now takes all diverging functions in account to avoid false positives #6951while_let_on_iterator: No longer lints when the iterator is a struct field and the struct is used in the loop #6966multiple_inherent_impl: No longer lints with generic arguments #7089comparison_chain: No longer lints in aconstcontext #7118while_immutable_condition: Fix false positive where mutation in the loop variable wasn't picked up #7144default_trait_access: No longer lints in macros #7150needless_question_mark: No longer lints when the inner value is implicitly dereferenced #7165unused_unit: No longer lints when multiple macro contexts are involved #7167eval_order_dependence: Fix false positive in async context #7174unnecessary_filter_map: No longer lints if thefilter_mapchanges the type #7175wrong_self_convention: No longer lints in trait implementations of non-Copytypes #7182suboptimal_flops: No longer lints onpowi(2)#7201wrong_self_convention: No longer lints if there is no implicitself#7215option_if_let_else: No longer lints onelse if letpattern #7216use_self,useless_conversion: Fix false positives when generic arguments are involved #7223manual_unwrap_or: Fix false positive with deref coercion #7233similar_names: No longer lints onwparam/lparam#7255redundant_closure: No longer lints on using thevec![]macro in a closure #7263
implicit_return#6951- Fix suggestion for async functions
- Improve suggestion with macros
- Suggest to change
breaktoreturnwhen appropriate
while_let_on_iterator: Now suggests&mut iterwhen necessary #6966match_single_binding: Improve suggestion when match scrutinee has side effects #7095needless_borrow: Now suggests to also change usage sites as needed #7105write_with_newline: Improve suggestion when only\nis written to the buffer #7183from_iter_instead_of_collect: The suggestion is now auto applicable also when a<_ as Trait>::_is involved #7264not_unsafe_ptr_arg_deref: Improved error message #7294
- Fix ICE when running Clippy on
libstd#7140 implicit_return#7242
Released 2021-06-17
option_filter_map#6342branches_sharing_code#6463needless_for_each#6706if_then_some_else_none#6859non_octal_unix_permissions#7001unnecessary_self_imports#7072bool_assert_comparison#7083cloned_instead_of_copied#7098flat_map_option#7101
- Deprecate
filter_maplint #7059 - Move
transmute_ptr_to_ptrtopedantic#7102
mem_replace_with_default: Also lint on common std constructors #6820wrong_self_convention: Also lint onto_*_mutmethods #6828wildcard_enum_match_arm,match_wildcard_for_single_variants: #6863- Attempt to find a common path prefix in suggestion
- Don't lint on
OptionandResult - Consider
Selfprefix
explicit_deref_methods: Also lint on chainedderefcalls #6865or_fun_call: Also lint onunsafeblocks #6928vec_box,linkedlist,option_option: Also lint inconstandstaticitems #6938search_is_some: Also check foris_none#6942string_lit_as_bytes: Also lint oninto_bytes#6959len_without_is_empty: Also lint if function signatures oflenandis_emptydon't match #6980redundant_pattern_matching: Also lint if the pattern is a&pattern #6991clone_on_copy: Also lint on chained method calls takingselfby value #7000missing_panics_doc: Also lint onassert_eq!andassert_ne!#7029needless_return: Also lint inasyncfunctions #7067unused_io_amount: Also lint on expressions like_.read().ok()?#7100iter_cloned_collect: Also lint on large arrays, since const-generics are now stable #7138
upper_case_acronyms: No longer lints on public items #6805suspicious_map: No longer lints when side effects may occur inside themapcall #6831manual_map,manual_unwrap_or: No longer lints inconstfunctions #6917wrong_self_convention: Now respectsCopytypes #6924needless_question_mark: No longer lints if the?and theSome(..)come from different macro contexts #6935map_entry: Better detect if the entry API can be used #6937or_fun_call: No longer lints on somelenfunction calls #6950new_ret_no_self: No longer lints whenSelfis returned with different generic arguments #6952upper_case_acronyms: No longer lints on public items #6981explicit_into_iter_loop: Only lint wheninto_iteris an implementation ofIntoIterator#6982expl_impl_clone_on_copy: Take generic constraints into account before suggesting to usederiveinstead #6993missing_panics_doc: No longer lints when only debug-assertions are used #6996clone_on_copy: Only lint when using theClonetrait #7000wrong_self_convention: No longer lints inside a trait implementation #7002redundant_clone: No longer lints when the cloned value is modified while the clone is in use #7011same_item_push: No longer lints if theVecis used in the loop body #7018cargo_common_metadata: Remove author requirement #7026panic_in_result_fn: No longer lints ondebug_assertfamily #7060panic: No longer wrongfully lints ondebug_assertwith message #7063wrong_self_convention: No longer lints in trait implementations where noselfis involved #7064missing_const_for_fn: No longer lints when unstableconstfunction is involved #7076suspicious_else_formatting: Allow Allman style braces #7087inconsistent_struct_constructor: No longer lints in macros #7097single_component_path_imports: No longer lints on macro re-exports #7120
redundant_pattern_matching: Add a note when applying this lint would change the drop order #6568write_literal,print_literal: Add auto-applicable suggestion #6821manual_map: Fix suggestion for complexif let ... elsechains #6856inconsistent_struct_constructor: Make lint description and message clearer #6892map_entry: Now suggestsor_insert,insert_withormatch _.entry(_)as appropriate #6937manual_flatten: Suggest to insertcopiedif necessary #6962redundant_slicing: Fix suggestion when a re-borrow might be required or when the value is from a macro call #6975match_wildcard_for_single_variants: Fix suggestion for hidden variant #6988clone_on_copy: Correct suggestion when the cloned value is a macro call #7000manual_map: Fix suggestion at the end of an if chain #7004- Fix needless parenthesis output in multiple lint suggestions #7013
needless_collect: Better explanation in the lint message #7020useless_vec: Now considers mutability #7036useless_format: Wrap the content in braces if necessary #7092single_match: Don't suggest an equality check for types which don't implementPartialEq#7093from_over_into: Mention type in help message #7099manual_unwrap_or: Fix invalid code suggestion due to a macro call #7136
macro_use_imports#7022missing_panics_doc#7034tabs_in_doc_comments#7039missing_const_for_fn#7128
- Clippy's lint list now supports themes #7030
- Lints that were uplifted to
rustcnow mention the newrustcname in the deprecation warning #7056
Released 2021-05-06
from_str_radix_10#6717implicit_clone#6730semicolon_if_nothing_returned#6681manual_flatten#6646inconsistent_struct_constructor#6769iter_count#6791default_numeric_fallback#6662bytes_nth#6695filter_map_identity#6685manual_map#6573
- Moved
upper_case_acronymstopedantic#6775 - Moved
manual_maptonursery#6796 - Moved
unnecessary_wrapstopedantic#6765 - Moved
trivial_regextonursery#6696 - Moved
naive_bytecounttopedantic#6825 - Moved
upper_case_acronymstostyle#6788 - Moved
manual_maptostyle#6801
disallowed_method: Now supports functions in addition to methods #6674upper_case_acronyms: Added a new configurationupper-case-acronyms-aggressiveto trigger the lint if there is more than one uppercase character next to each other #6788collapsible_match: Now supports block comparison with different value names #6754unnecessary_wraps: Will now suggest removing unnecessary wrapped return unit type, likeOption<()>#6665- Improved value usage detection in closures #6698
use_self: No longer lints in macros #6833use_self: Fixed multiple false positives for: generics, associated types and derive implementations #6179missing_inline_in_public_items: No longer lints for procedural macros #6814inherent_to_string: No longer lints on functions with function generics #6771doc_markdown: AddOpenDNSto the default configuration as an allowed identifier #6783missing_panics_doc: No longer lints onunreachable!#6700collapsible_if: No longer lints on if statements with attributes #6701match_same_arms: Only considers empty blocks as equal if the tokens contained are the same #6843redundant_closure: Now ignores macros #6871manual_map: Fixed false positives when control flow statements likereturn,breaketc. are used #6801vec_init_then_push: Fixed false positives for loops and if statements #6697len_without_is_empty: Will now consider multiple impl blocks and#[allow]on thelenmethod as well as the type definition. #6853let_underscore_drop: Only lints on types which implementDrop#6682unit_arg: No longer lints on unit arguments when they come from a path expression. #6601cargo_common_metadata: No longer lints ifpublish = falseis defined in the manifest #6650
collapsible_match: Fixed lint message capitalization #6766or_fun_call: Improved suggestions foror_insert(vec![])#6790manual_map: No longer expands macros in the suggestions #6801- Aligned Clippy's lint messages with the rustc dev guide #6787
useless_format: Improved the documentation example #6854- Clippy's
README.md: Includes a new subsection on running Clippy as a rustc wrapper #6782
- Running
cargo clippyaftercargo checknow works as expected (cargo clippyandcargo checkno longer shares the same build cache) #6687 - Cargo now re-runs Clippy if arguments after
--provided tocargo clippyare changed. #6834 - Extracted Clippy's
utilsmodule into the newclippy_utilscrate #6756 - Clippy lintcheck tool improvements #6800 #6735 #6764 #6708 #6780 #6686
Released 2021-03-25
upper_case_acronyms#6475from_over_into#6476case_sensitive_file_extension_comparisons#6500needless_question_mark#6507missing_panics_doc#6523redundant_slicing#6528vec_init_then_push#6538ptr_as_ptr#6542collapsible_else_if(split out fromcollapsible_if) #6544inspect_for_each#6577manual_filter_map#6591exhaustive_enums#6617exhaustive_structs#6617
- Replace
find_mapwithmanual_find_map#6591 unknown_clippy_lintsNow integrated in theunknown_lintsrustc lint #6653
ptr_argNow also suggests to use&Pathinstead of&PathBuf#6506cast_ptr_alignmentAlso lint when thepointer::castmethod is used #6557collapsible_matchNow also deals with&and*operators in thematchscrutinee #6619
similar_namesIgnore underscore prefixed names #6403print_literalandwrite_literalNo longer lint numeric literals #6408large_enum_variantNo longer lints in external macros #6485empty_enumOnly lint ifnever_typefeature is enabled #6513field_reassign_with_defaultNo longer lints in macros #6553size_of_in_element_countNo longer lints when dividing by element size #6578needless_returnNo longer lints in macros #6586match_overlapping_armNo longer lint when first arm is completely included in second arm #6603doc_markdownAddWebGLto the default configuration as an allowed identifier #6605
field_reassign_with_defaultDon't expand macro in lint suggestion #6531match_like_matches_macroStrip references in suggestion #6532single_matchSuggestifoverif letwhen possible #6574ref_in_derefUse parentheses correctly in suggestion #6609stable_sort_primitiveClarify error message #6611
- Improve search performance on the Clippy website and make it possible to directly search for lints on the GitHub issue tracker #6483
- Clean up
README.mdby removing outdated paragraph #6488 await_holding_refcell_refandawait_holding_lock#6585as_conversions#6608
- Clippy now has a Roadmap for 2021. If you like to get involved in a bigger project, take a look at the Roadmap project page. All issues listed there are actively mentored #6462
- The Clippy version number now corresponds to the Rust version number #6526
- Fix oversight which caused Clippy to lint deps in some environments, where
CLIPPY_TESTS=truewas set somewhere #6575 - Add
cargo dev-lintchecktool to the Clippy Dev Tool #6469
Released 2021-02-11
suspicious_operation_groupings#6086size_of_in_element_count#6394unnecessary_wraps#6070let_underscore_drop#6305collapsible_match#6402redundant_else#6330zero_sized_map_values#6218print_stderr#6367string_from_utf8_as_bytes#6134
- Previously deprecated
str_to_stringandstring_to_stringhave been un-deprecated asrestrictionlints #6333 - Deprecate
panic_paramslint. This is now available in rustc asnon_fmt_panics#6351 - Move
map_err_ignoretorestriction#6416 - Move
await_holding_refcell_reftopedantic#6354 - Move
await_holding_locktopedantic#6354
- Add the
unreadable-literal-lint-fractionsconfiguration to disable theunreadable_literallint for fractions #6421 clone_on_copy: Now shows the type in the lint message #6443redundant_pattern_matching: Now also lints onstd::task::Poll#6339redundant_pattern_matching: Additionally also lints onstd::net::IpAddr#6377search_is_some: Now suggestscontainsinstead offind(foo).is_some()#6119clone_double_ref: Now prints the reference type in the lint message #6442modulo_one: Now also lints on -1. #6360empty_loop: Now lints no_std crates, too #6205or_fun_call: Now also lints when indexingHashMaporBTreeMap#6267wrong_self_convention: Now also lints in trait definitions #6316needless_borrow: Print the type in the lint message #6449
manual_range_contains: No longer lints inconst fn#6382unnecessary_lazy_evaluations: No longer lints if closure argument is used #6370match_single_binding: Now ignores cases with#[cfg()]macros #6435match_like_matches_macro: No longer lints on arms with attributes #6290map_clone: No longer lints with deref and clone #6269map_clone: No longer lints in the case of &mut #6301needless_update: Now ignoresnon_exhaustivestructs #6464needless_collect: No longer lints when a collect is needed multiple times #6313unnecessary_castNo longer lints cfg-dependent types #6369declare_interior_mutable_constandborrow_interior_mutable_const: Both now ignore enums with frozen variants #6110field_reassign_with_defaultNo longer lint for private fields #6537
vec_box: Provide correct type scope suggestion #6271manual_range_contains: Give correct suggestion when using floats #6320unnecessary_lazy_evaluations: Don't always mark suggestion as MachineApplicable #6272manual_async_fn: Improve suggestion formatting #6294unnecessary_cast: Fix incorrectly formatted float literal suggestion #6362
- Fix a crash in
from_iter_instead_of_collect#6304 - Fix a silent crash when parsing doc comments in
needless_doctest_main#6458
- The lint website search has been improved (#6477):
- Searching for lints with dashes and spaces is possible now. For example
missing-errors-docandmissing errors docare now valid aliases for lint names - Improved fuzzy search in lint descriptions
- Searching for lints with dashes and spaces is possible now. For example
- Various README improvements #6287
- Add known problems to
comparison_chaindocumentation #6390 - Fix example used in
cargo_common_metadata#6293 - Improve
map_clonedocumentation #6340
- You can now tell Clippy about the MSRV your project supports. Please refer to the specific README section to learn more about MSRV support here #6201
- Add
--no-depsoption to avoid running on path dependencies in workspaces #6188
Released 2020-12-31
field_reassign_with_default#5911await_holding_refcell_ref#6029disallowed_method#6081inline_asm_x86_att_syntax#6092inline_asm_x86_intel_syntax#6092from_iter_instead_of_collect#6101mut_mutex_lock#6103single_element_loop#6109manual_unwrap_or#6123large_types_passed_by_value#6135result_unit_err#6157ref_option_ref#6165manual_range_contains#6177unusual_byte_groupings#6183comparison_to_empty#6226map_collect_result_unit#6227manual_ok_or#6233
- Rename
single_char_push_strtosingle_char_add_str#6037 - Rename
zero_width_spacetoinvisible_characters#6105 - Deprecate
drop_bounds(uplifted) #6111 - Move
string_lit_as_bytestonursery#6117 - Move
rc_buffertorestriction#6128
manual_memcpy: Also lint when there are loop counters (and produce a reliable suggestion) #5727single_char_add_str: Also lint onString::insert_str#6037invisible_characters: Also lint the characters\u{AD}and\u{2060}#6105eq_op: Also lint on theassert_*!macro family #6167items_after_statements: Also lint in local macro expansions #6176unnecessary_cast: Also lint casts on integer and float literals #6187manual_unwrap_or: Also lintResult::unwrap_or#6190match_like_matches_macro: Also lint whenmatchhas more than two arms #6216integer_arithmetic: Better handle/an%operators #6229
needless_lifetimes: Bail out if the function has awhereclause with the lifetime #5978explicit_counter_loop: No longer lints, when loop counter is used after it is incremented #6076or_fun_call: Revert changes addressing the handling ofconst fn#6077needless_range_loop: No longer lints, when the iterable is used in the range #6102inconsistent_digit_grouping: Fix bug when using floating point exponent #6104mistyped_literal_suffixes: No longer lints on the fractional part of a float (e.g.713.32_64) #6114invalid_regex: No longer lint on unicode characters withinbytes::Regex#6132boxed_local: No longer lints onextern fnarguments #6133needless_lifetimes: Fix regression, where lifetime is used inwhereclause #6198
unnecessary_sort_by: Avoid dereferencing the suggested closure parameter #6078needless_arbitrary_self_type: Correctly handle expanded code #6093useless_format: Preserve raw strings in suggestion #6151empty_loop: Suggest alternatives #6162borrowed_box: Correctly add parentheses in suggestion #6200unused_unit: Improve suggestion formatting #6247
- Some doc improvements:
doc_markdown: Document problematic link text style #6107
Released 2020-11-19
self_assignment#5894unnecessary_lazy_evaluations#5720manual_strip#6038map_err_ignore#5998rc_buffer#6044to_string_in_display#5831single_char_push_str#5881
- Downgrade
verbose_bit_maskto pedantic #6036
- Extend
precedenceto handle chains of methods combined with unary negation #5928 useless_vec: add a configuration value for the maximum allowed size on the stack #5907suspicious_arithmetic_impl: extend to implementations ofBitAnd,BitOr,BitXor,Rem,Shl, andShr#5884invalid_atomic_ordering: detect misuse ofcompare_exchange,compare_exchange_weak, andfetch_update#6025- Avoid
redundant_pattern_matchingtriggering in macros #6069 option_if_let_else: distinguish pure from impureelseexpressions #5937needless_doctest_main: parse doctests instead of using textual search #5912wildcard_imports: allowpreludeto appear in any segment of an import #5929- Re-enable
len_zerofor ranges now thatrange_is_emptyis stable #5961 option_as_ref_deref: catch fully-qualified calls toDeref::derefandDerefMut::deref_mut#5933
useless_attribute: permit allowingwildcard_importsandenum_glob_use#5994transmute_ptr_to_ptr: avoid suggesting dereferencing raw pointers in const contexts #5999redundant_closure_call: take into account usages of the closure in nested functions and closures #5920- Fix false positive in
borrow_interior_mutable_constwhen referencing a field behind a pointer #5949 doc_markdown: allow using "GraphQL" without backticks #5996to_string_in_display: avoid linting when callingto_string()on anything that is notself#5971indexing_slicingandout_of_bounds_indexingtreat references to arrays as arrays #6034should_implement_trait: ignore methods with lifetime parameters #5725needless_return: avoid linting if a temporary borrows a local variable #5903- Restrict
unnecessary_sort_byto non-reference, Copy types #6006 - Avoid suggesting
from_bits/to_bitsin const contexts intransmute_int_to_float#5919 declare_interior_mutable_constandborrow_interior_mutable_const: improve detection of interior mutable types #6046
let_and_return: add a cast to the suggestion when the return expression has adjustments #5946useless_conversion: show the type in the error message #6035unnecessary_mut_passed: discriminate between functions and methods in the error message #5892float_cmpandfloat_cmp_const: change wording to make margin of error less ambiguous #6043default_trait_access: do not use unnecessary type parameters in the suggestion #5993collapsible_if: don't use expanded code in the suggestion #5992- Do not suggest empty format strings in
print_with_newlineandwrite_with_newline#6042 unit_arg: improve the readability of the suggestion #5931stable_sort_primitive: print the type that is being sorted in the lint message #5935- Show line count and max lines in
too_many_lineslint message #6009 - Keep parentheses in the suggestion of
useless_conversionwhere applicable #5900 option_map_unit_fnandresult_map_unit_fn: print the unit type()explicitly #6024redundant_allocation: suggest replacingRc<Box<T>>withRc<T>#5899- Make lint messages adhere to rustc dev guide conventions #5893
- Fix ICE in
repeat_once#5948
mutable_key_type: explain potential for false positives when the interior mutable type is not accessed in theHashimplementation #6019unnecessary_mut_passed: fix typo #5913- Add example of false positive to
ptr_argdocs. #5885 box_vec,vec_boxandborrowed_box: add link to the documentation ofBox#6023
Released 2020-10-08
derive_ord_xor_partial_ord#5848trait_duplication_in_bounds#5852map_identity#5694unit_return_expecting_ord#5737pattern_type_mismatch#4841repeat_once#5773same_item_push#5825needless_arbitrary_self_type#5869match_like_matches_macro#5769stable_sort_primitive#5809blanket_clippy_restriction_lints#5750option_if_let_else#5301
- Deprecate
regex_macrolint #5760 - Move
range_minus_onetopedantic#5752
- Improve
needless_collectby catchingcollectcalls followed byiterorinto_itercalls #5837 panic,todo,unimplementedandunreachablenow detect calls with formatting #5811- Detect more cases of
suboptimal_flopsandimprecise_flops#5443 - Handle asymmetrical implementations of
PartialEqincmp_owned#5701 - Make it possible to allow
unsafe_derive_deserialize#5870 - Catch
ord.min(a).max(b)where a < b inmin_max#5871 - Make
clone_on_copysuggestion machine applicable #5745 - Enable
len_zeroon ranges now thatis_emptyis stable on them #5961
- Avoid triggering
or_fun_callwith const fns that take no arguments #5889 - Fix
redundant_closure_callfalse positive for closures that have multiple calls #5800 - Don't lint cases involving
ManuallyDropinredundant_clone#5824 - Treat a single expression the same as a single statement in the 2nd arm of a match in
single_match_else#5771 - Don't trigger
unnested_or_patternsif the featureor_patternsis not enabled #5758 - Avoid linting if key borrows in
unnecessary_sort_by#5756 - Consider
Tryimpl forPollwhen generating suggestions intry_err#5857 - Take input lifetimes into account in
manual_async_fn#5859 - Fix multiple false positives in
type_repetition_in_boundsand add a configuration option #5761 - Limit the
suspicious_arithmetic_impllint to one binary operation #5820
- Improve readability of
shadow_unrelatedsuggestion by truncating the RHS snippet #5788 - Suggest
filter_mapinstead offlat_mapwhen mapping toOptioninmap_flatten#5846 - Ensure suggestion is shown correctly for long method call chains in
iter_nth_zero#5793 - Drop borrow operator in suggestions of
redundant_pattern_matching#5815 - Add suggestion for
iter_skip_next#5843 - Improve
collapsible_iffix suggestion #5732
- Fix ICE caused by
needless_collect#5877 - Fix ICE caused by
unnested_or_patterns#5784
- Fix grammar of
await_holding_lockdocumentation #5748
- Make lints adhere to the rustc dev guide #5888
Released 2020-08-27
- Move
cast_ptr_alignmentto pedantic #5667
- Improve
mem_replace_with_uninitlint #5695
len_zero: Avoid linting ranges when therange_is_emptyfeature is not enabled #5656let_and_return: Don't lint if a temporary borrow is involved #5680reversed_empty_ranges: Avoid lintingN..Nin for loop arguments in #5692if_same_then_else: Don't assume multiplication is always commutative #5702blacklisted_name: Removebarfrom the default configuration #5712redundant_pattern_matching: Avoid suggesting non-const fncalls in const contexts #5724
- Fix suggestion of
unit_arglint, so that it suggest semantic equivalent code #4455 - Add auto applicable suggestion to
macro_use_imports#5279
- Fix ICE in the
constsmodule of Clippy #5709
- Improve code examples across multiple lints #5664
- Introduce a
--rustcflag toclippy-driver, which turnsclippy-driverintorustcand passes all the given arguments torustc. This is especially useful for tools that need therustcversion Clippy was compiled with, instead of the Clippy version. E.g.clippy-driver --rustc --versionwill print the output ofrustc --version. #5178 - New issue templates now make it easier to complain if Clippy is too annoying or not annoying enough! #5735
Released 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#5550
- Downgrade
match_boolto pedantic #5408 - Downgrade
match_wild_err_armto pedantic and update help messages. #5622 - Downgrade
useless_let_if_seqto nursery. #5599 - Generalize
option_and_then_someand rename tobind_instead_of_map. #5529 - Rename
identity_conversiontouseless_conversion. #5568 - Merge
block_in_if_condition_exprandblock_in_if_condition_stmtintoblocks_in_if_conditions. #5563 - Merge
option_map_unwrap_or,option_map_unwrap_or_elseandresult_map_unwrap_or_elseintomap_unwrap_or. #5563 - Merge
option_unwrap_usedandresult_unwrap_usedintounwrap_used. #5563 - Merge
option_expect_usedandresult_expect_usedintoexpect_used. #5563 - Merge
for_loop_over_optionandfor_loop_over_resultintofor_loops_over_fallibles. #5563
- Avoid running cargo lints when not enabled to improve performance. #5505
- Extend
useless_conversionwithTryFromandTryInto. #5631 - Lint also in type parameters and where clauses in
unused_unit. #5592 - Do not suggest deriving
Defaultinnew_without_default. #5616
while_let_on_iterator#5525empty_line_after_outer_attr#5609unnecessary_unwrap#5558comparison_chain#5596- Don't trigger
used_underscore_bindingin await desugaring. #5535 - Don't trigger
borrowed_boxon mutable references. #5491 - Allow
1 << 0inidentity_op. #5602 - Allow
use super::*;glob imports inwildcard_imports. #5564 - Whitelist more words in
doc_markdown. #5611 - Skip dev and build deps in
multiple_crate_versions. #5636 - Honor
allowattribute on arguments inptr_arg. #5647 - Honor lint level attributes for
redundant_field_names,just_underscores_and_digits,many_single_char_namesandsimilar_names. #5651 - Ignore calls to
leninor_fun_call. #4429
- Simplify suggestions in
manual_memcpy. #5536 - Fix suggestion in
redundant_pattern_matchingfor macros. #5511 - Avoid suggesting
copied()for mutable references inmap_clone. #5530 - Improve help message for
clone_double_ref. #5547
- Fix ICE caused in unwrap module. #5590
- Fix ICE on rustc test issue-69020-assoc-const-arith-overflow.rs #5499
- Clarify the documentation of
unnecessary_mut_passed. #5639 - Extend example for
unneeded_field_pattern. #5541
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#5294
- Deprecate
replace_constslint #5380 - Move
cognitive_complexityto nursery #5428 - Move
useless_transmuteto nursery #5364 - Downgrade
inefficient_to_stringto pedantic #5412 - Downgrade
option_optionto pedantic #5401 - Downgrade
unreadable_literalto pedantic #5419 - Downgrade
let_unit_valueto pedantic #5409 - Downgrade
trivially_copy_pass_by_refto pedantic #5410 - Downgrade
implicit_hasherto pedantic #5411
- On nightly you can now use
cargo clippy --fix -Z unstable-optionsto auto-fix lints that support this #5363 - Make
redundant_clonealso trigger on cases where the cloned value is not consumed. #5304 - Expand
integer_arithmeticto also disallow bit-shifting #5430 option_as_ref_derefnow detects more deref cases #5425large_enum_variantnow report the sizes of the largest and second-largest variants #5466bool_comparisonnow also checks for inequality comparisons that can be written more concisely #5365- Expand
clone_on_copyto work in method call arguments as well #5441 redundant_pattern_matchingnow also handleswhile let#5483integer_arithmeticnow also lints references of integers #5329- Expand
float_cmp_constto also work on arrays #5345 - Trigger
map_flattenwhen map is called on anOption#5473
many_single_char_names#5468should_implement_trait#5437unused_self#5387redundant_clone#5453precedence#5445suspicious_op_assign_impl#5424needless_lifetimes#5293redundant_pattern#5287inconsistent_digit_grouping#5451
- Improved
question_marklint suggestion so that it doesn't add redundantas_ref()#5481 - Improve the suggested placeholder in
option_map_unit_fn#5292 - Improve suggestion for
match_single_bindingwhen triggered inside a closure #5350
- Fix documentation generation for configurable lints #5353
- Update documentation for
new_ret_no_self#5448 - The documentation for
option_optionnow suggest using a tri-state enum #5403 - Fix bit mask example in
verbose_bit_maskdocumentation #5454 wildcard_importsdocumentation now mentions thatuse ...::prelude::*is not linted #5312
Released 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#5258
- Move
unneeded_field_patternto pedantic group #5200
- Make
missing_errors_doclint also trigger onasyncfunctions #5181 - Add more constants to
approx_constant#5193 - Extend
question_marklint #5266
- Improve suggestion when blocks of code are suggested #5134
misc_earlylints #5129missing_errors_doc#5213- Fix ICE when evaluating
usizes #5256
- Improve documentation of
iter_nth_zero - Add documentation pages for stable releases #5171
- Clippy now completely runs on GitHub Actions #5190
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#5067
- Move
transmute_float_to_intfrom nursery to complexity group #5015 - Move
range_plus_oneto pedantic group #5057 - Move
debug_assert_with_mut_callto nursery group #5106 - Deprecate
unused_label#4930
- Lint vectored IO in
unused_io_amount#5027 - Make
vec_boxconfigurable by adding a size threshold #5081 - Also lint constants in
cmp_nan#4910 - Fix false negative in
expect_fun_call#4915 - Fix false negative in
redundant_clone#5017
map_clone#4937replace_consts#4977let_and_return#5008eq_op#5079possible_missing_comma#5083debug_assert_with_mut_call#5106- Don't trigger
let_underscore_must_usein external macros #5082 - Don't trigger
empty_loopinno_stdcrates #5086
option_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#5032
- Improve documentation of
empty_enum,replace_consts,redundant_clone, anditerator_step_by_zero
Released 2020-01-30
- New Lints:
- Remove plugin interface, see Inside Rust Blog for details #4714
- Move
use_selfto nursery group #4863 - Deprecate
into_iter_on_array#4788 - Expand
string_lit_as_bytesto also trigger when literal has escapes #4808 - Fix false positive in
comparison_chain#4842 - Fix false positive in
while_immutable_condition#4730 - Fix false positive in
explicit_counter_loop#4803 - Fix false positive in
must_use_candidate#4794 - Fix false positive in
print_with_newlineandwrite_with_newline#4769 - Fix false positive in
derive_hash_xor_eq#4766 - Fix false positive in
missing_inline_in_public_items#4870 - Fix false positive in
string_add#4880 - Fix false positive in
float_arithmetic#4851 - Fix false positive in
cast_sign_loss#4883 - Fix false positive in
manual_swap#4877 - Fix ICEs occurring while checking some block expressions #4772
- Fix ICE in
use_self#4776 - Fix ICEs related to
const_generics#4780 - Display help when running
clippy-driverwithout arguments, instead of ICEing #4810 - Clippy has its own ICE message now #4588
- Show deprecated lints in the documentation again #4757
- Improve Documentation by adding positive examples to some lints #4832
Released 2019-12-19
- New Lints:
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#4657
- Move
redundant_cloneto perf group #4509 - Move
manual_mul_addto nursery group #4736 - Expand
unit_cmpto also work withassert_eq!,debug_assert_eq!,assert_ne!anddebug_assert_ne!#4613 - Expand
integer_arithmeticto also detect mutating arithmetic like+=#4585 - Fix false positive in
nonminimal_bool#4568 - Fix false positive in
missing_safety_doc#4611 - Fix false positive in
cast_sign_loss#4614 - Fix false positive in
redundant_clone#4509 - Fix false positive in
try_err#4721 - Fix false positive in
toplevel_ref_arg#4570 - Fix false positive in
multiple_inherent_impl#4593 - Improve more suggestions and tests in preparation for the unstable
cargo fix --clippy#4575 - Improve suggestion for
zero_ptr#4599 - Improve suggestion for
explicit_counter_loop#4691 - Improve suggestion for
mul_add#4602 - Improve suggestion for
assertions_on_constants#4635 - Fix ICE in
use_self#4671 - Fix ICE when encountering const casts #4590
Released 2019-11-07
- New Lints:
- Deprecate
unused_collectlint. This is fully covered by rustc's#[must_use]oncollect#4348 - Move
type_repetition_in_boundsto pedantic group #4403 - Move
cast_losslessto pedantic group #4539 temporary_cstring_as_ptrnow catches more cases #4425use_selfnow works in constructors, too #4525cargo_common_metadatanow checks for license files #4518cognitive_complexitynow includes the measured complexity in the warning message #4469- Fix false positives in
block_in_if_*lints #4458 - Fix false positive in
cast_lossless#4473 - Fix false positive in
clone_on_copy#4411 - Fix false positive in
deref_addrof#4487 - Fix false positive in
too_many_lines#4490 - Fix false positive in
new_ret_no_self#4365 - Fix false positive in
manual_swap#4478 - Fix false positive in
missing_const_for_fn#4450 - Fix false positive in
extra_unused_lifetimes#4477 - Fix false positive in
inherent_to_string#4460 - Fix false positive in
map_entry#4495 - Fix false positive in
unused_unit#4445 - Fix false positive in
redundant_pattern#4489 - Fix false positive in
wrong_self_convention#4369 - Improve various suggestions and tests in preparation for the unstable
cargo fix --clippy#4558 - Improve suggestions for
redundant_pattern_matching#4352 - Improve suggestions for
explicit_write#4544 - Improve suggestion for
or_fun_call#4522 - Improve suggestion for
match_as_ref#4446 - Improve suggestion for
unnecessary_fold_span#4382 - Add suggestions for
unseparated_literal_suffix#4401 - Add suggestions for
char_lit_as_u8#4418
Released 2019-09-26
- New Lints:
- Move
{unnnecessary,panicking}_unwrapout of nursery #4307 - Extend the
use_selflint to suggest uses ofSelf::Variant#4308 - Improve suggestion for needless return #4262
- Add auto-fixable suggestion for
let_unit#4337 - Fix false positive in
pub_enum_variant_namesandenum_variant_names#4345 - Fix false positive in
cast_ptr_alignment#4257 - Fix false positive in
string_lit_as_bytes#4233 - Fix false positive in
needless_lifetimes#4266 - Fix false positive in
float_cmp#4275 - Fix false positives in
needless_return#4274 - Fix false negative in
match_same_arms#4246 - Fix incorrect suggestion for
needless_bool#4335 - Improve suggestion for
cast_ptr_alignment#4257 - Improve suggestion for
single_char_literal#4361 - Improve suggestion for
len_zero#4314 - Fix ICE in
implicit_hasher#4268 - Fix allow bug in
trivially_copy_pass_by_ref#4250
Released 2019-08-15
- New Lints:
- Renamed Lint:
const_static_lifetimeis now calledredundant_static_lifetimes. The lint now covers statics in addition to consts #4162 match_same_armsnow warns for all identical arms, instead of only the first one #4102needless_returnnow works with void functions #4220- Fix false positive in
redundant_closure#4190 - Fix false positive in
useless_attribute#4107 - Fix incorrect suggestion for
float_cmp#4214 - Add suggestions for
print_with_newlineandwrite_with_newline#4136 - Improve suggestions for
option_map_unwrap_or_elseandresult_map_unwrap_or_else#4164 - Improve suggestions for
non_ascii_literal#4119 - Improve diagnostics for
let_and_return#4137 - Improve diagnostics for
trivially_copy_pass_by_ref#4071 - Add macro check for
unreadable_literal#4099
Released 2019-07-04
- New lints:
find_map,filter_map_next#4039 - New lint:
path_buf_push_overwrite#3954 - Move
path_buf_push_overwriteto the nursery #4013 - Split
redundant_closureintoredundant_closureandredundant_closure_for_method_calls#4110 - Allow allowing of
toplevel_ref_arglint #4007 - Fix false negative in
or_fun_callpertaining to nested constructors #4084 - Fix false positive in
or_fun_callpertaining to enum variant constructors #4018 - Fix false positive in
useless_let_if_seqpertaining to interior mutability #4035 - Fix false positive in
redundant_closurepertaining to non-function types #4008 - Fix false positive in
let_and_returnpertaining to attributes onlets #4024 - Fix false positive in
module_name_repetitionslint pertaining to attributes #4006 - Fix false positive on
assertions_on_constantspertaining todebug_assert!#3989 - Improve suggestion in
map_cloneto suggest.copied()where applicable #3970 #4043 - Improve suggestion for
search_is_some#4049 - Improve suggestion applicability for
naive_bytecount#3984 - Improve suggestion applicability for
while_let_loop#3975 - Improve diagnostics for
too_many_arguments#4053 - Improve diagnostics for
cast_lossless#4021 - Deal with macro checks in desugarings better #4082
- Add macro check for
unnecessary_cast#4026 - Remove
approx_constant's documentation's "Known problems" section. #4027 - Fix ICE in
suspicious_else_formatting#3960 - Fix ICE in
decimal_literal_representation#3931
Released 2019-05-20
- New lint:
drop_boundsto detectT: Dropbounds - Split
redundant_closureintoredundant_closureandredundant_closure_for_method_calls#4110 - Rename
cyclomatic_complexitytocognitive_complexity, start work on making lint more practical for Rust code - Move
get_unwrapto the restriction category - Improve suggestions for
iter_cloned_collect - Improve suggestions for
cast_losslessto suggest suffixed literals - Fix false positives in
print_with_newlineandwrite_with_newlinepertaining to raw strings - Fix false positive in
needless_range_looppertaining to structs without a.iter() - Fix false positive in
bool_comparisonpertaining to non-bool types - Fix false positive in
redundant_closurepertaining to differences in borrows - Fix false positive in
option_map_unwrap_oron non-copy types - Fix false positives in
missing_const_for_fnpertaining to macros and trait method impls - Fix false positive in
needless_pass_by_valuepertaining to procedural macros - Fix false positive in
needless_continuepertaining to loop labels - Fix false positive for
boxed_localpertaining to arguments moved into closures - Fix false positive for
use_selfin nested functions - Fix suggestion for
expect_fun_call(https://github.com/rust-lang/rust-clippy/pull/3846) - Fix suggestion for
explicit_counter_loopto deal with parenthesizing range variables - Fix suggestion for
single_char_patternto correctly escape single quotes - Avoid triggering
redundant_closurein macros - ICE fixes: #3805, #3772, #3741
Released 2019-04-10
- New lint:
assertions_on_constantsto detect for exampleassert!(true) - New lint:
dbg_macroto detect uses of thedbg!macro - New lint:
missing_const_for_fnthat can suggest functions to be madeconst - New lint:
too_many_linesto detect functions with excessive LOC. It can be configured using thetoo-many-lines-thresholdconfiguration. - New lint:
wildcard_enum_match_armto check for wildcard enum matches using_ - Expand
redundant_closureto also work for methods (not only functions) - Fix ICEs in
vec_box,needless_pass_by_valueandimplicit_hasher - Fix false positive in
cast_sign_loss - Fix false positive in
integer_arithmetic - Fix false positive in
unit_arg - Fix false positives in
implicit_return - Add suggestion to
explicit_write - Improve suggestions for
question_marklint - Fix incorrect suggestion for
cast_lossless - Fix incorrect suggestion for
expect_fun_call - Fix incorrect suggestion for
needless_bool - Fix incorrect suggestion for
needless_range_loop - Fix incorrect suggestion for
use_self - Fix incorrect suggestion for
while_let_on_iterator - Clippy is now slightly easier to invoke in non-cargo contexts. See #3665 for more details.
- We now have improved documentation on how to add new lints
Released 2019-02-26
- New lints:
implicit_return,vec_box,cast_ref_to_mut - The
rust-clippyrepository is now part of therust-langorg. - Rename
stuttertomodule_name_repetitions - Merge
new_without_default_deriveintonew_without_defaultlint - Move
large_digit_groupsfromstylegroup topedantic - Expand
bool_comparisonto check for<,<=,>,>=, and!=comparisons against booleans - Expand
no_effectto detect writes to constants such asA_CONST.field = 2 - Expand
redundant_cloneto work on struct fields - Expand
suspicious_else_formattingto detectif .. {..} {..} - Expand
use_selfto work on tuple structs and also in local macros - Fix ICE in
result_map_unit_fnandoption_map_unit_fn - Fix false positives in
implicit_return - Fix false positives in
use_self - Fix false negative in
clone_on_copy - Fix false positive in
doc_markdown - Fix false positive in
empty_loop - Fix false positive in
if_same_then_else - Fix false positive in
infinite_iter - Fix false positive in
question_mark - Fix false positive in
useless_asref - Fix false positive in
wildcard_dependencies - Fix false positive in
write_with_newline - Add suggestion to
explicit_write - Improve suggestions for
question_marklint - Fix incorrect suggestion for
get_unwrap
Released 2019-01-17
- New lints:
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 - Add support for
u128andi128to integer related lints - Add float support to
mistyped_literal_suffixes - Fix false positives in
use_self - Fix false positives in
missing_comma - Fix false positives in
new_ret_no_self - Fix false positives in
possible_missing_comma - Fix false positive in
integer_arithmeticin constant items - Fix false positive in
needless_borrow - Fix false positive in
out_of_bounds_indexing - Fix false positive in
new_without_default_derive - Fix false positive in
string_lit_as_bytes - Fix false negative in
out_of_bounds_indexing - Fix false negative in
use_self. It will now also check existential types - Fix incorrect suggestion for
redundant_closure_call - Fix various suggestions that contained expanded macros
- Fix
bool_comparisontriggering 3 times on on on the same code - Expand
trivially_copy_pass_by_refto work on trait methods - Improve suggestion for
needless_range_loop - Move
needless_pass_by_valuefrompedanticgroup tostyle
Released 2018-12-06
- Clippy has been relicensed under a dual MIT / Apache license. See #3093 for more information.
- With Rust 1.31, Clippy is no longer available via crates.io. The recommended
installation method is via
rustup component add clippy. - New lints:
redundant_pattern_matching,unnecessary_filter_map,unused_unit,map_flatten,mem_replace_option_with_none - Fix ICE in
if_let_redundant_pattern_matching - Fix ICE in
needless_pass_by_valuewhen encountering a generic function argument with a lifetime parameter - Fix ICE in
needless_range_loop - Fix ICE in
single_char_patternwhen encountering a constant value - Fix false positive in
assign_op_pattern - Fix false positive in
boxed_localon trait implementations - Fix false positive in
cmp_owned - Fix false positive in
collapsible_ifwhen conditionals have comments - Fix false positive in
double_parens - Fix false positive in
excessive_precision - Fix false positive in
explicit_counter_loop - Fix false positive in
fn_to_numeric_cast_with_truncation - Fix false positive in
map_clone - Fix false positive in
new_ret_no_self - Fix false positive in
new_without_defaultwhennewis unsafe - Fix false positive in
type_complexitywhen using extern types - Fix false positive in
useless_format - Fix false positive in
wrong_self_convention - Fix incorrect suggestion for
excessive_precision - Fix incorrect suggestion for
expect_fun_call - Fix incorrect suggestion for
get_unwrap - Fix incorrect suggestion for
useless_format fn_to_numeric_cast_with_truncationlint can be disabled again- Improve suggestions for
manual_memcpy - Improve help message for
needless_lifetimes
Released 2018-10-25
- Deprecate
assign_opslint - New lints:
mistyped_literal_suffixes,ptr_offset_with_cast,needless_collect,copy_iterator cargo clippy -Vnow includes the Clippy commit hash of the Rust Clippy component- Fix ICE in
implicit_hasher - Fix ICE when encountering
println!("{}" a); - Fix ICE when encountering a macro call in match statements
- Fix false positive in
default_trait_access - Fix false positive in
trivially_copy_pass_by_ref - Fix false positive in
similar_names - Fix false positive in
redundant_field_name - Fix false positive in
expect_fun_call - Fix false negative in
identity_conversion - Fix false negative in
explicit_counter_loop - Fix
range_plus_onesuggestion and false negative print_with_newline/write_with_newline: don't warn about string with several\ns in them- Fix
useless_attributeto also whitelistunused_extern_crates - Fix incorrect suggestion for
single_char_pattern - Improve suggestion for
identity_conversionlint - Move
explicit_iter_loopandexplicit_into_iter_loopfromstylegroup topedantic - Move
range_plus_oneandrange_minus_onefromnurserygroup tocomplexity - Move
shadow_unrelatedfromrestrictiongroup topedantic - Move
indexing_slicingfrompedanticgroup torestriction
Released 2018-09-13
- 🎉 🎉 Rust 1.29 is the first stable Rust that includes a bundled Clippy 🎉
🎉
You can now run
rustup component add clippy-previewand thencargo clippyto run Clippy. This should put an end to the continuous nightly upgrades for Clippy users. - Clippy now follows the Rust versioning scheme instead of its own
- Fix ICE when encountering a
while let (..) = x.iter()construct - Fix false positives in
use_self - Fix false positive in
trivially_copy_pass_by_ref - Fix false positive in
useless_attributelint - Fix false positive in
print_literal - Fix
use_selfregressions - Improve lint message for
neg_cmp_op_on_partial_ord - Improve suggestion highlight for
single_char_pattern - Improve suggestions for various print/write macro lints
- Improve website header
- Rustup to rustc 1.29.0-nightly (e06c87544 2018-07-06)
- Rustup to rustc 1.28.0-nightly (e3bf634e0 2018-06-28)
- Rustup to rustc 1.28.0-nightly (01cc982e9 2018-06-24)
- Rustup to rustc 1.28.0-nightly (523097979 2018-06-18)
- Rustup to rustc 1.28.0-nightly (86a8f1a63 2018-06-17)
- Rustup to rustc 1.28.0-nightly (2a0062974 2018-06-09)
- Rustup to rustc 1.28.0-nightly (5bf68db6e 2018-05-28)
- Rustup to rustc 1.28.0-nightly (990d8aa74 2018-05-25)
- Rename
unused_lifetimestoextra_unused_lifetimesbecause of naming conflict with new rustc lint
- Rustup to rustc 1.28.0-nightly (71e87be38 2018-05-22)
- Rustup to rustc 1.28.0-nightly (a3085756e 2018-05-19)
- Clippy attributes are now of the form
clippy::cyclomatic_complexityinstead ofclippy(cyclomatic_complexity)
- Rustup to rustc 1.28.0-nightly (952f344cd 2018-05-18)
- Rustup to rustc 1.27.0-nightly (2f2a11dfc 2018-05-16)
- Rustup to rustc 1.27.0-nightly (9fae15374 2018-05-13)
- Rustup to rustc 1.27.0-nightly (ff2ac35db 2018-05-12)
- Rustup to rustc 1.27.0-nightly (acd3871ba 2018-05-10)
- Rustup to rustc 1.27.0-nightly (428ea5f6b 2018-05-06)
- Rustup to rustc 1.27.0-nightly (e82261dfb 2018-05-03)
- Rustup to rustc 1.27.0-nightly (ac3c2288f 2018-04-18)
- Rustup to rustc 1.27.0-nightly (bd40cbbe1 2018-04-14)
- New lints:
cast_ptr_alignment,transmute_ptr_to_ptr,write_literal,write_with_newline,writeln_empty_string
- Rustup to rustc 1.27.0-nightly (eeea94c11 2018-04-06)
- Rustup to rustc 1.27.0-nightly (fb44b4c0e 2018-04-04)
- New lint:
print_literal
- Rustup to rustc 1.26.0-nightly (ae544ee1c 2018-03-29)
- Lint audit; categorize lints as style, correctness, complexity, pedantic, nursery, restriction.
- Fix a bunch of intermittent cargo bugs
- Rustup to rustc 1.26.0-nightly (5508b2714 2018-03-18)
- Rustup to rustc 1.26.0-nightly (392645394 2018-03-15)
- New lint:
while_immutable_condition
- Rustup to rustc 1.26.0-nightly (322d7f7b9 2018-02-25)
- New lints:
redundant_field_names,suspicious_arithmetic_impl,suspicious_op_assign_impl
- Rustup to rustc 1.25.0-nightly (0c6091fbd 2018-02-04)
- Various false positive fixes
- Rustup to rustc 1.25.0-nightly (56733bc9f 2018-02-01)
- New lint:
question_mark
- Rustup to rustc 1.25.0-nightly (90eb44a58 2018-01-29)
- New lints:
double_comparisons,empty_line_after_outer_attr
- Rustup to rustc 1.25.0-nightly (21882aad7 2018-01-28)
- New lint:
misaligned_transmute
- Rustup to rustc 1.25.0-nightly (a0dcecff9 2018-01-24)
- New lint:
decimal_literal_representation
- Rustup to rustc 1.25.0-nightly (97520ccb1 2018-01-21)
- New lints:
else_if_without_else,option_option,unit_arg,unnecessary_fold - Removed
unit_expr - Various false positive fixes for
needless_pass_by_value
- Rustup to rustc 1.25.0-nightly (3f92e8d89 2018-01-14)
- Rustup to rustc 1.25.0-nightly (61452e506 2018-01-09)
- Rustup to rustc 1.25.0-nightly (ee220daca 2018-01-07)
- Rustup to rustc 1.24.0-nightly (250b49205 2017-12-21)
- New lint:
match_as_ref
- Rustup to rustc 1.24.0-nightly (0077d128d 2017-12-14)
- Rustup to rustc 1.24.0-nightly (bb42071f6 2017-12-01)
- Rustup to rustc 1.23.0-nightly (63739ab7b 2017-11-21)
- Rustup to rustc 1.23.0-nightly (33374fa9d 2017-11-20)
- Rustup to rustc 1.23.0-nightly (d0f8e2913 2017-11-16)
- Rustup to rustc 1.23.0-nightly (ff0f5de3b 2017-11-14)
- Rustup to rustc 1.23.0-nightly (d6b06c63a 2017-11-09)
- Rustup to rustc 1.23.0-nightly (3b82e4c74 2017-11-05)
- New lints:
just_underscores_and_digits,result_map_unwrap_or_else,transmute_bytes_to_str
- Rustup to rustc 1.23.0-nightly (f0fe716db 2017-10-30)
- Rustup to rustc 1.23.0-nightly (90ef3372e 2017-10-29)
- New lints:
const_static_lifetime,erasing_op,fallible_impl_from,println_empty_string,useless_asref
- Rustup to rustc 1.22.0-nightly (b7960878b 2017-10-18)
- New lints:
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
- Rust upgrade to rustc 1.22.0-nightly (0e6f4cf51 2017-09-27)
- New lint:
mut_range_bound
- Update to rustc 1.22.0-nightly (6c476ce46 2017-09-25)
- New lint:
int_plus_one
- Update to rustc 1.22.0-nightly (14039a42a 2017-09-22)
- Update to rustc 1.22.0-nightly (0701b37d9 2017-09-18)
- New lint:
chars_last_cmp - Improved suggestions for
needless_borrow,ptr_arg,
- Update to rustc 1.22.0-nightly (539f2083d 2017-09-13)
- Update to rustc 1.22.0-nightly (dd08c3070 2017-09-12)
- Update to rustc 1.22.0-nightly (eba374fb2 2017-09-11)
- New lint:
clone_on_ref_ptr
- New lint:
manual_memcpy cast_losslessno longer has redundant parentheses in its suggestions- Update to rustc 1.22.0-nightly (dead08cb3 2017-09-08)
- Update to rustc 1.22.0-nightly (981ce7d8d 2017-09-03)
- New lint:
unit_expr
- Update to rustc 1.22.0-nightly (744dd6c1d 2017-09-02)
- Update to rustc 1.21.0-nightly (c11f689d2 2017-08-29)
- New lint:
infinite_iter,maybe_infinite_iter,cast_lossless
- Update to rustc 1.21.0-nightly (2c0558f63 2017-08-24)
- Fix
use_selftriggering inside derives - Add support for linting an entire workspace with
cargo clippy --all - New lint:
naive_bytecount
- Update to rustc 1.21.0-nightly (8c303ed87 2017-08-20)
- New lint:
use_self
- Update to rustc 1.21.0-nightly (df511d554 2017-08-14)
- Update to rustc 1.21.0-nightly (13d94d5fa 2017-08-10)
- Update to rustc 1.21.0-nightly (215e0b10e 2017-08-08)
- Update to rustc 1.21.0-nightly (37c7d0ebb 2017-07-31)
- New lints:
unreadable_literal,inconsistent_digit_grouping,large_digit_groups
- Update to rustc 1.21.0-nightly (aac223f4f 2017-07-30)
- Update to rustc 1.21.0-nightly (52a330969 2017-07-27)
- Fixes false positives in
inline_always - Fixes false negatives in
panic_params
- Update to rustc 1.20.0-nightly (afe145d22 2017-07-23)
- Update to rustc 1.20.0-nightly (086eaa78e 2017-07-15)
- Update to rustc 1.20.0-nightly (d84693b93 2017-07-09)
- Fix
cargo clippycrashing ondylibprojects - Fix false positives around
nested_while_letandnever_loop
- Update to rustc 1.20.0-nightly (067971139 2017-07-02)
- Rewrite of the
doc_markdownlint. - Deprecated
range_step_by_zero - New lint:
iterator_step_by_zero - New lint:
needless_borrowed_reference - Update to rustc 1.20.0-nightly (69c65d296 2017-06-28)
- Update to rustc 1.19.0-nightly (258ae6dd9 2017-06-15)
- Update to rustc 1.19.0-nightly (4bf5c99af 2017-06-10)
- Fix bugs with for loop desugaring
- Check for
AsRef/AsMutarguments inwrong_self_convention
- Update to rustc 1.19.0-nightly (0418fa9d3 2017-06-04)
- Update to rustc 1.19.0-nightly (6684d176c 2017-06-03)
- Update to rustc 1.19.0-nightly (557967766 2017-05-26)
- Update to rustc 1.19.0-nightly (5b13bff52 2017-05-23)
- Update to rustc 1.19.0-nightly (0ed1ec9f9 2017-05-18)
- Update to rustc 1.19.0-nightly (826d8f385 2017-05-13)
- Fix various bugs and some ices
- Update to rustc 1.19.0-nightly (2d4ed8e0c 2017-05-03)
- Update to rustc 1.19.0-nightly (6a5fc9eec 2017-05-02)
- Update to rustc 1.19.0-nightly (06fb4d256 2017-04-30)
- Update to rustc 1.18.0-nightly (94e884b63 2017-04-27)
- Update to rustc 1.18.0-nightly (036983201 2017-04-26)
- New lint:
needless_continue
- Update to rustc 1.18.0-nightly (2bd4b5c6d 2017-04-23)
- Update to rustc 1.18.0-nightly (9f2abadca 2017-04-18)
- Update to rustc 1.18.0-nightly (d5cf1cb64 2017-04-15)
- Fix various false positives
- Rustup to rustc 1.18.0-nightly (91ae22a01 2017-04-05)
- New lint:
op_ref
- Rustup to rustc 1.17.0-nightly (134c4a0f0 2017-03-20)
- Rustup to rustc 1.17.0-nightly (0aeb9c129 2017-03-15)
- Rustup to rustc 1.17.0-nightly (824c9ebbd 2017-03-12)
- Rustup to rustc 1.17.0-nightly (b1e31766d 2017-03-03)
- Rustup to rustc 1.17.0-nightly (be760566c 2017-02-28)
- Fix
cargo clippyon 64 bit windows systems
- Rustup to rustc 1.17.0-nightly (60a0edc6c 2017-02-26)
- New lints:
zero_ptr,never_loop,mut_from_ref
- Rustup to rustc 1.17.0-nightly (c49d10207 2017-02-07)
- Tests are now ui tests (testing the exact output of rustc)
- Rustup to rustc 1.16.0-nightly (eedaa94e3 2017-02-02)
- New lint:
large_enum_variant explicit_into_iter_loopprovides suggestions
- Rustup to rustc 1.16.0-nightly (df8debf6d 2017-01-25)
- Rustup to rustc 1.16.0-nightly (a52da95ce 2017-01-20)
- Add badges and categories to
Cargo.toml
- Update to rustc 1.16.0-nightly (c07a6ae77 2017-01-17)
- Update to rustc 1.16.0-nightly (2782e8f8f 2017-01-12)
- Update regex dependency
- Fix FP when matching
&&mutby&ref - Reintroduce
for (_, x) in &mut hash_map->for x in hash_map.values_mut() - New lints:
unused_io_amount,forget_ref,short_circuit_statement
- Fix FP introduced by rustup in
wrong_self_convention
- Update to rustc 1.16.0-nightly (468227129 2017-01-03)
- New lints:
deref_addrof,double_parens,pub_enum_variant_names - Fix suggestion in
new_without_default - FP fix in
absurd_extreme_comparisons
- Update to rustc 1.15.0-nightly (8f02c429a 2016-12-15)
- Update to rustc 1.15.0-nightly (d5814b03e 2016-11-23)
- Update to rustc 1.15.0-nightly (3bf2be9ce 2016-11-22)
- Update to rustc 1.15.0-nightly (7b3eeea22 2016-11-21)
- New lint:
string_extend_chars
- Update to rustc 1.15.0-nightly (ac635aa95 2016-11-18)
- Update to rustc 1.15.0-nightly (0ed951993 2016-11-14)
- New lint:
get_unwrap
- Fixes an issue due to a change in how cargo handles
--sysroot, which brokecargo clippy
- For convenience,
cargo clippydefines acargo-clippyfeature. This was previously added for a short time under the nameclippybut removed for compatibility. cargo clippy --helpis more helping (and less helpful 😄)- Rustup to rustc 1.14.0-nightly (5665bdf3e 2016-11-02)
- New lints:
if_let_redundant_pattern_matching,partialeq_ne_impl
- Rustup to rustc 1.14.0-nightly (f09420685 2016-10-20)
- New lint:
iter_skip_next
- Rustup to rustc 1.14.0-nightly (3210fd5c2 2016-10-05)
- Fixes bustage on Windows due to forbidden directory name
- Rustup to rustc 1.14.0-nightly (144af3e97 2016-10-02)
option_map_unwrap_orandoption_map_unwrap_or_elseare now allowed by default.- New lint:
explicit_into_iter_loop
- Rustup to rustc 1.14.0-nightly (289f3a4ca 2016-09-29)
- Rustup to rustc 1.13.0-nightly (d0623cf7b 2016-09-26)
- Rustup to rustc 1.13.0-nightly (f1f40f850 2016-09-09)
- Rustup to rustc 1.13.0-nightly (cbe4de78e 2016-09-05)
- Rustup to rustc 1.13.0-nightly (70598e04f 2016-09-03)
- The following lints are not new but were only usable through the
clippylint groups:filter_next,for_loop_over_option,for_loop_over_resultandmatch_overlapping_arm. You should now be able to#[allow/deny]them individually and they are available directly throughcargo clippy.
- Rustup to rustc 1.13.0-nightly (eac41469d 2016-08-30)
- New lints:
builtin_type_shadow - Fix FP in
zero_prefixed_literaland0b/0o
- Rustup to rustc 1.13.0-nightly (a23064af5 2016-08-27)
- New lints:
missing_docs_in_private_items,zero_prefixed_literal
- Fix ICE with
useless_attribute useless_attributeignoresunused_importsonusestatements
- Rustup to rustc 1.13.0-nightly (aef6971ca 2016-08-17)
- Rustup to rustc 1.12.0-nightly (1bf5fa326 2016-08-16)
- New lints:
print_with_newline,useless_attribute
- Rustup to rustc 1.12.0-nightly (197be89f3 2016-08-15)
- New lint:
module_inception
- Rustup to rustc 1.12.0-nightly (1deb02ea6 2016-08-12)
- New lints:
eval_order_dependence,mixed_case_hex_literals,unseparated_literal_suffix - False positive fix in
too_many_arguments - Addition of functionality to
needless_borrow - Suggestions for
clone_on_copy - Bug fix in
wrong_self_convention - Doc improvements
- Rustup to rustc 1.12.0-nightly (1225e122f 2016-07-30)
- New lints:
misrefactored_assign_op,serde_api_misuse
- Rustup to rustc 1.12.0-nightly (f93aaf84c 2016-07-09)
- Major suggestions refactoring
- Rustup to rustc 1.11.0-nightly (01411937f 2016-07-01)
- New lints:
wrong_transmute,double_neg,filter_map - For compatibility,
cargo clippydoes not defines theclippyfeature introduced in 0.0.76 anymore collapsible_ifnow considersif let
- Rustup to rustc 1.11.0-nightly (5522e678b 2016-06-20)
- New lints:
stutteranditer_nth
- Rustup to rustc 1.11.0-nightly (7d2f75a95 2016-06-09)
cargo clippynow automatically defines theclippyfeature- New lint:
not_unsafe_ptr_arg_deref
- Rustup to rustc 1.11.0-nightly (763f9234b 2016-06-06)
- Fix bug with
cargo-clippyJSON parsing - Add the
CLIPPY_DISABLE_DOCS_LINKSenvironment variable to deactivate the “for further information visit lint-link” message.
- Fix false positives in
useless_let_if_seq
- Fix false positives in
useless_let_if_seq
- Rustup to rustc 1.11.0-nightly (a967611d8 2016-05-30)
- New lint:
useless_let_if_seq
- Rustup to rustc 1.10.0-nightly (7bddce693 2016-05-27)
invalid_regexandtrivial_regexcan now warn onRegexSet::new,RegexBuilder::newand byte regexes
- Rustup to rustc 1.10.0-nightly (476fe6eef 2016-05-21)
used_underscore_bindinghas been madeAllowtemporarily
- Rustup to rustc 1.10.0-nightly (cd6a40017 2016-05-16)
- New lint:
unnecessary_operation
- Rustup to rustc 1.10.0-nightly (22ac88f1a 2016-05-11)
- New
cargo clippysubcommand - New lints:
assign_op_pattern,assign_ops,needless_borrow
- Rustup to rustc 1.10.0-nightly (62e2b2fb7 2016-05-06)
- New lints:
float_arithmetic,integer_arithmetic
- Rustup to rustc 1.10.0-nightly (645dd013a 2016-04-24)
- New lints:
temporary_cstring_as_ptr,unsafe_removed_from_name, andmem_forget
- Rustup to rustc 1.9.0-nightly (7979dd608 2016-04-07)
- Rustup to rustc 1.9.0-nightly (bf5da36f1 2016-04-06)
- Rustup to rustc 1.9.0-nightly (5ab11d72c 2016-04-02)
- New lint:
invalid_upcast_comparisons
- Rustup to rustc 1.9.0-nightly (e1195c24b 2016-03-31)
- Rustup to rustc 1.9.0-nightly (30a3849f2 2016-03-30)
- New lints:
logic_bug,nonminimal_bool - Fixed:
match_same_armsnow ignores arms with guards - Improved:
useless_vecnow warns onfor … in vec![…]
- Rustup to rustc 1.9.0-nightly (d5a91e695 2016-03-26)
- New lint:
doc_markdown
- Update to rustc 1.9.0-nightly (a1e29daf1 2016-03-25)
- Deprecated lints:
str_to_string,string_to_string,unstable_as_slice,unstable_as_mut_slice - New lint:
crosspointer_transmute
- Update to rustc 1.9.0-nightly (0dcc413e4 2016-03-22)
- New lints:
many_single_char_namesandsimilar_names
- Update to rustc 1.9.0-nightly (02310fd31 2016-03-19)
- Update to rustc 1.9.0-nightly (c66d2380a 2016-03-15)
- Add a configuration file
- Add
strto types considered bylen_zero - New lints:
indexing_slicing
- Update to rustc 1.9.0-nightly (c9629d61c 2016-03-10)
- Update to rustc 1.9.0-nightly (eabfc160f 2016-03-08)
- New lints:
overflow_check_conditional,unused_label,new_without_default
- Fixed: ICE in
needless_range_loopwith globals
- Update to rustc 1.9.0-nightly (998a6720b 2016-03-07)
- New lint:
redundant_closure_call