363 KiB
Changelog
All notable changes to this project will be documented in this file. See Changelog Update if you want to update this document.
Unreleased / Beta / In Rust Nightly
Rust 1.85
Current stable, released 2025-02-20
View all 72 merged pull requests
New Lints
- Added
repr_packed_without_abitosuspicious#13398 - Added
as_pointer_underscoretorestriction#13251 - Added
doc_nested_refdefstosuspicious#13707 - Added
literal_string_with_formatting_argstonursery#13410 - Added
doc_include_without_cfgtorestriction#13625
Enhancements
indexing_slicing: Can now be allowed in tests using theallow-indexing-slicing-in-testsconfiguration #13854if_let_mutex: disable lint from Edition 2024 since if_let_rescope was stabilized #13695format_in_format_args,recursive_format_impl,to_string_in_format_args,uninlined_format_args,unused_format_specs: Can now support 3rd party format macros if they're marked with the#[clippy::format_args]attribute #9948
ICE Fixes
trait_duplication_in_bounds: fix ICE on duplicate type or constant bound #13722
Others
clippy_utilsis now published to crates.io. Note that this crate is and will remain unstable. #13700
Rust 1.84
Released 2025-01-09
View all 84 merged pull requests
New Lints
- Added
unnecessary_map_ortostyle#11796 - Added
arbitrary_source_item_orderingtorestriction#13376 - Added
map_with_unused_argument_over_rangestorestriction#13034 - Added
map_all_any_identitytocomplexity#13499 - Added
needless_as_bytestocomplexity#13437 - Added
unnecessary_literal_boundtopedantic#13395 - Added
manual_ignore_case_cmptoperf#13334 - Added
regex_creation_in_loopstoperf#13412
Moves and Deprecations
- Moved
manual_is_power_of_twotopedantic(Fromcomplexity, now allow-by-default) #13553 - Move
module_name_repetitionstorestriction(frompedantic) #13541
Enhancements
doc_markdown: Added the following identifiers todoc-valid-idents: CoAP, MHz, GHz, and THz #13633 #13460large_const_arrays: Changed the default ofarray-size-thresholdto16kb(from512kb) #13485
Rust 1.83
Released 2024-11-28
View all 64 merged pull requests
Important Change
- Removed the implicit
cargo-clippyfeature set by Clippy as announced here: https://blog.rust-lang.org/2024/02/28/Clippy-deprecating-feature-cargo-clippy.html #13246
New Lints
- Added
unused_trait_namestorestriction#13322 - Added
unnecessary_first_then_checktocomplexity#13421 - Added
non_zero_suggestionstorestriction#13167 - Added
manual_is_power_of_twotopedantic#13327 - Added
manual_div_ceiltocomplexity#12987 - Added
zombie_processestosuspicious#11476 - Added
used_underscore_itemstopedantic#13294
Moves and Deprecations
- Moved
ref_optiontopedantic(Fromnursery) #13469 - Moved
manual_c_str_literalstocomplexity(Frompedantic, now warn-by-default) #13263 - Moved
empty_line_after_doc_commentstosuspicious(Fromnursery, now warn-by-default) #13091 - Moved
empty_line_after_outer_attrtosuspicious(Fromnursery, now warn-by-default) #13091
Enhancements
missing_panics_doc: No longer lints in const environments #13382
Rust 1.82
Released 2024-10-17
View all 108 merged pull requests
New Lints
- Added
too_long_first_doc_paragraphtonursery#12993 - Added
unused_result_oktorestriction#12150 - Added
pathbuf_init_then_pushtorestriction#11700
Enhancements
explicit_iter_loop: Now respects themsrvconfiguration #13288assigning_clones: No longer lints in test code #13273inconsistent_struct_constructor: Lint attributes now work on the struct definition #13211set_contains_or_insert: Now also checks forBTreeSet#13053doc_markdown: Added the following identifiers todoc-valid-idents: AccessKit, CoreFoundation, CoreGraphics, CoreText, Direct2D, Direct3D, DirectWrite, PostScript, OpenAL, OpenType, WebRTC, WebSocket, WebTransport, NetBSD, and OpenBSD #13093
ICE Fixes
Rust 1.81
Released 2024-09-05
New Lints
- Added
cfg_not_testtorestriction#11293 - Added
byte_char_slicestostyle#10155 - Added
set_contains_or_inserttonursery#12873 - Added
manual_rotatetostyle#12983 - Added
unnecessary_min_or_maxtocomplexity#12368 - Added
manual_inspecttocomplexity#12287 - Added
field_scoped_visibility_modifierstorestriction#12893 - Added
manual_pattern_char_comparisontostyle#12849 - Added
needless_maybe_sizedtosuspicious#10632 - Added
needless_character_iterationtosuspicious#12815
Moves and Deprecations
allow_attributes,allow_attributes_without_reason: Now work on stable rust#120924- Renamed
overflow_check_conditionaltopanicking_overflow_checks#12944 - Moved
panicking_overflow_checkstocorrectness(Fromcomplexitynow deny-by-default) #12944 - Renamed
thread_local_initializer_can_be_made_consttomissing_const_for_thread_local#12974 - Deprecated
maybe_misused_cfgandmismatched_target_osas they are now caught by cargo and rustc #12875
Enhancements
significant_drop_in_scrutinee: Now also checks scrutinies ofwhile letandfor letexpressions #12870std_instead_of_core: Now respects themsrvconfiguration #13168
ICE Fixes
suboptimal_flops: No longer crashes on custom.log()functions #12884
Rust 1.80
Current stable, released 2024-07-25
View all 68 merged pull requests
New Lints
- Added
while_floattonursery#12765 - Added
macro_metavars_in_unsafetosuspicious#12107 - Added
renamed_function_paramstorestriction#11540 - Added
doc_lazy_continuationtostyle#12770
Moves and Deprecations
- Moved
assigning_clonestopedantic(Fromperfnow allow-by-default) #12779 - Moved
single_char_patterntopedantic(Fromperfnow allow-by-default) #11852
Enhancements
panic: Addedallow-panic-in-testsconfiguration to allow the lint in tests #12803missing_const_for_fn: Now respects themsrvconfiguration #12713missing_panics_doc: No longer lints on compile-time panics #12790collapsible_match: Now considers themsrvconfiguration for the suggestion #12745useless_vec: Addedallow-useless-vec-in-testsconfiguration to allow the lint in tests #12725
Suggestion Fixes/Improvements
single_match,single_match_else: Suggestions are now machine-applicable #12726
Rust 1.79
Released 2024-06-13
View all 102 merged pull requests
New Lints
- Added
legacy_numeric_constantstostyle#12312 - Added
missing_transmute_annotationstosuspicious#12239 - Added
integer_division_remainder_usedtorestriction#12451 - Added
duplicated_attributestosuspicious#12378 - Added
manual_unwrap_or_defaulttosuspicious#12440 - Added
zero_repeat_side_effectstosuspicious#12449 - Added
const_is_emptytosuspicious#12310
Moves and Deprecations
- Moved
box_defaulttostyle(Fromperf) #12601 - Moved
manual_clamptocomplexity(Fromnurserynow warn-by-default) #12543 - Moved
readonly_write_locktoperf(Fromnurserynow warn-by-default) #12479
Enhancements
module_name_repetitions: Added theallowed-prefixesconfiguration to allow common prefixes. #12573cast_sign_loss,cast_possible_truncation,cast_lossless: Are now allowed in macros #12631manual_clamp: Now only lints on constant min and max values #12543assigning_clones: Now considers themsrvconfiguration #12511needless_return,useless_let_if_seq,mut_mut,read_zero_byte_vec,unused_io_amount,unused_peekable: Now respects#[allow]attributes on the affected statement instead #12446
False Positive Fixes
cast_lossless: No longer lints when casting tou128#12496std_instead_of_coreNo longer lints on modules that are only instd#12447
ICE Fixes
needless_return: No longer crashes on non-ascii characters #12493
Rust 1.78
Released 2024-05-02
View all 112 merged pull requests
New Lints
assigning_clones#12077mixed_attributes_style#12354empty_docs#12342unnecessary_get_then_check#12339multiple_bound_locations#12259unnecessary_clippy_cfg#12303deprecated_clippy_cfg_attr#12292manual_c_str_literals#11919ref_as_ptr#12087lint_groups_priority#11832unnecessary_result_map_or_else#12169to_string_trait_impl#12122incompatible_msrv#12160
Enhancements
thread_local_initializer_can_be_made_const: Now checks themsrvconfiguration #12405disallowed_macros: Code generated by derive macros can no longer allow this lint #12267wildcard_imports: Add configurationallowed-wildcard-importsto allow preconfigured wildcards #11979
ICE Fixes
ptr_as_ptr: No longer ICEs when the cast source is a function call to a local variable #12617cast_sign_loss: Avoids an infinite loop when casting two chained.unwrap()calls #12508
Rust 1.77
Released 2024-03-18
View all 93 merged pull requests
New Lints
suspicious_open_options#11608option_as_ref_cloned#12051thread_local_initializer_can_be_made_const#12026str_split_at_newline#11987empty_enum_variants_with_brackets#12047manual_is_variant_and#11865pub_underscore_fields#10283eager_transmute#11981iter_filter_is_some#12004iter_filter_is_ok#12004result_filter_map#11869unconditional_recursion#11938
Enhancements
multiple_crate_versions: Added theallowed-duplicate-cratesconfiguration to allow specific crates #12179single_call_fn: No longer ignores#[allow]attributes #12183read_zero_byte_vec: Updated the heuristics used for linting #11766
ICE Fixes
unit_arg: No longer crashes when checking for const in nested bodies #11977indexing_slicing: No longer crashes when the array index exceedsusize#12266
Others
- Warnings about invalid fields inside
clippy.tomlfiles now include suggestions for existing fields #12180
Rust 1.76
Released 2024-02-08
View all 85 merged pull requests
New Lints
infinite_loop#11829ineffective_open_options#11902uninhabited_references#11878repeat_vec_with_capacity#11597test_attr_in_doctest#11872option_map_or_err_ok#11864join_absolute_paths#11453impl_hash_borrow_with_str_and_bytes#11781iter_over_hash_type#11791
Moves and Deprecations
- Renamed
blocks_in_if_conditionstoblocks_in_conditions#11853 - Moved
implied_bounds_in_implstocomplexity(Now warn-by-default) #11867 - Moved
if_same_then_elsetostyle(Now warn-by-default) #11809
Enhancements
missing_safety_doc,unnecessary_safety_doc,missing_panics_doc,missing_errors_doc: Added thecheck-private-itemsconfiguration to enable lints on private items #11842
ICE Fixes
impl_trait_in_params: No longer crashes when a function has generics but no function parameters #11804unused_enumerate_index: No longer crashes on empty tuples #11756
Others
- Clippy now respects the
CARGOenvironment value #11944
Rust 1.75
Released 2023-12-28
View all 69 merged pull requests
New Lints
unused_enumerate_index#10404unnecessary_fallible_conversions#11669waker_clone_wake#11698struct_field_names#11496into_iter_without_iter#11587iter_without_into_iter#11527manual_hash_one#11556
Moves and Deprecations
- Moved
read_zero_byte_vectonursery(Now allow-by-default) #11727 - Moved
missing_enforced_import_renamestostyle(Now warn-by-default) #11539 - Moved
needless_raw_string_hashestopedantic(Now allow-by-default) #11415 - Moved
needless_pass_by_ref_muttonursery(Now allow-by-default) #11596
Enhancements
declare_interior_mutable_constandborrow_interior_mutable_const: Now check theignore-interior-mutabilityconfig value #11678
Suggestion Fixes/Improvements
items_after_test_module: The suggestion is now machine-applicable #11611
ICE Fixes
redundant_locals: No longer crashes if variables are rebound above macros #11623implicit_hasher: No longer lints inside macros, which could cause ICEs #11593
Documentation Improvements
cargo clippy --helpnow uses colors for readability 🎉
Rust 1.74
Released 2023-11-16
View all 94 merged pull requests
New Lints
redundant_as_str#11526needless_borrows_for_generic_args#11511path_ends_with_ext#11483unnecessary_map_on_constructor#11413missing_asserts_for_indexing#10692iter_out_of_bounds#11396implied_bounds_in_impls#11362reserve_after_initialization#11373should_panic_without_expect#11204
Moves and Deprecations
- Renamed
incorrect_clone_impl_on_copy_typetonon_canonical_clone_impl#11358 - Renamed
incorrect_partial_ord_impl_on_ord_typetonon_canonical_partial_ord_impl#11358 - Moved
non_canonical_clone_impltosuspicious(Now warn-by-default) #11358 - Moved
non_canonical_partial_ord_impltosuspicious(Now warn-by-default) #11358 - Moved
needless_pass_by_ref_muttonursery(Now allow-by-default) #11596
Enhancements
undocumented_unsafe_blocks: The config valuesaccept-comment-above-statementandaccept-comment-above-attributesare nowtrueby default #11170explicit_iter_loop: Addedenforce-iter-loop-reborrowto disable reborrow linting by default #11418
ICE Fixes
enum_variant_names: No longer crashes if the threshold is 0 and the enum has no variants #11552cast_possible_truncation: No longer crashes on values larger thanu64::MAX#11517tuple_array_conversions: No longer crashes if the array length is not usize #11379useless_conversion: No longer crashes, when the receiver is a non-fn item #11070
Rust 1.73
Released 2023-10-05
View all 103 merged pull requests
New Lints
impossible_comparisons#10843redundant_comparisons#10843ignored_unit_patterns#11242readonly_write_lock#11210filter_map_bool_then#11115needless_return_with_question_mark#11031redundant_guards#10955redundant_locals#10885absolute_paths#11003error_impl_error#11107iter_skip_zero#11046string_lit_chars_any#11052four_forward_slashes#11140format_collect#11116needless_pass_by_ref_mut#10900manual_is_infinite#11049manual_is_finite#11049incorrect_partial_ord_impl_on_ord_type#10788read_line_without_trim#10970type_id_on_box#10987
Moves and Deprecations
- Renamed
unwrap_or_else_defaulttounwrap_or_default#10120 - Moved
tuple_array_conversionstopedantic(Now allow-by-default) #11146 - Moved
arc_with_non_send_synctosuspicious(Now warn-by-default) #11104 - Moved
needless_raw_string_hashestopedantic(Now allow-by-default) #11415
Enhancements
unwrap_used: No longer lints on the never-type or never-like enums #11252expect_used: No longer lints on the never-type or never-like enums #11252
False Positive Fixes
panic_in_result_fn: No longer triggers ontodo!,unimplemented!,unreachable!#11123
Suggestion Fixes/Improvements
semicolon_if_nothing_returned: The suggestion is now machine-applicable with rustfix #11083
ICE Fixes
filter_map_bool_then: No longer crashes on late-bound regions #11318unwrap_or_default: No longer crashes on alias types for local items #11258unnecessary_literal_unwrap: No longer crashes onNone.unwrap_or_default()#11106- Fixed MIR-related ICE #11130
missing_fields_in_debug: No longer crashes on non-ADT self types #11069
Rust 1.72
Released 2023-08-24
View all 131 merged pull requests
New Lints
manual_try_fold#11012tuple_array_conversions#11020redundant_at_rest_pattern#11013needless_pub_self#10967pub_with_shorthand#10967pub_without_shorthand#10967manual_range_patterns#10968needless_raw_string_hashes#10884needless_raw_strings#10884incorrect_clone_impl_on_copy_type#10925drain_collect#10835single_range_in_vec_init#10934unnecessary_literal_unwrap#10358large_stack_frames#10827min_ident_chars#10916needless_if#10921excessive_nesting#10672arc_with_non_send_sync#10898redundant_type_annotations#10570host_endian_bytes#10826little_endian_bytes#10826big_endian_bytes#10826ptr_cast_constness#10779needless_else#10810
Moves and Deprecations
- Moved
redundant_clonetonursery(Now allow-by-default) #10873
Enhancements
undocumented_unsafe_blocks: Addedaccept-comment-above-attributesconfiguration #10986undocumented_unsafe_blocks: Addedaccept-comment-above-statementconfiguration. #10886missing_panics_doc: No longer lints ontodo!()#10976module_inception: Addedallow-private-module-inceptionconfiguration. #10917- Errors and warnings generated while parsing
clippy.tomlnow point to the location in the TOML file the error/warning occurred in. #10607
False Positive Fixes
excessive_precision: No longer lints overflowing literals #10952
Suggestion Fixes/Improvements
option_map_unwrap_or: The suggestion now considers the setmsrvconfig value #11030
Documentation Improvements
- Clippy's lint list now stores filter parameters in the URL, to allow easy sharing #10834
Rust 1.71
Released 2023-07-13
Note: Clippy will use a shorter changelog format from now on, if you want a detailed list of all changes, please check out the list of merged pull requests.
View all 78 merged pull requests
New Lints
non_minimal_cfg#10763manual_next_back#10769ref_patterns#10736default_constructed_unit_structs#10716manual_while_let_some#10647needless_bool_assign#10432items_after_test_module#10578
Moves and Deprecations
- Rename
integer_arithmetictoarithmetic_side_effects#10674 - Moved
redundant_clonetonursery(Now allow-by-default) #10873
Enhancements
invalid_regex: Now supports the new syntax introduced after regex v1.8.0 #10682semicolon_outside_block: Addedsemicolon-outside-block-ignore-multilineas a new config value. #10656semicolon_inside_block: Addedsemicolon-inside-block-ignore-singlelineas a new config value. #10656unnecessary_box_returns: Addedunnecessary-box-sizeas a new config value to set the maximum size ofTinBox<T>to be linted. #10651
Documentation Improvements
cargo clippy --explain LINTnow shows possible configuration options for the explained lint #10751- New config values mentioned in this changelog will now be linked. #10889
- Several sections of Clippy's book have been reworked #10652 #10622
Rust 1.70
Released 2023-06-01
View all 91 merged pull requests
New Lints
large_futures#10414missing_assert_message#10362clear_with_drain#10528redundant_async_block#10448collection_is_never_read#10415let_with_type_underscore#10467tests_outside_test_module#10543allow_attributes#10481suspicious_doc_comments#10497unnecessary_box_returns#9102manual_main_separator_str#10483unnecessary_struct_initialization#10489manual_slice_size_calculation#10601lines_filter_map_ok#10534
Moves and Deprecations
- Moved
let_underscore_untypedtorestriction#10442
Enhancements
extra_unused_type_parameters: No longer lints on public items ifavoid-breaking-exported-apiis set #10536len_without_is_empty: Now also detectsasyncfunctions #10359arithmetic_side_effects: Now correctly handles divisions and modulo expressions if the right-hand-side is unknown #10585nonminimal_bool: No longer ignores#[allow]attributes #10588uninit_vec,uninit_assumed_init: Now uses a better heuristic #10520ifs_same_cond: Now also detects immutable method calls. #10350arithmetic_side_effects: No longer lints on right or left shifts with constant integers, as the compiler warns about them #10309items_after_statements:#[allow(items_after_statements)]now works on items #10542significant_drop_tightening: Was optimized #10533
False Positive Fixes
single_component_path_imports: No longer lints if the import is used relative toself#10566derivable_impls: No longer suggests derivingDefaulton generics with implicit arguments #10399let_unit_value: No longer lints if the expression contains anawait#10439double_must_use: Now ignoresasyncfunctions #10589manual_clamp: No longer lints in constant context #10479almost_swapped: Now ignores external macros #10502nonminimal_bool: Now ignores macros #10527needless_return: No longer lints match statements with incompatible branches #10593use_self: Do not suggest usingSelfin const generic parameters #10375mem_replace_option_with_none: No longer lints on field expressions #10594items_after_statements: No longer lints on items from macros #10542print_literal,write_literal: No longer lint strings coming from thefile!()macro #10573uninit_vec,uninit_assumed_init: Now check the types inside arrays and tuples #10553almost_swapped: No longer lints if a variable is assigned to itself #10499missing_docs_in_private_items: No longer lints on public items #10324
Suggestion Fixes/Improvements
extra_unused_type_parameters: The suggestion is now machine applicable #10536match_single_binding: Now adds a semicolon after the suggestion #10470missing_const_for_fn: Now includes a note if the change could break compatibility #10618cast_possible_truncation: Corrected suggestion for float and wildcard casts #10496transmutes_expressible_as_ptr_casts: The suggestion now includes parentheses when they are required #10454
ICE Fixes
needless_borrow: No longer panics on ambiguous projections #10403multiple_unsafe_ops_per_block: Fix ICE when calling a function-like object in an unsafe block #10405
Others
clippy-drivernow searches parent directories forclippy.tomlfiles #10592- Fixed a deserialization error for the
array-size-thresholdconfig value #10423
Rust 1.69
Released 2023-04-20
View all 72 merged pull requests
New Lints
no_mangle_with_rust_abi#10369significant_drop_tightening#10163suspicious_command_arg_space#10317let_underscore_untyped#10356question_mark_used#10342extra_unused_type_parameters#10028impl_trait_in_params10197transmute_int_to_non_zero#10360multiple_unsafe_ops_per_block#10206
Moves and Deprecations
- Moved
uninlined_format_argstopedantic(Now allow-by-default) #10265 - Moved
unchecked_duration_subtractiontopedantic(Now allow-by-default) #10194
Enhancements
arithmetic_side_effects: No longer lints if safe constant values are used. #10310needless_lifetimes: Now works in local macros #10257unused_io_amount: Now detects usages ofis_okandis_err#10225missing_docs_in_private_items: Added new configurationmissing-docs-in-crate-itemsto lint on items visible within the current crate. For example,pub(crate)items. #10303almost_swapped: Now detects almost swaps usingletstatements #10177wildcard_enum_match_arm: Now lints missing private variants, for local enums #10250
False Positive Fixes
explicit_auto_deref: Now considers projections when determining if auto deref is applicable #10386manual_let_else: Now considers side effects of branches before linting #10336uninlined_format_args: No longer lints for arguments with generic parameters #10343needless_lifetimes: No longer lints signatures in macros if the lifetime is a metavariable #10380len_without_is_empty: No longer lints iflenas a non-default signature #10255unusual_byte_groupings: Relaxed the required restrictions for specific sizes to reduce false positives #10353manual_let_else: No longer lintsif-elseblocks if they can divergent #10332expect_used,unwrap_used,dbg_macro,print_stdout,print_stderr: No longer lint in test functions ifallow-expect-in-testsis set #10391unnecessary_safety_comment: No longer lints code inside macros #10106never_loop: No longer lints statements following break statements for outer blocks. #10311
Suggestion Fixes/Improvements
box_default: The suggestion now includes the type for trait objects when needed #10382cast_possible_truncation: Now suggests usingtry_fromor allowing the lint #10038invalid_regex: Regex errors for non-literals or regular strings containing escape sequences will now show the complete error #10231transmutes_expressible_as_ptr_casts: The suggestion now works if the base type is borrowed #10193needless_return: Now removes all semicolons on the same line #10187suspicious_to_owned: The suggestion now shows all options clearly #10295bytes_nth: Now suggests the correct replacement based on the context #10361bool_assert_comparison: The suggestion is now machine applicable #10218cast_possible_truncation: Corrected the lint name in the help message #10330needless_return: The suggestion now works on if sequences #10345needless_lifetimes: The suggestion is now machine applicable #10222map_entry: The suggestion no longer expands macros #10346
ICE Fixes
needless_pass_by_value: Fixed an ICE caused by how late bounds were handled #10328needless_borrow: No longer panics on ambiguous projections #10403
Documentation Improvements
- All configurations are now documented in the Clippy Book #10199
Rust 1.68
Released 2023-03-09
View all 76 merged pull requests
New Lints
permissions_set_readonly_false#10063almost_complete_range#10043size_of_ref#10098semicolon_outside_block#9826semicolon_inside_block#9826transmute_null_to_fn#10099fn_null_check#10099
Moves and Deprecations
- Moved
manual_clamptonursery(Now allow-by-default) #10101 - Moved
mutex_atomictorestriction#10115 - Renamed
derive_hash_xor_eqtoderived_hash_with_manual_eq#10184
Enhancements
collapsible_str_replace: Now takes MSRV into consideration. The minimal version is 1.58 #10047unused_self: No longer lints, if the method body contains atodo!()call #10166derivable_impls: Now suggests derivingDefaultfor enums with default unit variants #10161arithmetic_side_effects: Added two new config valuesarithmetic-side-effects-allowed-binaryandarithmetic-side-effects-allowed-unaryto allow operation on user types #9840large_const_arrays,large_stack_arrays: avoid integer overflow when calculating total array size #10103indexing_slicing: add new configsuppress-restriction-lint-in-constto enable restriction lints, even if the suggestion might not be applicable #9920needless_borrow,redundant_clone: Now track references better and detect more cases #9701derived_hash_with_manual_eq: Now allows#[derive(PartialEq)]with customHashimplementations #10184manual_is_ascii_check: Now detects ranges with.contains()calls #10053transmuting_null: Now detectsconstpointers to all types #10099needless_return: Now detects more cases for returns of owned values #10110
False Positive Fixes
field_reassign_with_default: No longer lints cases, where values are initializes from closures capturing struct values #10143seek_to_start_instead_of_rewind: No longer lints, if the return ofseekis used. #10096manual_filter: Now ignores if expressions where the else branch has side effects or doesn't returnNone#10091implicit_clone: No longer lints if the type doesn't implement clone #10022match_wildcard_for_single_variants: No longer lints on wildcards with a guard #10056drop_ref: No longer lints idiomatic expression inmatcharms #10142arithmetic_side_effects: No longer lints on corner cases with negative number literals #9867string_lit_as_bytes: No longer lints in scrutinies ofmatchstatements #10012manual_assert: No longer lints inelse ifstatements #10013needless_return: don't lint when usingdo yeet#10109- All lints: No longer lint in enum discriminant values when the suggestion won't work in a const context #10008
single_element_loop: No longer lints, if the loop contains abreakorcontinue#10162uninlined_format_args: No longer suggests inlining arguments inassert!anddebug_assert!macros before 2021 edition #10055explicit_counter_loop: No longer ignores counter changes aftercontinueexpressions #10094from_over_into: No longer lints on opaque types #9982expl_impl_clone_on_copy: No longer lints on#[repr(packed)]structs with generic parameters #10189
Suggestion Fixes/Improvements
zero_ptr: Now suggestscore::paths forno_stdcrates #10023useless_conversion: Now suggests removing calls tointo_iter()on an expression implementingIterator#10020box_default: The suggestion now uses short paths #10153default_trait_access,clone_on_copy: The suggestion now uses short paths #10160comparison_to_empty: The suggestion now removes unused deref operations #9962manual_let_else: Suggestions for or-patterns now include required brackets. #9966match_single_binding: suggestion no longer introduces unneeded semicolons #10060case_sensitive_file_extension_comparisons: Now displays a suggestion withPath#10107empty_structs_with_brackets: The suggestion is no longer machine applicable, to avoid errors when accessing struct fields #10141identity_op: Removes borrows in the suggestion when needed #10004suboptimal_flops: The suggestion now includes parentheses when required #10113iter_kv_map: Now handlesmutand reference annotations in the suggestion #10159redundant_static_lifetimes: The suggestion no longer removesmutfrom references #10006
ICE Fixes
new_ret_no_self: Now avoids a stack overflow forimpl Traittypes #10086unnecessary_to_owned: Now handles compiler generated notes better #10027
Others
SYSROOTand--sysrootcan now be set at the same time #10149- Fix error when providing an
array-size-thresholdinclippy.toml#10423
Rust 1.67
Released 2023-01-26
View all 104 merged pull requests
New Lints
seek_from_current#9681from_raw_with_void_ptr#9690misnamed_getters#9770seek_to_start_instead_of_rewind#9667suspicious_xor_used_as_pow#9506unnecessary_safety_doc#9822unchecked_duration_subtraction#9570manual_is_ascii_check#9765unnecessary_safety_comment#9851let_underscore_future#9760manual_let_else#8437
Moves and Deprecations
- Moved
needless_collecttonursery(Now allow-by-default) #9705 - Moved
or_fun_calltonursery(Now allow-by-default) #9829 - Uplifted
let_underscore_lockinto rustc #9697 - Uplifted
let_underscore_dropinto rustc #9697 - Moved
bool_to_int_with_iftopedantic(Now allow-by-default) #9830 - Move
index_refutable_slicetopedantic(Now warn-by-default) #9975 - Moved
manual_clamptonursery(Now allow-by-default) #10101
Enhancements
- The scope of
#![clippy::msrv]is now tracked correctly #9924 #[clippy::msrv]can now be used as an outer attribute #9860- Clippy will now avoid Cargo's cache, if
Cargo.tomlorclippy.tomlhave changed #9707 uninlined_format_args: Added a new configallow-mixed-uninlined-format-argsto allow the lint, if only some arguments can be inlined #9865needless_lifetimes: Now provides suggests for individual lifetimes #9743needless_collect: Now detects needlessis_emptyandcontainscalls #8744blanket_clippy_restriction_lints: Now lints, ifclippy::restrictionis enabled via the command line arguments #9755mutable_key_type: Now has theignore-interior-mutabilityconfiguration, to add types which should be ignored by the lint #9692uninlined_format_args: Now works for multilineformat!expressions #9945cognitive_complexity: Now works for async functions #9828 #9836vec_box: Now avoids an off-by-one error when using thevec-box-size-thresholdconfiguration #9848never_loop: Now correctly handles breaks in nested labeled blocks #9858 #9837disallowed_methods,disallowed_types,disallowed_macros: Now correctly resolve paths, if a crate is used multiple times with different versions #9800disallowed_methods: Can now be used for local methods #9800print_stdout,print_stderr: Can now be enabled in test with theallow-print-in-testsconfig value #9797from_raw_with_void_ptr: Now works forRc,Arc,alloc::rc::Weakandalloc::sync::Weaktypes. #9700needless_borrowed_reference: Now works for struct and tuple patterns with wildcards #9855or_fun_call: Now supportsmap_ormethods #9689unwrap_used,expect_used: No longer lints in test code #9686fn_params_excessive_bools: Is now emitted with the lint level at the linted function #9698
False Positive Fixes
new_ret_no_self: No longer lints whenimpl Trait<Self>is returned #9733unnecessary_lazy_evaluations: No longer lints, if the type has a significant drop #9750option_if_let_else: No longer lints, if any arm has guard #9747explicit_auto_deref: No longer lints, if the target type is a projection with generic arguments #9813unnecessary_to_owned: No longer lints, if the suggestion effects types #9796needless_borrow: No longer lints, if the suggestion is affected byDeref#9674unused_unit: No longer lints, if lifetimes are bound to the return type #9849mut_mut: No longer lints cases with unsized mutable references #9835bool_to_int_with_if: No longer lints in const context #9738use_self: No longer lints in macros #9704unnecessary_operation: No longer lints, if multiple macros are involved #9981allow_attributes_without_reason: No longer lints inside external macros #9630question_mark: No longer lints forif let Err()with anelsebranch #9722unnecessary_cast: No longer lints if the identifier and cast originate from different macros #9980arithmetic_side_effects: Now detects operations with associated constants #9592explicit_auto_deref: No longer lints, if the initial value is not a reference or reference receiver #9997module_name_repetitions,single_component_path_imports: Now handle#[allow]attributes correctly #9879bool_to_int_with_if: No longer lintsif letstatements #9714needless_borrow: No longer lints,if-else-statements that require the borrow #9791needless_borrow: No longer lints borrows, if moves were illegal #9711manual_swap: No longer lints in const context #9871
Suggestion Fixes/Improvements
missing_safety_doc,missing_errors_doc,missing_panics_doc: No longer show the entire item in the lint emission. #9772needless_lifetimes: Only suggests'_when it's applicable #9743use_self: Now suggests full paths correctly #9726redundant_closure_call: Now correctly deals with macros during suggestion creation #9987unnecessary_cast: Suggestions now correctly deal with references #9996unnecessary_join: Suggestions now correctly use turbofish operators #9779equatable_if_let: Can now suggestmatches!replacements #9368string_extend_chars: Suggestions now correctly work forstrslices #9741redundant_closure_for_method_calls: Suggestions now include angle brackets and generic arguments if needed #9745manual_let_else: Suggestions no longer expand macro calls #9943infallible_destructuring_match: Suggestions now preserve references #9850result_large_err: The error now shows the largest enum variant #9662needless_return: Suggestions are now formatted better #9967unused_rounding: The suggestion now preserves the original float literal notation #9870
ICE Fixes
result_large_err: Fixed ICE for empty enums #10007redundant_allocation: Fixed ICE for types with bounded variables #9773unused_rounding: Fixed ICE, if_was used as a separator #10001
Rust 1.66
Released 2022-12-15
View all 116 merged pull requests
New Lints
manual_clamp#9484missing_trait_methods#9670unused_format_specs#9637iter_kv_map#9409manual_filter#9451box_default#9511implicit_saturating_add#9549as_ptr_cast_mut#9572disallowed_macros#9495partial_pub_fields#9658uninlined_format_args#9233cast_nan_to_int#9617
Moves and Deprecations
positional_named_format_parameterswas uplifted to rustc under the new namenamed_arguments_used_positionally#8518- Moved
implicit_saturating_subtostyle(Now warn-by-default) #9584 - Moved
derive_partial_eq_without_eqtonursery(now allow-by-default) #9536
Enhancements
nonstandard_macro_braces: Now includesmatches!()in the default lint config #9471suboptimal_flops: Now supports multiplication and subtraction operations #9581arithmetic_side_effects: Now detects cases with literals behind references #9587upper_case_acronyms: Now also checks enum names #9580needless_borrowed_reference: Now lints nested patterns #9573unnecessary_cast: Now works for non-trivial non-literal expressions #9576arithmetic_side_effects: Now detects operations with custom types #9559disallowed_methods,disallowed_types: Not correctly lints types, functions and macros with the same path #9495self_named_module_files,mod_module_files: Now take remapped path prefixes into account #9475bool_to_int_with_if: Now detects the inverse if case #9476
False Positive Fixes
arithmetic_side_effects: Now allows operations that can't overflow #9474unnecessary_lazy_evaluations: No longer lints in external macros #9486needless_borrow,explicit_auto_deref: No longer lint on unions that require the reference #9490almost_complete_letter_range: No longer lints in external macros #9467drop_copy: No longer lints on idiomatic cases in match arms #9491question_mark: No longer lints in const context #9487collapsible_if: Suggestion now work in macros #9410std_instead_of_core: No longer triggers on unstable modules #9545unused_peekable: No longer lints, if the peak is done in a closure or function #9465useless_attribute: No longer lints on#[allow]attributes forunsafe_removed_from_name#9593unnecessary_lazy_evaluations: No longer suggest switching to early evaluation when type has customDropimplementation #9551unnecessary_cast: No longer lints on negative hexadecimal literals when cast as floats #9609use_self: No longer lints in proc macros #9454never_loop: Now takeslet ... elsestatements into consideration. #9496default_numeric_fallback: Now ignores constants #9636uninit_vec: No longer lintsVec::set_len(0)#9519arithmetic_side_effects: Now ignores references to integer types #9507large_stack_arrays: No longer lints inside static items #9466ref_option_ref: No longer lints if the inner reference is mutable #9684ptr_arg: No longer lints if the argument is used as an incomplete trait object #9645should_implement_trait: Now also works fordefaultmethods #9546
Suggestion Fixes/Improvements
derivable_impls: The suggestion is now machine applicable #9429match_single_binding: The suggestion now handles scrutinies with side effects better #9601zero_prefixed_literal: Only suggests using octal numbers, if this is possible #9652rc_buffer: The suggestion is no longer machine applicable to avoid semantic changes #9633print_literal,write_literal,uninlined_format_args: The suggestion now ignores comments after the macro call. #9586expect_fun_call:Improved the suggestion forformat!calls with captured variables #9586nonstandard_macro_braces: The suggestion is now machine applicable and will no longer replace brackets inside the macro argument. #9499from_over_into: The suggestion is now a machine applicable and contains explanations #9649needless_return: The automatic suggestion now removes all required semicolons #9497to_string_in_format_args: The suggestion now keeps parenthesis around values #9590manual_assert: The suggestion now preserves comments #9479redundant_allocation: The suggestion applicability is now markedMaybeIncorrectto avoid semantic changes #9634assertions_on_result_states: The suggestion has been corrected, for cases where theassert!is not in a statement. #9453nonminimal_bool: The suggestion no longer expands macros #9457collapsible_match: Now specifies field names, when a struct is destructed #9685unnecessary_cast: The suggestion now adds parenthesis for negative numbers #9577redundant_closure: The suggestion now works forimpl FnMutarguments #9556
ICE Fixes
unnecessary_to_owned: Avoid ICEs in favor of false negatives if information is missing #9505 #10027manual_range_contains: No longer ICEs on values behind references #9627needless_pass_by_value: No longer ICEs on unsizeddyn Fnarguments #9531*_interior_mutable_constlints: no longer ICE on const unions containing!Freezetypes #9539
Others
- Released
rustc_tools_utilfor version information onCrates.io. (Further adjustments will not be published as part of this changelog)
Rust 1.65
Released 2022-11-03
View all 86 merged pull requests
Important Changes
- Clippy now has an
--explain <LINT>command to show the lint description in the console #8952
New Lints
unused_peekable#9258collapsible_str_replace#9269manual_string_new#9295iter_on_empty_collections#9187iter_on_single_items#9187bool_to_int_with_if#9412multi_assignments#9379result_large_err#9373partialeq_to_none#9288suspicious_to_owned#8984cast_slice_from_raw_parts#9247manual_instant_elapsed#9264
Moves and Deprecations
- Moved
significant_drop_in_scrutineetonursery(now allow-by-default) #9302 - Rename
logic_bugtooverly_complex_bool_expr#9306 - Rename
arithmetictoarithmetic_side_effects#9443 - Moved
only_used_in_recursionto complexity (now warn-by-default) #8804 - Moved
assertions_on_result_statesto restriction (now allow-by-default) #9273 - Renamed
blacklisted_nametodisallowed_names#8974
Enhancements
option_if_let_else: Now also checks for match expressions #8696explicit_auto_deref: Now lints on implicit returns in closures #9126needless_borrow: Now considers trait implementations #9136suboptimal_flops,imprecise_flops: Now lint on constant expressions #9404if_let_mutex: Now detects mutex behind references and warns about deadlocks #9318
False Positive Fixes
unit_argdefault_trait_accessmissing_docs_in_private_items: No longer trigger in code generated from proc-macros #8694unwrap_used: Now lints uses ofunwrap_err#9338expect_used: Now lints uses ofexpect_err#9338transmute_undefined_repr: Now longer lints if the first field is compatible with the other type #9287unnecessary_to_owned: No longer lints, if type change cased errors in the caller function #9424match_like_matches_macro: No longer lints, if there are comments inside the match expression #9276partialeq_to_none: No longer trigger in code generated from macros #9389arithmetic_side_effects: No longer lints expressions that only use literals #9365explicit_auto_deref: Now ignores references on block expressions when the type isSized, ondyn Traitreturns and when the suggestion is non-trivial #9126trait_duplication_in_bounds: Now better tracks bounds to avoid false positives #9167format_in_format_args: Now suggests cases where the result is formatted again #9349only_used_in_recursion: No longer lints on function without recursions and takes external functions into account #8804missing_const_for_fn: No longer lints in proc-macros #9308non_ascii_literal: Allow non-ascii comments in tests and make sure#[allow]attributes work in tests #9327question_mark: No longer lintif lets with subpatterns #9348needless_collect: No longer lints in loops #8992mut_mutex_lock: No longer lints if the mutex is behind an immutable reference #9418needless_return: Now ignores returns with arguments #9381range_plus_one,range_minus_one: Now ignores code with macros #9446assertions_on_result_states: No longer lints on the unit type #9273
Suggestion Fixes/Improvements
unwrap_or_else_default: Now suggestsunwrap_or_default()for empty strings #9421if_then_some_else_none: Now also suggestsbool::then_some#9289redundant_closure_call: The suggestion now works for async closures #9053suboptimal_flops: Now suggests parenthesis when they are required #9394case_sensitive_file_extension_comparisons: Now suggestsmap_or(..)instead ofmap(..).unwrap_or#9341- Deprecated configuration values can now be updated automatically #9252
or_fun_call: Now suggestEntry::or_defaultforEntry::or_insert(Default::default())#9342unwrap_used: Only suggestsexpectifexpect_usedis allowed #9223
ICE Fixes
- Fix ICE in
useless_formatfor literals #9406 - Fix infinite loop in
vec_init_then_push#9441 - Fix ICE when reading literals with weird proc-macro spans #9303
Rust 1.64
Released 2022-09-22
View all 110 merged pull requests
New Lints
arithmetic_side_effects#9130invalid_utf8_in_unchecked#9105assertions_on_result_states#9225manual_find#8649manual_retain#8972default_instead_of_iter_empty#8989manual_rem_euclid#9031obfuscated_if_else#9148std_instead_of_core#9103std_instead_of_alloc#9103alloc_instead_of_core#9103explicit_auto_deref#8355
Moves and Deprecations
- Moved
format_push_stringtorestriction(now allow-by-default) #9161
Enhancements
significant_drop_in_scrutinee: Now gives more context in the lint message #8981single_match,single_match_else: Now catches moreOptioncases #8985unused_async: Now works for async methods #9025manual_filter_map,manual_find_map: Now lint more expressions #8958question_mark: Now works for simpleif letexpressions #8356undocumented_unsafe_blocks: Now finds comments before the start of closures #9117trait_duplication_in_bounds: Now catches duplicate bounds in where clauses #8703shadow_reuse,shadow_same,shadow_unrelated: Now lint in const blocks #9124slow_vector_initialization: Now detects cases withvec.capacity()#8953unused_self: Now respects theavoid-breaking-exported-apiconfig option #9199box_collection: Now supports all std collections #9170
False Positive Fixes
significant_drop_in_scrutinee: Now ignores calls toIntoIterator::into_iter#9140while_let_loop: Now ignores cases when the significant drop order would change #8981branches_sharing_code: Now ignores cases where moved variables have a significant drop or variable modifications can affect the conditions #9138let_underscore_lock: Now ignores bindings that aren't locked #8990trivially_copy_pass_by_ref: Now tracks lifetimes and ignores cases where unsafe pointers are used #8639let_unit_value: No longer ignores#[allow]attributes on the value #9082declare_interior_mutable_const: Now ignores thethread_local!macro #9015if_same_then_else: Now ignores branches withtodo!andunimplemented!#9006enum_variant_names: Now ignores names with_prefixes #9032let_unit_value: Now ignores cases, where the unit type is manually specified #9056match_same_arms: Now ignores branches withtodo!#9207assign_op_pattern: Ignores cases that break borrowing rules #9214extra_unused_lifetimes: No longer triggers in derive macros #9037mismatching_type_param_order: Now ignores complicated generic parameters #9146equatable_if_let: No longer lints in macros #9074new_without_default: Now ignores generics and lifetime parameters onfn new#9115needless_borrow: Now ignores cases that result in the execution of different traits #9096declare_interior_mutable_const: No longer triggers in thread-local initializers #9246
Suggestion Fixes/Improvements
type_repetition_in_bounds: The suggestion now works with maybe bounds #9132transmute_ptr_to_ref: Now suggestspointer::castwhen possible #8939useless_format: Now suggests the correct variable name #9237or_fun_call: The lint emission will now only span over theunwrap_orcall #9144neg_multiply: Now suggests adding parentheses around suggestion if needed #9026unnecessary_lazy_evaluations: Now suggest forbool::then_somefor lazy evaluation #9099manual_flatten: Improved message for long code snippets #9156explicit_counter_loop: The suggestion is now machine applicable #9149needless_borrow: Now keeps parentheses around fields, when needed #9210while_let_on_iterator: The suggestion now works inFnOnceclosures #9134
ICE Fixes
- Fix ICEs related to
#![feature(generic_const_exprs)]usage #9241 - Fix ICEs related to reference lints #9093
question_mark: Fix ICE on zero field tuple structs #9244
Documentation Improvements
needless_option_take: Now includes a "What it does" and "Why is this bad?" section. #9022
Others
- Using
--cap-lints=allowand only--force-warning some will now work with Clippy's driver #9036 - Clippy now tries to read the
rust-versionfromCargo.tomlto identify the minimum supported rust version #8774
Rust 1.63
Released 2022-08-11
View all 91 merged pull requests
New Lints
borrow_deref_ref#7930doc_link_with_quotes#8385no_effect_replace#8754rc_clone_in_vec_init#8769derive_partial_eq_without_eq#8796mismatching_type_param_order#8831duplicate_mod#8832unused_rounding#8866get_first#8882swap_ptr_to_ref#8916almost_complete_letter_range#8918needless_parens_on_range_literals#8933as_underscore#8934
Moves and Deprecations
- Rename
eval_order_dependencetomixed_read_write_in_expression, move tonursery#8621
Enhancements
undocumented_unsafe_blocks: Now also lints on unsafe trait implementations #8761empty_line_after_outer_attr: Now also lints on argumentless macros #8790expect_used: Now can be disabled in tests with theallow-expect-in-testsoption #8802unwrap_used: Now can be disabled in tests with theallow-unwrap-in-testsoption #8802disallowed_methods: Now also lints indirect usages #8852get_last_with_len: Now also lintsVecDequeand any deref to slice #8862manual_range_contains: Now also lints on chains of&&and||#8884rc_clone_in_vec_init: Now also lints onWeak#8885dbg_macro: Introduceallow-dbg-in-testsconfig option #8897use_self: Now also lints onTupleStructandStructpatterns #8899manual_find_mapandmanual_filter_map: Now also lints on more complex method chains insidemap#8930needless_return: Now also lints on macro expressions in return statements #8932doc_markdown: Users can now indicate, that thedoc-valid-identsconfig should extend the default and not replace it #8944disallowed_names: Users can now indicate, that thedisallowed-namesconfig should extend the default and not replace it #8944never_loop: Now checks forcontinuein struct expression #9002
False Positive Fixes
useless_transmute: No longer lints on types with erased regions #8564vec_init_then_push: No longer lints when further extended #8699cmp_owned: No longer lints onFrom::fromforCopytypes #8807redundant_allocation: No longer lints on fat pointers that would become thin pointers #8813derive_partial_eq_without_eq:empty_line_after_outer_attr: No longer lints empty lines in inner string values #8892branches_sharing_code: No longer lints when using different binding names #8901significant_drop_in_scrutinee: No longer lints on Try?andawaitdesugared expressions #8902checked_conversions: No longer lints inconstcontexts #8907iter_overeager_cloned: No longer lints on.cloned().flatten()whenT::Itemdoesn't implementIntoIterator#8960
Suggestion Fixes/Improvements
vec_init_then_push: Suggest to removemutbinding when possible #8699manual_range_contains: Fix suggestion for integers with different signs #8763identity_op: Add parenthesis to suggestions where required #8786cast_lossless: No longer gives wrong suggestion onusize/isize->f64#8778rc_clone_in_vec_init: Add suggestion #8814- The "unknown field" error messages for config files now wraps the field names #8823
cast_abs_to_unsigned: Do not remove cast if it's required #8876significant_drop_in_scrutinee: Improve lint message for types that are not references and not trivially clone-able #8902for_loops_over_fallibles: Now suggests the correct variant ofiter(),iter_mut()orinto_iter()#8941
ICE Fixes
- Fix ICE in
let_unit_valuewhen calling astatic/constcallable type #8835 - Fix ICEs on callable
static/consts #8896 needless_late_init#8912- Fix ICE in shadow lints #8913
Documentation Improvements
- Clippy has a Book now! #7359
- Add a copy lint name-button to Clippy's lint list #8839
- Display past names of renamed lints on Clippy's lint list #8843
- Add the ability to show the lint output in the lint list #8947
Rust 1.62
Released 2022-06-30
View all 90 merged pull requests
New Lints
large_include_file#8727cast_abs_to_unsigned#8635err_expect#8606unnecessary_owned_empty_strings#8660empty_structs_with_brackets#8594crate_in_macro_def#8576needless_option_take#8665bytes_count_to_len#8711is_digit_ascii_radix#8624await_holding_invalid_type#8707trim_split_whitespace#8575pub_use#8670format_push_string#8626empty_drop#8571drop_non_drop#8630forget_non_drop#8630
Moves and Deprecations
- Move
only_used_in_recursiontonursery(now allow-by-default) #8783 - Move
stable_sort_primitivetopedantic(now allow-by-default) #8716
Enhancements
- Remove overlap between
manual_split_onceandneedless_splitn#8631 map_identity: Now checks for needlessmap_err#8487extra_unused_lifetimes: Now checks for impl lifetimes #8737cast_possible_truncation: Now catches more cases with larger shift or divide operations #8687identity_op: Now checks for modulo expressions #8519panic: No longer lint in constant context #8592manual_split_once: Now lints manual iteration ofsplitn#8717self_named_module_files,mod_module_files: Now handle relative module paths #8611unsound_collection_transmute: Now has better size and alignment checks #8648unnested_or_patterns: Ignore cases, where the suggestion would be longer #8619
False Positive Fixes
rest_pat_in_fully_bound_structs: Now ignores structs marked with#[non_exhaustive]#8690needless_late_init: No longer lintsif letstatements,let mutbindings or instances that changes the drop order significantly #8617unnecessary_cast: No longer lints to casts to aliased or non-primitive types #8596init_numbered_fields: No longer lints type aliases #8780needless_option_as_deref: No longer lints foras_deref_mutonOptionvalues that can't be moved #8646mistyped_literal_suffixes: Now ignores float literals without an exponent #8742undocumented_unsafe_blocks: Now ignores unsafe blocks from proc-macros and works better for sub-expressions #8450same_functions_in_if_condition: Now allows different constants, even if they have the same value #8673needless_match: Now checks for more complex types and ignores type coercion #8549assertions_on_constants: Now ignores constants fromcfg!macros #8614indexing_slicing: Fix false positives with constant indices in #8588iter_with_drain: Now ignores iterator references #8668useless_attribute: Now allowsredundant_pub_crateonuseitems #8743cast_ptr_alignment: Now ignores expressions, when used for unaligned reads and writes #8632wrong_self_convention: Now allows&mut selfand no self as arguments foris_*methods #8738mut_from_ref: Only lint in unsafe code #8647redundant_pub_crate: Now allows macro exports #8736needless_match: Ignores cases where the else block expression is different #8700transmute_int_to_char: Now allows transmutations inconstcode #8610manual_non_exhaustive: Ignores cases, where the enum value is used #8645redundant_closure: Now ignores coerced closure #8431identity_op: Is now ignored in cases where extra brackets would be needed #8730let_unit_value: Now ignores cases which are used for type inference #8563
Suggestion Fixes/Improvements
manual_split_once: Fixed incorrect suggestions for single result accesses #8631bytes_nth: Fix typos in the diagnostic message #8403mistyped_literal_suffixes: Now suggests the correct integer types #8742unnecessary_to_owned: Fixed suggestion based on the configured msrv #8692single_element_loop: Improve lint for Edition 2021 arrays #8616manual_bits: Now includes a cast for proper type conversion, when needed #8677option_map_unit_fn,result_map_unit_fn: Fix some incorrect suggestions #8584collapsible_else_if: Add whitespace in suggestion #8729transmute_bytes_to_str: Now suggestfrom_utf8_uncheckedinconstcontext #8612map_clone: Improve message and suggestion based on the msrv #8688needless_late_init: Now shows theletstatement where it was first initialized #8779
ICE Fixes
only_used_in_recursion#8691cast_slice_different_sizes#8720iter_overeager_cloned#8602undocumented_unsafe_blocks#8686
Rust 1.61
Released 2022-05-19
View all 60 merged pull requests
New Lints
only_used_in_recursion#8422cast_enum_truncation#8381missing_spin_loop#8174deref_by_slicing#8218needless_match#8471allow_attributes_without_reason#8504print_in_format_impl#8253unnecessary_find_map#8489or_then_unwrap#8561unnecessary_join#8579iter_with_drain#8483cast_enum_constructor#8562cast_slice_different_sizes#8445
Moves and Deprecations
- Moved
transmute_undefined_reprtonursery(now allow-by-default) #8432 - Moved
try_errtorestriction#8544 - Move
iter_with_draintonursery#8541 - Renamed
to_string_in_displaytorecursive_format_impl#8188
Enhancements
dbg_macro: The lint level can now be set with crate attributes and works inside macros #8411ptr_as_ptr: Now works inside macros #8442use_self: Now works for variants in match expressions #8456await_holding_lock: Now lints forparking_lot::{Mutex, RwLock}#8419recursive_format_impl: Now checks for format calls onself#8188
False Positive Fixes
new_without_default: No longer lints fornew()methods with#[doc(hidden)]#8472transmute_undefined_repr: No longer lints for single field structs with#[repr(C)], generic parameters, wide pointers, unions, tuples and allow several forms of type erasure #8425 #8553 #8440 #8547match_single_binding,match_same_arms,match_as_ref,match_bool: No longer lintmatchexpressions withcfged arms #8443single_component_path_imports: No longer lint on macros #8537ptr_arg: Allow&mutarguments forCow<_>#8552needless_borrow: No longer lints for method calls #8441match_same_arms: Now ensures that interposing arm patterns don't overlap #8232default_trait_access: Now allowsDefault::defaultin update expressions #8433
Suggestion Fixes/Improvements
redundant_slicing: Fixed suggestion for a method calls #8218map_flatten: Long suggestions will now be split up into two help messages #8520unnecessary_lazy_evaluations: Now shows suggestions for longer code snippets #8543unnecessary_sort_by: Now suggestsReverseincluding the path #8462search_is_some: More suggestions are nowMachineApplicable#8536
Documentation Improvements
new_without_default: Documentpubrequirement for the struct and fields #8429
Rust 1.60
Released 2022-04-07
View all 73 merged pull requests
New Lints
single_char_lifetime_names#8236iter_overeager_cloned#8203transmute_undefined_repr#8398default_union_representation#8289manual_bits#8213borrow_as_ptr#8210
Moves and Deprecations
- Moved
disallowed_methodsanddisallowed_typestostyle(now warn-by-default) #8261 - Rename
ref_in_dereftoneedless_borrow#8217 - Moved
mutex_atomictonursery(now allow-by-default) #8260
Enhancements
ptr_arg: Now takes the argument usage into account and lints for mutable references #8271unused_io_amount: Now supports async read and write traits #8179while_let_on_iterator: Improved detection to catch more cases #8221trait_duplication_in_bounds: Now covers trait functions withSelfbounds #8252unwrap_used: Now works for.get(i).unwrap()and.get_mut(i).unwrap()#8372map_clone: The suggestion takesmsrvinto account #8280manual_bitsandborrow_as_ptr: Now track theclippy::msrvattribute #8280disallowed_methods: Now works for methods on primitive types #8112not_unsafe_ptr_arg_deref: Now works for type aliases #8273needless_question_mark: Now works for async functions #8311iter_not_returning_iterator: Now handles type projections #8228wrong_self_convention: Now detects wrongselfreferences in more cases #8208single_match: Now works formatchstatements with tuples #8322
False Positive Fixes
erasing_op: No longer triggers if the output type changes #8204if_same_then_else: No longer triggers forif letstatements #8297manual_memcpy: No longer lints onVecDeque#8226trait_duplication_in_bounds: Now takes path segments into account #8315deref_addrof: No longer lints when the dereference or borrow occurs in different a context #8268type_repetition_in_bounds: Now checks for full equality to prevent false positives #8224ptr_arg: No longer lint for mutable references in traits #8369implicit_clone: No longer lints for double references #8231needless_lifetimes: No longer lints lifetimes for explicitselftypes #8278op_ref: No longer lints inBinOpimpl if that can cause recursion #8298enum_variant_names: No longer triggers for empty variant names #8329redundant_closure: No longer lints forArc<T>orRc<T>#8193iter_not_returning_iterator: No longer lints on trait implementations but therefore on trait definitions #8228single_match: No longer lints on exhaustive enum patterns without a wildcard #8322manual_swap: No longer lints on cases that involve automatic dereferences #8220useless_format: Now works for implicit named arguments #8295
Suggestion Fixes/Improvements
needless_borrow: Prevent mutable borrows being moved and suggest removing the borrow on method calls #8217chars_next_cmp: Correctly escapes the suggestion #8376explicit_write: Add suggestions forwrite!s with format arguments #8365manual_memcpy: Suggestscopy_from_slicewhen applicable #8226or_fun_call: Improved suggestion display for long arguments #8292unnecessary_cast: Now correctly includes the sign #8350cmp_owned: No longer flips the comparison order #8299explicit_counter_loop: Now correctly suggestsiter()on references #8382
ICE Fixes
Documentation Improvements
map_flatten: Add documentation for theOptiontype #8354- Document that Clippy's driver might use a different code generation than rustc #8037
- Clippy's lint list will now automatically focus the search box #8343
Others
- Clippy now warns if we find multiple Clippy config files exist #8326
Rust 1.59
Released 2022-02-24
View all 94 merged pull requests
New Lints
index_refutable_slice#7643needless_splitn#7896unnecessary_to_owned#7978needless_late_init#7995octal_escapes#8007return_self_not_must_use#8071init_numbered_fields#8170
Moves and Deprecations
- Move
if_then_panictopedanticand rename tomanual_assert(now allow-by-default) #7810 - Rename
disallow_typetodisallowed_typesanddisallowed_methodtodisallowed_methods#7984 - Move
map_flattentocomplexity(now warn-by-default) #8054
Enhancements
match_overlapping_arm: Fix false negative where after included ranges, overlapping ranges weren't linted anymore #7909deprecated_cfg_attr: Now takes the specified MSRV into account #7944cast_lossless: Now also lints forboolto integer casts #7948let_underscore_lock: Also emit lints for theparking_lotcrate #7957needless_borrow#7977- Lint when a borrow is auto-dereffed more than once
- Lint in the trailing expression of a block for a match arm
strlen_on_c_strings8001- Lint when used without a fully-qualified path
- Suggest removing the surrounding unsafe block when possible
non_ascii_literal: Now also lints onchars, not juststrings #8034single_char_pattern: Now also lints onsplit_inclusive,split_once,rsplit_once,replace, andreplacen#8077unwrap_or_else_default: Now also lints onstdconstructors likeVec::new,HashSet::new, andHashMap::new#8163shadow_reuse: Now also lints on shadowedif letbindings, instead ofshadow_unrelated#8165
False Positive Fixes
or_fun_call,unnecessary_lazy_evaluations: Improve heuristics, so that cheap functions (e.g. calling.len()on aVec) won't get linted anymore #7639manual_split_once: No longer suggests code changing the original behavior #7896- Don't show
no_effectorunnecessary_operationwarning for unit struct implementingFnOnce#7898 semicolon_if_nothing_returned: Fixed a bug, where the lint wrongly triggered onlet-elsestatements #7955if_then_some_else_none: No longer lints if there is an early return #7980needless_collect: No longer suggests removal ofcollectwhen removal would create code requiring mutably borrowing a value multiple times #7982shadow_same: Fix false positive forasyncfunction's params #7997suboptimal_flops: No longer triggers in constant functions #8009type_complexity: No longer lints on associated types in traits #8030question_mark: No longer lints if returned object is not local #8080option_if_let_else: No longer lint on complex sub-patterns #8086blocks_in_if_conditions: No longer lints on empty closures #8100enum_variant_names: No longer lint when first prefix is only a substring of a camel-case word #8127identity_op: Only lint on integral operands #8183
Suggestion Fixes/Improvements
search_is_some: Fix suggestion forany()not taking item by reference #7463almost_swapped: Now detects if there is ano_stdorno_coreattribute and adapts the suggestion accordingly #7877redundant_pattern_matching: Fix suggestion for deref expressions #7949explicit_counter_loop: Now also produces a suggestion for non-usizetypes #7950manual_map: Fix suggestion when used with unsafe functions and blocks #7968option_map_or_none: Suggestmapoverand_thenwhen possible #7971option_if_let_else: No longer expands macros in the suggestion #7974iter_cloned_collect: Suggestcopiedoverclonedwhen possible #8006doc_markdown: No longer uses inline hints to improve readability of suggestion #8011needless_question_mark: Now better explains the suggestion #8028single_char_pattern: Escape backslash\in suggestion #8067needless_bool: Suggesta != bover!(a == b)#8117iter_skip_next: Suggest to add amutif it is necessary in order to apply this lints suggestion #8133neg_multiply: Now produces a suggestion #8144needless_return: Now suggests the unit type()over an empty block{}in match arms #8185suboptimal_flops: Now gives a syntactically correct suggestion forto_radiansandto_degrees#8187
ICE Fixes
Documentation Improvements
print_stdout,print_stderr,dbg_macro: Document how the lint level can be changed crate-wide #8040- Added a note to the
READMEthat config changes don't apply to already compiled code #8175
Others
- Clippy's lint list now displays the version a lint was added. 🎉 #7813
- New and improved issue templates #8032
- Dev: Add
cargo dev lintcommand, to run your modified Clippy version on a file #7917
Rust 1.58
Released 2022-01-13
View all 68 merged pull requests
Rust 1.58.1
- Move
non_send_fields_in_send_tytonursery(now allow-by-default) #8075 useless_format: Handle implicit named arguments #8295
New lints
transmute_num_to_bytes#7805match_str_case_mismatch#7806format_in_format_args,to_string_in_format_args#7743uninit_vec#7682fn_to_numeric_cast_any#7705undocumented_unsafe_blocks#7748trailing_empty_array#7838string_slice#7878
Moves or deprecations of lints
- Move
non_send_fields_in_send_tytosuspicious#7874 - Move
non_ascii_literaltorestriction#7907
Changes that expand what code existing lints cover
question_marknow coversResult#7840- Make
useless_formatrecognize bareformat!("")#7801 - Lint on underscored variables with no side effects in
no_effect#7775 - Expand
match_ref_patsto check for multiple reference patterns #7800
False positive fixes
- Fix false positive of
implicit_saturating_subwithelseclause #7832 - Fix
question_markwhen there is call in conditional predicate #7860 mut_mutno longer lints when type is defined in external macros #7795- Avoid
eq_opin test functions #7811 cast_possible_truncationno longer lints when cast is coming fromsignummethod call #7850match_str_case_mismatchno longer lints on uncased characters #7865ptr_argno longer lints references to type aliases #7890missing_safety_docnow also accepts "implementation safety" headers #7856missing_safety_docno longer lints if any parent has#[doc(hidden)]attribute #7849if_not_elsenow ignores else-if statements #7895- Avoid linting
cast_possible_truncationon bit-reducing operations #7819 - Avoid linting
field_reassign_with_defaultwhenDropandCopyare involved #7794 unnecessary_sort_bynow checks if argument implementsOrdtrait #7824- Fix false positive in
match_overlapping_arm#7847 - Prevent
needless_lifetimesfalse positive inasyncfunction definition #7901
Suggestion fixes/improvements
- Keep an initial
::whendoc_markdownsuggests to use ticks #7916 - Add a machine applicable suggestion for the
doc_markdownmissing backticks lint #7904 equatable_if_letno longer expands macros in the suggestion #7788- Make
shadow_reusesuggestion less verbose #7782
ICE fixes
- Fix ICE in
enum_variant_names#7873 - Fix ICE in
undocumented_unsafe_blocks#7891
Documentation improvements
- Fixed naive doc formatting for
#[must_use]lints (must_use_unit,double_must_use,must_use_candidate,let_underscore_must_use) #7827 - Fix typo in example for
match_result_ok#7815
Others
- Allow giving reasons for
disallowed_types#7791 - Fix
manual_assertandmatch_wild_err_armfor#![no_std]and Rust 2021. #7851 - Fix regression in
semicolon_if_nothing_returnedon macros containing while loops #7789 - Added a new configuration
literal-suffix-styleto enforce a certain style writingunseparated_literal_suffix#7726
Rust 1.57
Released 2021-12-02
View all 148 merged pull requests
New Lints
negative_feature_names#7539redundant_feature_names#7539mod_module_files#7543self_named_module_files#7543manual_split_once#7565derivable_impls#7570needless_option_as_deref#7596iter_not_returning_iterator#7610same_name_method#7653manual_assert#7669non_send_fields_in_send_ty#7709equatable_if_let#7762
Moves and Deprecations
- Move
shadow_unrelatedtorestriction#7338 - Move
option_if_let_elsetonursery#7568 - Move
branches_sharing_codetonursery#7595 - Rename
if_let_some_resulttomatch_result_okwhich now also handleswhile letcases #7608 - Move
many_single_char_namestopedantic#7671 - Move
float_cmptopedantic#7692 - Rename
box_vectobox_collectionand lint on more general cases #7693 - Uplift
invalid_atomic_orderingto rustc rust-lang/rust#84039
Enhancements
- Rewrite the
shadow*lints, so that they find a lot more shadows and are not limited to certain patterns #7338 - The
avoid-breaking-exported-apiconfiguration now also works forbox_collection,redundant_allocation,rc_buffer,vec_box,option_option,linkedlist,rc_mutex#7560 unnecessary_unwrap: Now also checks forexpects #7584disallowed_methods: Allow adding a reason that will be displayed with the lint message #7621approx_constant: Now checks the MSRV forLOG10_2andLOG2_10#7629approx_constant: AddTAU#7642needless_borrow: Now also lints on needless mutable borrows #7657missing_safety_doc: Now also lints on unsafe traits #7734
False Positive Fixes
manual_map: No longer lints when the option is borrowed in the match and also consumed in the arm #7531filter_next: No longer lints iffiltermethod is not theIterator::filtermethod #7562manual_flatten: No longer lints if expression is used afterif let#7566option_if_let_else: Multiple fixes #7573breakandcontinuestatements local to the would-be closure are allowed- Don't lint in const contexts
- Don't lint when yield expressions are used
- Don't lint when the captures made by the would-be closure conflict with the other branch
- Don't lint when a field of a local is used when the type could be potentially moved from
- In some cases, don't lint when scrutinee expression conflicts with the captures of the would-be closure
redundant_allocation: No longer lints onBox<Box<dyn T>>which replaces wide pointers with thin pointers #7592bool_assert_comparison: No longer lints on types that do not implement theNottrait withOutput = bool#7605mut_range_bound: No longer lints on range bound mutations, that are immediately followed by abreak;#7607mutable_key_type: Improve accuracy and document remaining false positives and false negatives #7640redundant_closure: Rewrite the lint to fix various false positives and false negatives #7661large_enum_variant: No longer wrongly identifies the second largest variant #7677needless_return: No longer lints on let-else expressions #7685suspicious_else_formatting: No longer lints in proc-macros #7707excessive_precision: No longer lints when in some cases the float was already written in the shortest form #7722doc_markdown: No longer lints on intra-doc links #7772
Suggestion Fixes/Improvements
unnecessary_operation: Recommend using anassert!instead of using a function call in an indexing operation #7453manual_split_once: Produce semantically equivalent suggestion whenrsplitnis used #7663while_let_on_iterator: Produce correct suggestion when using&mut#7690manual_assert: No better handles complex conditions #7741- Correctly handle signs in exponents in numeric literals lints #7747
suspicious_map: Now also suggests to useinspectas an alternative #7770- Drop exponent from suggestion if it is 0 in numeric literals lints #7774
ICE Fixes
Others
Rust 1.56
Released 2021-10-21
View all 38 merged pull requests
New Lints
Enhancements
needless_continue: Now also lints inloop { continue; }case #7477disallowed_types: Now also primitive types can be disallowed #7488manual_swap: Now also lints on xor swaps #7506map_flatten: Now also lints on theResulttype #7522no_effect: Now also lints on inclusive ranges #7556
False Positive Fixes
nonstandard_macro_braces: No longer lints on similar named nested macros #7478too_many_lines: No longer lints in closures to avoid duplicated diagnostics #7534similar_names: No longer complains aboutiteranditembeing too similar #7546
Suggestion Fixes/Improvements
similar_names: No longer suggests to insert or add an underscore as a fix #7221new_without_default: No longer shows the full qualified type path when suggesting adding aDefaultimplementation #7493while_let_on_iterator: Now suggests re-borrowing mutable references #7520extend_with_drain: Improve code suggestion for mutable and immutable references #7533trivially_copy_pass_by_ref: Now properly handlesSelftype #7535never_loop: Now suggests usingif letinstead of aforloop when applicable #7541
Documentation Improvements
- Clippy now uses a lint to generate its lint documentation. Lints all the way down. #7502
- Reworked Clippy's website:
#7172
#7279
- Added applicability information about lints
- Added a link to jump into the implementation
- Improved loading times
- Adapted some styling
cargo clippy --helpnow also explains the--fixand--no-depsflag #7492unnested_or_patterns: Removedor_patternsfeature gate in the code example #7507
Rust 1.55
Released 2021-09-09
View all 83 merged pull requests
Important Changes
- Stabilized
cargo clippy --fix🎉 #7405
New Lints
rc_mutex#7316nonstandard_macro_braces#7299strlen_on_c_strings#7243self_named_constructors#7403disallowed_script_idents#7400disallowed_types#7315missing_enforced_import_renames#7300extend_with_drain#7270
Moves and Deprecations
- 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
Enhancements
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 #7308disallowed_names: Now allows disallowed names in test code #7379redundant_closure: Suggests&mutforFnMut#7437disallowed_methods,disallowed_types: The configuration valuesdisallowed-methodanddisallowed-typeno longer require fully qualified paths #7345zst_offset: Fixed lint invocation after it was accidentally suppressed #7396
False Positive Fixes
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
Suggestion Fixes/Improvements
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
ICE Fixes
Rust 1.54
Released 2021-07-29
View all 74 merged pull requests
New Lints
ref_binding_to_reference#7105needless_bitwise_bool#7133unused_async#7225manual_str_repeat#7265suspicious_splitn#7292
Moves and Deprecations
- 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
Enhancements
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
False Positive Fixes
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
Suggestion Fixes/Improvements
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
ICE Fixes
- Fix ICE when running Clippy on
libstd#7140 implicit_return#7242
Rust 1.53
Released 2021-06-17
View all 126 merged pull requests
New Lints
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
Moves and Deprecations
- Deprecate
filter_maplint #7059 - Move
transmute_ptr_to_ptrtopedantic#7102
Enhancements
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
False Positive Fixes
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
Suggestion Fixes/Improvements
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
ICE Fixes
macro_use_imports#7022missing_panics_doc#7034tabs_in_doc_comments#7039missing_const_for_fn#7128
Others
- Clippy's lint list now supports themes #7030
- Lints that were uplifted to
rustcnow mention the newrustcname in the deprecation warning #7056
Rust 1.52
Released 2021-05-06
View all 102 merged pull requests
New Lints
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
Moves and Deprecations
- 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
Enhancements
disallowed_methods: 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
False Positive Fixes
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
Suggestion Fixes/Improvements
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
ICE Fixes
Documentation Improvements
useless_format: Improved the documentation example #6854- Clippy's
README.md: Includes a new subsection on running Clippy as a rustc wrapper #6782
Others
- 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
Rust 1.51
Released 2021-03-25
View all 78 merged pull requests
New Lints
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
Moves and Deprecations
- Replace
find_mapwithmanual_find_map#6591 unknown_clippy_lintsNow integrated in theunknown_lintsrustc lint #6653
Enhancements
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
False Positive Fixes
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
Suggestion Fixes/Improvements
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
ICE Fixes
Documentation Improvements
- 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
Others
- 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
Rust 1.50
Released 2021-02-11
View all 119 merged pull requests
New Lints
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
Moves and Deprecations
- 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
Enhancements
- 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
False Positive Fixes
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
Suggestion Fixes/Improvements
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
ICE Fixes
- Fix a crash in
from_iter_instead_of_collect#6304 - Fix a silent crash when parsing doc comments in
needless_doctest_main#6458
Documentation Improvements
- 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
Others
- 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
Rust 1.49
Released 2020-12-31
View all 107 merged pull requests
New Lints
field_reassign_with_default#5911await_holding_refcell_ref#6029disallowed_methods#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
Moves and Deprecations
- 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
Enhancements
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
False Positive Fixes
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
Suggestion Fixes/Improvements
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
Documentation Improvements
- Some doc improvements:
doc_markdown: Document problematic link text style #6107
Rust 1.48
Released 2020-11-19
View all 99 merged pull requests
New lints
self_assignment#5894unnecessary_lazy_evaluations#5720manual_strip#6038map_err_ignore#5998rc_buffer#6044to_string_in_display#5831single_char_push_str#5881
Moves and Deprecations
- Downgrade
verbose_bit_maskto pedantic #6036
Enhancements
- 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
False Positive Fixes
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
Suggestion Fixes/Improvements
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
ICE Fixes
- Fix ICE in
repeat_once#5948
Documentation Improvements
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
Rust 1.47
Released 2020-10-08
View all 76 merged pull requests
New lints
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
Moves and Deprecations
- Deprecate
regex_macrolint #5760 - Move
range_minus_onetopedantic#5752
Enhancements
- 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
False Positive Fixes
- 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
Suggestion Fixes/Improvements
- 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
ICE Fixes
- Fix ICE caused by
needless_collect#5877 - Fix ICE caused by
unnested_or_patterns#5784
Documentation Improvements
- Fix grammar of
await_holding_lockdocumentation #5748
Others
- Make lints adhere to the rustc dev guide #5888
Rust 1.46
Released 2020-08-27
View all 48 merged pull requests
New lints
Moves and Deprecations
- Move
cast_ptr_alignmentto pedantic #5667
Enhancements
- Improve
mem_replace_with_uninitlint #5695
False Positive Fixes
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 #5702disallowed_names: Removebarfrom the default configuration #5712redundant_pattern_matching: Avoid suggesting non-const fncalls in const contexts #5724
Suggestion Fixes/Improvements
- Fix suggestion of
unit_arglint, so that it suggest semantic equivalent code #4455 - Add auto applicable suggestion to
macro_use_imports#5279
ICE Fixes
- Fix ICE in the
constsmodule of Clippy #5709
Documentation Improvements
- Improve code examples across multiple lints #5664
Others
- 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
Rust 1.45
Released 2020-07-16
View all 81 merged pull requests
New lints
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
Moves and Deprecations
- 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
Enhancements
- 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
False Positive Fixes
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
Suggestion Improvements
- 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
ICE Fixes
- Fix ICE caused in unwrap module. #5590
- Fix ICE on rustc test issue-69020-assoc-const-arith-overflow.rs #5499
Documentation
- Clarify the documentation of
unnecessary_mut_passed. #5639 - Extend example for
unneeded_field_pattern. #5541
Rust 1.44
Released 2020-06-04
View all 124 merged pull requests
New lints
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
Moves and Deprecations
- 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
Enhancements
- 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
False Positive Fixes
many_single_char_names#5468should_implement_trait#5437unused_self#5387redundant_clone#5453precedence#5445suspicious_op_assign_impl#5424needless_lifetimes#5293redundant_pattern#5287inconsistent_digit_grouping#5451
Suggestion Improvements
- 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
ICE Fixes
Documentation
- 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
Rust 1.43
Released 2020-04-23
View all 91 merged pull requests
New lints
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
Moves and Deprecations
- Move
unneeded_field_patternto pedantic group #5200
Enhancements
- Make
missing_errors_doclint also trigger onasyncfunctions #5181 - Add more constants to
approx_constant#5193 - Extend
question_marklint #5266
False Positive Fixes
Suggestion Improvements
- Improve suggestion when blocks of code are suggested #5134
ICE Fixes
misc_earlylints #5129missing_errors_doc#5213- Fix ICE when evaluating
usizes #5256
Documentation
- Improve documentation of
iter_nth_zero - Add documentation pages for stable releases #5171
Others
- Clippy now completely runs on GitHub Actions #5190
Rust 1.42
Released 2020-03-12
View all 101 merged pull requests
New lints
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
Moves and Deprecations
- 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
Enhancements
- 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
False Positive Fixes
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
Suggestion Improvements
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
ICE fixes
Documentation
- Improve documentation of
empty_enum,replace_consts,redundant_clone, anditerator_step_by_zero
Rust 1.41
Released 2020-01-30
View all 74 merged pull requests
- 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
Rust 1.40
Released 2019-12-19
View all 76 merged pull requests
- 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
Rust 1.39
Released 2019-11-07
View all 100 merged pull requests
- 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
Rust 1.38
Released 2019-09-26
View all 76 merged pull requests
- New Lints:
- Move
{unnecessary,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
Rust 1.37
Released 2019-08-15
View all 72 merged pull requests
- 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
Rust 1.36
Released 2019-07-04
View all 81 merged pull requests
- 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
Rust 1.35
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
Rust 1.34
Released 2019-04-10
View all 61 merged pull requests
- 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
Rust 1.33
Released 2019-02-26
View all 120 merged pull requests
- 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
Rust 1.32
Released 2019-01-17
View all 71 merged pull requests
- New lints:
slow_vector_initialization,mem_discriminant_non_enum,redundant_clone,wildcard_dependencies,into_iter_on_ref,into_iter_on_array,deprecated_cfg_attr,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
Rust 1.31
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
Rust 1.30
Released 2018-10-25
View all 88 merged pull requests
- 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
Rust 1.29
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
0.0.212 (2018-07-10)
- Rustup to rustc 1.29.0-nightly (
e06c875442018-07-06)
0.0.211
- Rustup to rustc 1.28.0-nightly (
e3bf634e02018-06-28)
0.0.210
- Rustup to rustc 1.28.0-nightly (
01cc982e92018-06-24)
0.0.209
- Rustup to rustc 1.28.0-nightly (
5230979792018-06-18)
0.0.208
- Rustup to rustc 1.28.0-nightly (
86a8f1a632018-06-17)
0.0.207
- Rustup to rustc 1.28.0-nightly (
2a00629742018-06-09)
0.0.206
- Rustup to rustc 1.28.0-nightly (
5bf68db6e2018-05-28)
0.0.205
- Rustup to rustc 1.28.0-nightly (
990d8aa742018-05-25) - Rename
unused_lifetimestoextra_unused_lifetimesbecause of naming conflict with new rustc lint
0.0.204
- Rustup to rustc 1.28.0-nightly (
71e87be382018-05-22)
0.0.203
- Rustup to rustc 1.28.0-nightly (
a3085756e2018-05-19) - Clippy attributes are now of the form
clippy::cyclomatic_complexityinstead ofclippy(cyclomatic_complexity)
0.0.202
- Rustup to rustc 1.28.0-nightly (
952f344cd2018-05-18)
0.0.201
- Rustup to rustc 1.27.0-nightly (
2f2a11dfc2018-05-16)
0.0.200
- Rustup to rustc 1.27.0-nightly (
9fae153742018-05-13)
0.0.199
- Rustup to rustc 1.27.0-nightly (
ff2ac35db2018-05-12)
0.0.198
- Rustup to rustc 1.27.0-nightly (
acd3871ba2018-05-10)
0.0.197
- Rustup to rustc 1.27.0-nightly (
428ea5f6b2018-05-06)
0.0.196
- Rustup to rustc 1.27.0-nightly (
e82261dfb2018-05-03)
0.0.195
- Rustup to rustc 1.27.0-nightly (
ac3c2288f2018-04-18)
0.0.194
- Rustup to rustc 1.27.0-nightly (
bd40cbbe12018-04-14) - New lints:
cast_ptr_alignment,transmute_ptr_to_ptr,write_literal,write_with_newline,writeln_empty_string
0.0.193
- Rustup to rustc 1.27.0-nightly (
eeea94c112018-04-06)
0.0.192
- Rustup to rustc 1.27.0-nightly (
fb44b4c0e2018-04-04) - New lint:
print_literal
0.0.191
- Rustup to rustc 1.26.0-nightly (
ae544ee1c2018-03-29) - Lint audit; categorize lints as style, correctness, complexity, pedantic, nursery, restriction.
0.0.190
- Fix a bunch of intermittent cargo bugs
0.0.189
- Rustup to rustc 1.26.0-nightly (
5508b27142018-03-18)
0.0.188
- Rustup to rustc 1.26.0-nightly (
3926453942018-03-15) - New lint:
while_immutable_condition
0.0.187
- Rustup to rustc 1.26.0-nightly (
322d7f7b92018-02-25) - New lints:
redundant_field_names,suspicious_arithmetic_impl,suspicious_op_assign_impl
0.0.186
- Rustup to rustc 1.25.0-nightly (
0c6091fbd2018-02-04) - Various false positive fixes
0.0.185
- Rustup to rustc 1.25.0-nightly (
56733bc9f2018-02-01) - New lint:
question_mark
0.0.184
- Rustup to rustc 1.25.0-nightly (
90eb44a582018-01-29) - New lints:
double_comparisons,empty_line_after_outer_attr
0.0.183
- Rustup to rustc 1.25.0-nightly (
21882aad72018-01-28) - New lint:
misaligned_transmute
0.0.182
- Rustup to rustc 1.25.0-nightly (
a0dcecff92018-01-24) - New lint:
decimal_literal_representation
0.0.181
- Rustup to rustc 1.25.0-nightly (
97520ccb12018-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
0.0.180
- Rustup to rustc 1.25.0-nightly (
3f92e8d892018-01-14)
0.0.179
- Rustup to rustc 1.25.0-nightly (
61452e5062018-01-09)
0.0.178
- Rustup to rustc 1.25.0-nightly (
ee220daca2018-01-07)
0.0.177
- Rustup to rustc 1.24.0-nightly (
250b492052017-12-21) - New lint:
match_as_ref
0.0.176
- Rustup to rustc 1.24.0-nightly (
0077d128d2017-12-14)
0.0.175
- Rustup to rustc 1.24.0-nightly (
bb42071f62017-12-01)
0.0.174
- Rustup to rustc 1.23.0-nightly (
63739ab7b2017-11-21)
0.0.173
- Rustup to rustc 1.23.0-nightly (
33374fa9d2017-11-20)
0.0.172
- Rustup to rustc 1.23.0-nightly (
d0f8e29132017-11-16)
0.0.171
- Rustup to rustc 1.23.0-nightly (
ff0f5de3b2017-11-14)
0.0.170
- Rustup to rustc 1.23.0-nightly (
d6b06c63a2017-11-09)
0.0.169
- Rustup to rustc 1.23.0-nightly (
3b82e4c742017-11-05) - New lints:
just_underscores_and_digits,result_map_unwrap_or_else,transmute_bytes_to_str
0.0.168
- Rustup to rustc 1.23.0-nightly (
f0fe716db2017-10-30)
0.0.167
- Rustup to rustc 1.23.0-nightly (
90ef3372e2017-10-29) - New lints:
const_static_lifetime,erasing_op,fallible_impl_from,println_empty_string,useless_asref
0.0.166
- Rustup to rustc 1.22.0-nightly (
b7960878b2017-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
0.0.165
- Rust upgrade to rustc 1.22.0-nightly (
0e6f4cf512017-09-27) - New lint:
mut_range_bound
0.0.164
- Update to rustc 1.22.0-nightly (
6c476ce462017-09-25) - New lint:
int_plus_one
0.0.163
- Update to rustc 1.22.0-nightly (
14039a42a2017-09-22)
0.0.162
- Update to rustc 1.22.0-nightly (
0701b37d92017-09-18) - New lint:
chars_last_cmp - Improved suggestions for
needless_borrow,ptr_arg,
0.0.161
- Update to rustc 1.22.0-nightly (
539f2083d2017-09-13)
0.0.160
- Update to rustc 1.22.0-nightly (
dd08c30702017-09-12)
0.0.159
- Update to rustc 1.22.0-nightly (
eba374fb22017-09-11) - New lint:
clone_on_ref_ptr
0.0.158
- New lint:
manual_memcpy cast_losslessno longer has redundant parentheses in its suggestions- Update to rustc 1.22.0-nightly (
dead08cb32017-09-08)
0.0.157 - 2017-09-04
- Update to rustc 1.22.0-nightly (
981ce7d8d2017-09-03) - New lint:
unit_expr
0.0.156 - 2017-09-03
- Update to rustc 1.22.0-nightly (
744dd6c1d2017-09-02)
0.0.155
- Update to rustc 1.21.0-nightly (
c11f689d22017-08-29) - New lint:
infinite_iter,maybe_infinite_iter,cast_lossless
0.0.154
- Update to rustc 1.21.0-nightly (
2c0558f632017-08-24) - Fix
use_selftriggering inside derives - Add support for linting an entire workspace with
cargo clippy --all - New lint:
naive_bytecount
0.0.153
0.0.152
- Update to rustc 1.21.0-nightly (
df511d5542017-08-14)
0.0.151
- Update to rustc 1.21.0-nightly (
13d94d5fa2017-08-10)
0.0.150
- Update to rustc 1.21.0-nightly (
215e0b10e2017-08-08)
0.0.148
- Update to rustc 1.21.0-nightly (
37c7d0ebb2017-07-31) - New lints:
unreadable_literal,inconsistent_digit_grouping,large_digit_groups
0.0.147
- Update to rustc 1.21.0-nightly (
aac223f4f2017-07-30)
0.0.146
- Update to rustc 1.21.0-nightly (
52a3309692017-07-27) - Fixes false positives in
inline_always - Fixes false negatives in
panic_params
0.0.145
- Update to rustc 1.20.0-nightly (
afe145d222017-07-23)
0.0.144
- Update to rustc 1.20.0-nightly (
086eaa78e2017-07-15)
0.0.143
- Update to rustc 1.20.0-nightly (
d84693b932017-07-09) - Fix
cargo clippycrashing ondylibprojects - Fix false positives around
nested_while_letandnever_loop
0.0.142
- Update to rustc 1.20.0-nightly (
0679711392017-07-02)
0.0.141
- 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 (
69c65d2962017-06-28)
0.0.140 - 2017-06-16
- Update to rustc 1.19.0-nightly (
258ae6dd92017-06-15)
0.0.139 — 2017-06-10
- Update to rustc 1.19.0-nightly (
4bf5c99af2017-06-10) - Fix bugs with for loop desugaring
- Check for
AsRef/AsMutarguments inwrong_self_convention
0.0.138 — 2017-06-05
- Update to rustc 1.19.0-nightly (
0418fa9d32017-06-04)
0.0.137 — 2017-06-05
- Update to rustc 1.19.0-nightly (
6684d176c2017-06-03)
0.0.136 — 2017—05—26
- Update to rustc 1.19.0-nightly (
5579677662017-05-26)
0.0.135 — 2017—05—24
- Update to rustc 1.19.0-nightly (
5b13bff522017-05-23)
0.0.134 — 2017—05—19
- Update to rustc 1.19.0-nightly (
0ed1ec9f92017-05-18)
0.0.133 — 2017—05—14
- Update to rustc 1.19.0-nightly (
826d8f3852017-05-13)
0.0.132 — 2017—05—05
- Fix various bugs and some ices
0.0.131 — 2017—05—04
- Update to rustc 1.19.0-nightly (
2d4ed8e0c2017-05-03)
0.0.130 — 2017—05—03
- Update to rustc 1.19.0-nightly (
6a5fc9eec2017-05-02)
0.0.129 — 2017-05-01
- Update to rustc 1.19.0-nightly (
06fb4d2562017-04-30)
0.0.128 — 2017-04-28
- Update to rustc 1.18.0-nightly (
94e884b632017-04-27)
0.0.127 — 2017-04-27
- Update to rustc 1.18.0-nightly (
0369832012017-04-26) - New lint:
needless_continue
0.0.126 — 2017-04-24
- Update to rustc 1.18.0-nightly (
2bd4b5c6d2017-04-23)
0.0.125 — 2017-04-19
- Update to rustc 1.18.0-nightly (
9f2abadca2017-04-18)
0.0.124 — 2017-04-16
- Update to rustc 1.18.0-nightly (
d5cf1cb642017-04-15)
0.0.123 — 2017-04-07
- Fix various false positives
0.0.122 — 2017-04-07
0.0.121 — 2017-03-21
- Rustup to rustc 1.17.0-nightly (
134c4a0f02017-03-20)
0.0.120 — 2017-03-17
- Rustup to rustc 1.17.0-nightly (
0aeb9c1292017-03-15)
0.0.119 — 2017-03-13
- Rustup to rustc 1.17.0-nightly (
824c9ebbd2017-03-12)
0.0.118 — 2017-03-05
- Rustup to rustc 1.17.0-nightly (
b1e31766d2017-03-03)
0.0.117 — 2017-03-01
- Rustup to rustc 1.17.0-nightly (
be760566c2017-02-28)
0.0.116 — 2017-02-28
- Fix
cargo clippyon 64 bit windows systems
0.0.115 — 2017-02-27
- Rustup to rustc 1.17.0-nightly (
60a0edc6c2017-02-26) - New lints:
zero_ptr,never_loop,mut_from_ref
0.0.114 — 2017-02-08
- Rustup to rustc 1.17.0-nightly (
c49d102072017-02-07) - Tests are now ui tests (testing the exact output of rustc)
0.0.113 — 2017-02-04
- Rustup to rustc 1.16.0-nightly (
eedaa94e32017-02-02) - New lint:
large_enum_variant explicit_into_iter_loopprovides suggestions
0.0.112 — 2017-01-27
- Rustup to rustc 1.16.0-nightly (
df8debf6d2017-01-25)
0.0.111 — 2017-01-21
- Rustup to rustc 1.16.0-nightly (
a52da95ce2017-01-20)
0.0.110 — 2017-01-20
- Add badges and categories to
Cargo.toml
0.0.109 — 2017-01-19
- Update to rustc 1.16.0-nightly (
c07a6ae772017-01-17)
0.0.108 — 2017-01-12
- Update to rustc 1.16.0-nightly (
2782e8f8f2017-01-12)
0.0.107 — 2017-01-11
- 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
0.0.106 — 2017-01-04
- Fix FP introduced by rustup in
wrong_self_convention
0.0.105 — 2017-01-04
- Update to rustc 1.16.0-nightly (
4682271292017-01-03) - New lints:
deref_addrof,double_parens,pub_enum_variant_names - Fix suggestion in
new_without_default - FP fix in
absurd_extreme_comparisons
0.0.104 — 2016-12-15
- Update to rustc 1.15.0-nightly (
8f02c429a2016-12-15)
0.0.103 — 2016-11-25
- Update to rustc 1.15.0-nightly (
d5814b03e2016-11-23)
0.0.102 — 2016-11-24
- Update to rustc 1.15.0-nightly (
3bf2be9ce2016-11-22)
0.0.101 — 2016-11-23
- Update to rustc 1.15.0-nightly (
7b3eeea222016-11-21) - New lint:
string_extend_chars
0.0.100 — 2016-11-20
- Update to rustc 1.15.0-nightly (
ac635aa952016-11-18)
0.0.99 — 2016-11-18
- Update to rustc 1.15.0-nightly (
0ed9519932016-11-14) - New lint:
get_unwrap
0.0.98 — 2016-11-08
- Fixes an issue due to a change in how cargo handles
--sysroot, which brokecargo clippy
0.0.97 — 2016-11-03
- 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 (
5665bdf3e2016-11-02) - New lints:
if_let_redundant_pattern_matching,partialeq_ne_impl
0.0.96 — 2016-10-22
- Rustup to rustc 1.14.0-nightly (
f094206852016-10-20) - New lint:
iter_skip_next
0.0.95 — 2016-10-06
- Rustup to rustc 1.14.0-nightly (
3210fd5c22016-10-05)
0.0.94 — 2016-10-04
- Fixes bustage on Windows due to forbidden directory name
0.0.93 — 2016-10-03
- Rustup to rustc 1.14.0-nightly (
144af3e972016-10-02) option_map_unwrap_orandoption_map_unwrap_or_elseare now allowed by default.- New lint:
explicit_into_iter_loop
0.0.92 — 2016-09-30
- Rustup to rustc 1.14.0-nightly (
289f3a4ca2016-09-29)
0.0.91 — 2016-09-28
- Rustup to rustc 1.13.0-nightly (
d0623cf7b2016-09-26)
0.0.90 — 2016-09-09
- Rustup to rustc 1.13.0-nightly (
f1f40f8502016-09-09)
0.0.89 — 2016-09-06
- Rustup to rustc 1.13.0-nightly (
cbe4de78e2016-09-05)
0.0.88 — 2016-09-04
- Rustup to rustc 1.13.0-nightly (
70598e04f2016-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.
0.0.87 — 2016-08-31
- Rustup to rustc 1.13.0-nightly (
eac41469d2016-08-30) - New lints:
builtin_type_shadow - Fix FP in
zero_prefixed_literaland0b/0o
0.0.86 — 2016-08-28
- Rustup to rustc 1.13.0-nightly (
a23064af52016-08-27) - New lints:
missing_docs_in_private_items,zero_prefixed_literal
0.0.85 — 2016-08-19
- Fix ICE with
useless_attribute useless_attributeignoresunused_importsonusestatements
0.0.84 — 2016-08-18
- Rustup to rustc 1.13.0-nightly (
aef6971ca2016-08-17)
0.0.83 — 2016-08-17
- Rustup to rustc 1.12.0-nightly (
1bf5fa3262016-08-16) - New lints:
print_with_newline,useless_attribute
0.0.82 — 2016-08-17
- Rustup to rustc 1.12.0-nightly (
197be89f32016-08-15) - New lint:
module_inception
0.0.81 — 2016-08-14
- Rustup to rustc 1.12.0-nightly (
1deb02ea62016-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
0.0.80 — 2016-07-31
- Rustup to rustc 1.12.0-nightly (
1225e122f2016-07-30) - New lints:
misrefactored_assign_op,serde_api_misuse
0.0.79 — 2016-07-10
- Rustup to rustc 1.12.0-nightly (
f93aaf84c2016-07-09) - Major suggestions refactoring
0.0.78 — 2016-07-02
- Rustup to rustc 1.11.0-nightly (
01411937f2016-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
0.0.77 — 2016-06-21
0.0.76 — 2016-06-10
- Rustup to rustc 1.11.0-nightly (
7d2f75a952016-06-09) cargo clippynow automatically defines theclippyfeature- New lint:
not_unsafe_ptr_arg_deref
0.0.75 — 2016-06-08
- Rustup to rustc 1.11.0-nightly (
763f9234b2016-06-06)
0.0.74 — 2016-06-07
- Fix bug with
cargo-clippyJSON parsing - Add the
CLIPPY_DISABLE_DOCS_LINKSenvironment variable to deactivate the “for further information visit lint-link” message.
0.0.73 — 2016-06-05
- Fix false positives in
useless_let_if_seq
0.0.72 — 2016-06-04
- Fix false positives in
useless_let_if_seq
0.0.71 — 2016-05-31
- Rustup to rustc 1.11.0-nightly (
a967611d82016-05-30) - New lint:
useless_let_if_seq
0.0.70 — 2016-05-28
- Rustup to rustc 1.10.0-nightly (
7bddce6932016-05-27) invalid_regexandtrivial_regexcan now warn onRegexSet::new,RegexBuilder::newand byte regexes
0.0.69 — 2016-05-20
- Rustup to rustc 1.10.0-nightly (
476fe6eef2016-05-21) used_underscore_bindinghas been madeAllowtemporarily
0.0.68 — 2016-05-17
- Rustup to rustc 1.10.0-nightly (
cd6a400172016-05-16) - New lint:
unnecessary_operation
0.0.67 — 2016-05-12
- Rustup to rustc 1.10.0-nightly (
22ac88f1a2016-05-11)
0.0.66 — 2016-05-11
- New
cargo clippysubcommand - New lints:
assign_op_pattern,assign_ops,needless_borrow
0.0.65 — 2016-05-08
- Rustup to rustc 1.10.0-nightly (
62e2b2fb72016-05-06) - New lints:
float_arithmetic,integer_arithmetic
0.0.64 — 2016-04-26
- Rustup to rustc 1.10.0-nightly (
645dd013a2016-04-24) - New lints:
temporary_cstring_as_ptr,unsafe_removed_from_name, andmem_forget
0.0.63 — 2016-04-08
- Rustup to rustc 1.9.0-nightly (
7979dd6082016-04-07)
0.0.62 — 2016-04-07
- Rustup to rustc 1.9.0-nightly (
bf5da36f12016-04-06)
0.0.61 — 2016-04-03
- Rustup to rustc 1.9.0-nightly (
5ab11d72c2016-04-02) - New lint:
invalid_upcast_comparisons
0.0.60 — 2016-04-01
- Rustup to rustc 1.9.0-nightly (
e1195c24b2016-03-31)
0.0.59 — 2016-03-31
- Rustup to rustc 1.9.0-nightly (
30a3849f22016-03-30) - New lints:
logic_bug,nonminimal_bool - Fixed:
match_same_armsnow ignores arms with guards - Improved:
useless_vecnow warns onfor … in vec![…]
0.0.58 — 2016-03-27
- Rustup to rustc 1.9.0-nightly (
d5a91e6952016-03-26) - New lint:
doc_markdown
0.0.57 — 2016-03-27
- Update to rustc 1.9.0-nightly (
a1e29daf12016-03-25) - Deprecated lints:
str_to_string,string_to_string,unstable_as_slice,unstable_as_mut_slice - New lint:
crosspointer_transmute
0.0.56 — 2016-03-23
- Update to rustc 1.9.0-nightly (
0dcc413e42016-03-22) - New lints:
many_single_char_namesandsimilar_names
0.0.55 — 2016-03-21
- Update to rustc 1.9.0-nightly (
02310fd312016-03-19)
0.0.54 — 2016-03-16
- Update to rustc 1.9.0-nightly (
c66d2380a2016-03-15)
0.0.53 — 2016-03-15
- Add a configuration file
0.0.52
0.0.51 — 2016-03-13
- Add
strto types considered bylen_zero - New lints:
indexing_slicing
0.0.50 — 2016-03-11
- Update to rustc 1.9.0-nightly (
c9629d61c2016-03-10)
0.0.49 — 2016-03-09
- Update to rustc 1.9.0-nightly (
eabfc160f2016-03-08) - New lints:
overflow_check_conditional,unused_label,new_without_default
0.0.48 — 2016-03-07
- Fixed: ICE in
needless_range_loopwith globals
0.0.47 — 2016-03-07
- Update to rustc 1.9.0-nightly (
998a6720b2016-03-07) - New lint:
redundant_closure_call