Skip to content

Update Clippy #79228

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 149 commits into from
Nov 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
149 commits
Select commit Hold shift + click to select a range
be81608
split `interior_mutable_const` tests and clean it
rail-rain Sep 30, 2020
f58a169
fix a FP in `interior_mutable_const`
rail-rain Sep 30, 2020
7c74d87
Fix vec_box scope error
camsteffen Oct 30, 2020
c0d1002
Fix unnecessary_lazy_eval suggestion applicability
camsteffen Oct 30, 2020
158bf9a
Fix incorrect suggestion for macro expansion in `deref_addrof` lint
ThibsG Oct 31, 2020
343bdb3
Give better suggestion by working on span on `deref_addrof` lint
ThibsG Nov 2, 2020
ce98468
Fix incorrect suggestion when from expansion in `try_err` lint
ThibsG Nov 2, 2020
a6611de
Include bindings as machine applicable
camsteffen Nov 2, 2020
89fa373
rustc_ast: Do not panic by default when visiting macro calls
petrochenkov Nov 3, 2020
c2a769f
rustc_ast: `visit_mac` -> `visit_mac_call`
petrochenkov Nov 3, 2020
a4acb31
Fix example for cargo common data
Urcra Nov 4, 2020
fd8dece
Readme improvements
camsteffen Nov 3, 2020
bc27d14
Add string_from_utf8_as_bytes linter
patrickelectric Oct 8, 2020
f83762b
Skip rustfmt as it is wanted for this test
ThibsG Nov 2, 2020
3424419
Merge commit 'b20d4c155d2fe3a8391f86dcf9a8c49e17188703' into clippyup
flip1995 Nov 5, 2020
83e75f9
Fix incorrect suggestion for `try_err` lint when `Err` arg is itself …
ThibsG Nov 5, 2020
1e4ce0f
Fix `await_holding_refcell_ref` examples for clarify
JohnTitor Nov 5, 2020
1624b00
Fix suggestion to add unneeded space in `manual_async`
giraffate Nov 5, 2020
5f57608
do not trigger map_clone in the case of &mut
alex-700 Nov 6, 2020
b7892c6
Refactor to make getting position just before RArrow a common function
giraffate Nov 6, 2020
8242b2f
Remove needless allow
ThibsG Oct 30, 2020
2ea08e1
Auto merge of #6294 - giraffate:fix_suggestion_to_add_space_in_manual…
bors Nov 6, 2020
5253595
FROM_ITER_INSTEAD_OF_COLLECT: avoid unwrapping unconditionally
matthiaskrgr Nov 6, 2020
4bbef42
Auto merge of #6272 - camsteffen:unnecesary-lazy-eval-type, r=llogiq
bors Nov 7, 2020
694cec1
Auto merge of #6110 - rail-rain:care_enums_non_copy_const, r=llogiq
bors Nov 7, 2020
92ba075
Auto merge of #6134 - patrickelectric:as_utf8, r=llogiq
bors Nov 7, 2020
4aca13f
Auto merge of #6287 - camsteffen:readme, r=llogiq
bors Nov 7, 2020
5effc99
Auto merge of #6298 - JohnTitor:fix-example, r=llogiq
bors Nov 7, 2020
c015622
Auto merge of #6304 - matthiaskrgr:crash_6302, r=llogiq
bors Nov 7, 2020
96d5f45
Auto merge of #6301 - alex-700:fix-map-clone, r=matthiaskrgr
bors Nov 8, 2020
c6a91df
Enable empty_loop lint for no_std crates
josephlr Oct 23, 2020
3579b7d
Update clippy_lints/src/loops.rs
josephlr Nov 4, 2020
00dee9d
Update reference files
flip1995 Nov 8, 2020
abfa331
Auto merge of #6205 - josephlr:empty-loop2, r=flip1995
bors Nov 8, 2020
f1f780c
Add let_underscore_drop
smoelius Nov 7, 2020
b1faa7f
Auto merge of #6271 - camsteffen:vec-box-import, r=flip1995
bors Nov 8, 2020
9c6a0b9
Update references
smoelius Nov 8, 2020
7079de9
Auto merge of #6293 - Urcra:lint-example-fix, r=flip1995
bors Nov 8, 2020
7c612c1
Force contributors/reviewers to set _some_ changelog entry
flip1995 Nov 8, 2020
040d0ca
Auto merge of #6288 - flip1995:changelog_internal, r=matthiaskrgr
bors Nov 8, 2020
b099406
Make KNOW_TYPES static
camsteffen Oct 29, 2020
9cab084
Fix or_fun_call for index operator
camsteffen Oct 29, 2020
2067a01
Auto merge of #6267 - camsteffen:or-fun-idx, r=flip1995
bors Nov 8, 2020
aa6bf1f
Update clippy_lints/src/let_underscore.rs
smoelius Nov 8, 2020
9751cba
Update clippy_lints/src/let_underscore.rs
smoelius Nov 8, 2020
8211b59
Update clippy_lints/src/let_underscore.rs
smoelius Nov 8, 2020
40d7af5
Update lints
smoelius Nov 8, 2020
8845f10
Do not collect tokens for doc comments
petrochenkov Nov 5, 2020
06e81bb
Update references
smoelius Nov 8, 2020
d212c38
Auto merge of #6278 - ThibsG:DerefAddrOf, r=llogiq
bors Nov 9, 2020
4852cca
Allow `let_underscore_drop` in `filter_methods` test
smoelius Nov 9, 2020
6294300
Rollup merge of #78710 - petrochenkov:macvisit, r=davidtwco
Dylan-DPC Nov 9, 2020
dd826b4
Auto merge of #6305 - smoelius:master, r=flip1995
bors Nov 9, 2020
3ea6f77
Merge remote-tracking branch 'upstream/master' into rustup
ebroto Nov 10, 2020
effcb52
Run cargo dev fmt
ebroto Nov 10, 2020
467bf95
Auto merge of #6319 - ebroto:rustup, r=ebroto
bors Nov 10, 2020
d0858d0
Auto merge of #6303 - ThibsG:OptionOptionSerde, r=ebroto
bors Nov 10, 2020
7690944
Fix map_clone with deref and clone
camsteffen Oct 30, 2020
c4fc076
Auto merge of #6269 - camsteffen:map-clone-deref, r=ebroto
bors Nov 11, 2020
a1cf2d3
Added a lint as suggested in 6010 which recommends using `contains()`
rsulli55 Oct 6, 2020
431fcbc
Moved the tests for lint `search_is_some` to new files
rsulli55 Oct 17, 2020
55dc822
Ran `tests/ui/update-all-references.sh" and `cargo dev fmt`
rsulli55 Oct 17, 2020
e9612f3
Remove `to_string` on msg
rsulli55 Oct 26, 2020
fb74b48
Remove borrow
rsulli55 Oct 26, 2020
ee1b959
Added period back to lint `search_is_some` and ran
rsulli55 Oct 31, 2020
fd30313
Cleaned up message and suggestion for `lint_search_is_some`
rsulli55 Nov 7, 2020
56d252c
Update clippy_lints/src/methods/mod.rs
rsulli55 Nov 11, 2020
5c1c50e
Change variable named `foo` and rerun `update-all-references`
rsulli55 Nov 11, 2020
f92f8d0
Fix typo in comment
eltociear Nov 11, 2020
5f310d9
Implement destructuring assignment for structs and slices
fanzier Nov 7, 2020
5f64867
Fix suggestion in `manual_range_contains` when using float
giraffate Nov 11, 2020
92ece84
Auto merge of #78782 - petrochenkov:nodoctok, r=Aaron1011
bors Nov 12, 2020
bd13a35
Auto merge of #6325 - flip1995:rustup, r=flip1995
bors Nov 12, 2020
3a648ff
Rollup merge of #78836 - fanzier:struct-and-slice-destructuring, r=pe…
m-ou-se Nov 12, 2020
c6b74df
Fix dogfood test
giraffate Nov 13, 2020
cf7b4b0
Auto merge of #6329 - giraffate:sync-from-rust, r=matthiaskrgr
bors Nov 13, 2020
7987f39
update clippy test ouput
vn-ki Nov 13, 2020
408b615
Auto merge of #6320 - giraffate:fix_suggestion_in_manual_range_contai…
bors Nov 14, 2020
864e554
Add underscore expressions for destructuring assignments
fanzier Nov 11, 2020
0c7a48c
Auto merge of #78809 - vn-ki:fix-issue-76064, r=oli-obk
bors Nov 14, 2020
cbb6b1c
Introduce `TypeVisitor::BreakTy`
LeSeulArtichaut Nov 5, 2020
1b55cc7
Set the default `BreakTy` to `!`
LeSeulArtichaut Nov 14, 2020
27a1572
Rollup merge of #79016 - fanzier:underscore-expressions, r=petrochenkov
jonas-schievink Nov 15, 2020
db04641
Auto merge of #6334 - flip1995:rustup, r=flip1995
bors Nov 15, 2020
0e80341
Add `rustfmt::skip` as a work around
giraffate Nov 16, 2020
df3bb58
Auto merge of #6336 - giraffate:sync-from-rust, r=flip1995
bors Nov 16, 2020
ad4f829
Auto merge of #6119 - rsulli55:find_is_some_on_strs, r=flip1995
bors Nov 16, 2020
3567ea5
clippy: fold by value
lcnr Oct 24, 2020
5b8f2b6
Remove `expect()` calls to avoid ICEs in `deref_addrof` lint
ThibsG Nov 16, 2020
a467c51
Auto merge of #78779 - LeSeulArtichaut:ty-visitor-return, r=oli-obk
bors Nov 17, 2020
a7ac441
Add new lint to detect unnecessarily wrapped value
hkmatsumoto Sep 19, 2020
750c118
Add suggestion on type signatures
hkmatsumoto Sep 20, 2020
0335b8d
Fix lint example
hkmatsumoto Sep 20, 2020
0e9d227
Add test cases
hkmatsumoto Sep 20, 2020
ebdd4e2
Refactor code according to reivews
hkmatsumoto Sep 22, 2020
6a62390
Optout rustfix test
hkmatsumoto Sep 22, 2020
3ed8902
Fix typo
hkmatsumoto Sep 22, 2020
c775856
Call `diag.multipart_suggestion` instead
hkmatsumoto Sep 22, 2020
a433d46
Run rustfmt
hkmatsumoto Sep 22, 2020
cdb72df
Split lint suggestion into two
hkmatsumoto Sep 26, 2020
6b55f3f
Add test case
hkmatsumoto Sep 26, 2020
df0d565
Move `find_all_ret_expressions` into `utils`
hkmatsumoto Oct 2, 2020
eec7f5c
Update clippy_lints/src/unnecessary_wrap.rs
hkmatsumoto Oct 12, 2020
1bdac87
Improve lint message
hkmatsumoto Oct 12, 2020
8392bc7
Run `cargo dev fmt`
hkmatsumoto Oct 12, 2020
2f85aa7
Make lint skip closures
hkmatsumoto Oct 18, 2020
12474c6
Add support for methods
hkmatsumoto Oct 18, 2020
c5447eb
Make lint skip macros
hkmatsumoto Oct 18, 2020
c7692cf
Skip function with no exprs contained
hkmatsumoto Oct 18, 2020
30632fb
Allow this lint on lint tests
hkmatsumoto Oct 18, 2020
e998d61
Downgrade applicability to MaybeIncorrect
hkmatsumoto Oct 18, 2020
9d96311
Remove wildcard use
hkmatsumoto Oct 18, 2020
532d205
Skip functions in PartialOrd
hkmatsumoto Oct 18, 2020
bf46f78
Fix clippy error
hkmatsumoto Oct 18, 2020
86331a4
Update stderr files
hkmatsumoto Nov 2, 2020
4c8d248
Update stderr files
hkmatsumoto Nov 14, 2020
4e5c02e
Ignore trait implementations
hkmatsumoto Nov 14, 2020
1f577c0
Fix embarrassing grammatical error
hkmatsumoto Nov 14, 2020
c7445d7
Pluralize lint name
hkmatsumoto Nov 17, 2020
bf2d31d
Run cargo dev fmt
flip1995 Nov 17, 2020
a8cafc6
Auto merge of #6338 - flip1995:rustup, r=flip1995
bors Nov 17, 2020
5464cbe
Auto merge of #6337 - ThibsG:FixIce6332, r=Manishearth
bors Nov 17, 2020
4e4c4fb
Fix handling of panic calls
camelid Nov 17, 2020
44d9445
Auto merge of #6070 - matsujika:unnecessary_wrap, r=flip1995
bors Nov 17, 2020
0502ac2
Improve doc about `map_clone`
giraffate Nov 17, 2020
8c2e2fd
Auto merge of #6340 - giraffate:improve_doc_for_map_clone, r=Manishearth
bors Nov 18, 2020
6494bd0
Revert "Add `rustfmt::skip` as a work around"
giraffate Nov 18, 2020
577ebc8
Rollup merge of #79145 - camelid:clippy-fix-panics, r=flip1995
m-ou-se Nov 18, 2020
b2aefb8
Auto merge of #6345 - giraffate:follow_up_of_rustup, r=flip1995
bors Nov 19, 2020
4bf58bd
Add CHANGELOG for 1.48
flip1995 Nov 19, 2020
a98acdb
Fix trailing whitespaces in CHANGELOG file
flip1995 Nov 19, 2020
e9afdf0
Improve changlog update documentation
flip1995 Nov 19, 2020
78faaef
Remove the clippy::panic-params lint.
m-ou-se Nov 19, 2020
113c147
Clippy: Match on assert!() expansions without an inner block.
m-ou-se Nov 19, 2020
dd4e471
Properly deprecate panic_params lint
flip1995 Nov 20, 2020
5ee0a40
Fix dogfood errors
flip1995 Nov 20, 2020
8325d48
Auto merge of #6351 - flip1995:rustup, r=flip1995
bors Nov 20, 2020
70ffebf
Auto merge of #6347 - flip1995:changelog, r=Manishearth
bors Nov 20, 2020
8b21241
Revert "Convert the await holding lints to correctness"
Nov 20, 2020
0402c6a
Auto merge of #6354 - Daniel-B-Smith:refcell_ref_await, r=flip1995
bors Nov 20, 2020
9b910e1
a typo
Nov 22, 2020
e30bb76
update
Nov 22, 2020
4284ec3
Auto merge of #6364 - o752d:master, r=flip1995
bors Nov 22, 2020
831aa96
Auto merge of #6363 - o752d:patch-2, r=flip1995
bors Nov 22, 2020
034244f
Small grammar, punctuation, and code style improvements to docs
carols10cents Nov 21, 2020
445466e
Apply suggestions from code review to change "that" to "which"
carols10cents Nov 22, 2020
3e7c6de
Auto merge of #6361 - integer32llc:doc-style, r=carols10cents
bors Nov 22, 2020
dfac9be
Merge commit '3e7c6dec244539970b593824334876f8b6ed0b18' into clippyup
flip1995 Nov 23, 2020
99b9459
Fix ICE in utils::implements_trait
flip1995 Nov 23, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/tools/clippy/.github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Thank you for making Clippy better!

We're collecting our changelog from pull request descriptions.
If your PR only updates to the latest nightly, you can leave the
`changelog` entry as `none`. Otherwise, please write a short comment
If your PR only includes internal changes, you can just write
`changelog: none`. Otherwise, please write a short comment
explaining your change.

If your PR fixes an issue, you can add "fixes #issue_number" into this
Expand All @@ -28,5 +28,5 @@ Delete this line and everything above before opening your PR.

---

*Please keep the line below*
changelog: none
*Please write a short comment explaining your change (or "none" for internal only changes)*
changelog:
127 changes: 118 additions & 9 deletions src/tools/clippy/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,117 @@ document.

## Unreleased / In Rust Nightly

[e636b88...master](https://github.com/rust-lang/rust-clippy/compare/e636b88...master)
[b20d4c1...master](https://github.com/rust-lang/rust-clippy/compare/b20d4c1...master)

## Rust 1.49

Current beta, release 2020-12-31

[e636b88...b20d4c1](https://github.com/rust-lang/rust-clippy/compare/e636b88...b20d4c1)

### New Lints

* [`field_reassign_with_default`] [#5911](https://github.com/rust-lang/rust-clippy/pull/5911)
* [`await_holding_refcell_ref`] [#6029](https://github.com/rust-lang/rust-clippy/pull/6029)
* [`disallowed_method`] [#6081](https://github.com/rust-lang/rust-clippy/pull/6081)
* [`inline_asm_x86_att_syntax`] [#6092](https://github.com/rust-lang/rust-clippy/pull/6092)
* [`inline_asm_x86_intel_syntax`] [#6092](https://github.com/rust-lang/rust-clippy/pull/6092)
* [`from_iter_instead_of_collect`] [#6101](https://github.com/rust-lang/rust-clippy/pull/6101)
* [`mut_mutex_lock`] [#6103](https://github.com/rust-lang/rust-clippy/pull/6103)
* [`single_element_loop`] [#6109](https://github.com/rust-lang/rust-clippy/pull/6109)
* [`manual_unwrap_or`] [#6123](https://github.com/rust-lang/rust-clippy/pull/6123)
* [`large_types_passed_by_value`] [#6135](https://github.com/rust-lang/rust-clippy/pull/6135)
* [`result_unit_err`] [#6157](https://github.com/rust-lang/rust-clippy/pull/6157)
* [`ref_option_ref`] [#6165](https://github.com/rust-lang/rust-clippy/pull/6165)
* [`manual_range_contains`] [#6177](https://github.com/rust-lang/rust-clippy/pull/6177)
* [`unusual_byte_groupings`] [#6183](https://github.com/rust-lang/rust-clippy/pull/6183)
* [`comparison_to_empty`] [#6226](https://github.com/rust-lang/rust-clippy/pull/6226)
* [`map_collect_result_unit`] [#6227](https://github.com/rust-lang/rust-clippy/pull/6227)
* [`manual_ok_or`] [#6233](https://github.com/rust-lang/rust-clippy/pull/6233)

### Moves and Deprecations

* Rename `single_char_push_str` to [`single_char_add_str`]
[#6037](https://github.com/rust-lang/rust-clippy/pull/6037)
* Rename `zero_width_space` to [`invisible_characters`]
[#6105](https://github.com/rust-lang/rust-clippy/pull/6105)
* Deprecate [`drop_bounds`] (uplifted)
[#6111](https://github.com/rust-lang/rust-clippy/pull/6111)
* Move [`string_lit_as_bytes`] to `nursery`
[#6117](https://github.com/rust-lang/rust-clippy/pull/6117)
* Move [`rc_buffer`] to `restriction`
[#6128](https://github.com/rust-lang/rust-clippy/pull/6128)

### Enhancements

* [`manual_memcpy`]: Also lint when there are loop counters (and produce a
reliable suggestion)
[#5727](https://github.com/rust-lang/rust-clippy/pull/5727)
* [`single_char_add_str`]: Also lint on `String::insert_str`
[#6037](https://github.com/rust-lang/rust-clippy/pull/6037)
* [`invisible_characters`]: Also lint the characters `\u{AD}` and `\u{2060}`
[#6105](https://github.com/rust-lang/rust-clippy/pull/6105)
* [`eq_op`]: Also lint on the `assert_*!` macro family
[#6167](https://github.com/rust-lang/rust-clippy/pull/6167)
* [`items_after_statements`]: Also lint in local macro expansions
[#6176](https://github.com/rust-lang/rust-clippy/pull/6176)
* [`unnecessary_cast`]: Also lint casts on integer and float literals
[#6187](https://github.com/rust-lang/rust-clippy/pull/6187)
* [`manual_unwrap_or`]: Also lint `Result::unwrap_or`
[#6190](https://github.com/rust-lang/rust-clippy/pull/6190)
* [`match_like_matches_macro`]: Also lint when `match` has more than two arms
[#6216](https://github.com/rust-lang/rust-clippy/pull/6216)
* [`integer_arithmetic`]: Better handle `/` an `%` operators
[#6229](https://github.com/rust-lang/rust-clippy/pull/6229)

### False Positive Fixes

* [`needless_lifetimes`]: Bail out if the function has a `where` clause with the
lifetime [#5978](https://github.com/rust-lang/rust-clippy/pull/5978)
* [`explicit_counter_loop`]: No longer lints, when loop counter is used after it
is incremented [#6076](https://github.com/rust-lang/rust-clippy/pull/6076)
* [`or_fun_call`]: Revert changes addressing the handling of `const fn`
[#6077](https://github.com/rust-lang/rust-clippy/pull/6077)
* [`needless_range_loop`]: No longer lints, when the iterable is used in the
range [#6102](https://github.com/rust-lang/rust-clippy/pull/6102)
* [`inconsistent_digit_grouping`]: Fix bug when using floating point exponent
[#6104](https://github.com/rust-lang/rust-clippy/pull/6104)
* [`mistyped_literal_suffixes`]: No longer lints on the fractional part of a
float (e.g. `713.32_64`)
[#6114](https://github.com/rust-lang/rust-clippy/pull/6114)
* [`invalid_regex`]: No longer lint on unicode characters within `bytes::Regex`
[#6132](https://github.com/rust-lang/rust-clippy/pull/6132)
* [`boxed_local`]: No longer lints on `extern fn` arguments
[#6133](https://github.com/rust-lang/rust-clippy/pull/6133)
* [`needless_lifetimes`]: Fix regression, where lifetime is used in `where`
clause [#6198](https://github.com/rust-lang/rust-clippy/pull/6198)

### Suggestion Fixes/Improvements

* [`unnecessary_sort_by`]: Avoid dereferencing the suggested closure parameter
[#6078](https://github.com/rust-lang/rust-clippy/pull/6078)
* [`needless_arbitrary_self_type`]: Correctly handle expanded code
[#6093](https://github.com/rust-lang/rust-clippy/pull/6093)
* [`useless_format`]: Preserve raw strings in suggestion
[#6151](https://github.com/rust-lang/rust-clippy/pull/6151)
* [`empty_loop`]: Suggest alternatives
[#6162](https://github.com/rust-lang/rust-clippy/pull/6162)
* [`borrowed_box`]: Correctly add parentheses in suggestion
[#6200](https://github.com/rust-lang/rust-clippy/pull/6200)
* [`unused_unit`]: Improve suggestion formatting
[#6247](https://github.com/rust-lang/rust-clippy/pull/6247)

### Documentation Improvements

* Some doc improvements:
* [`rc_buffer`] [#6090](https://github.com/rust-lang/rust-clippy/pull/6090)
* [`empty_loop`] [#6162](https://github.com/rust-lang/rust-clippy/pull/6162)
* [`doc_markdown`]: Document problematic link text style
[#6107](https://github.com/rust-lang/rust-clippy/pull/6107)

## Rust 1.48

Current beta, release 2020-11-19
Current stable, released 2020-11-19

[09bd400...e636b88](https://github.com/rust-lang/rust-clippy/compare/09bd400...e636b88)

Expand Down Expand Up @@ -56,15 +162,15 @@ Current beta, release 2020-11-19

* [`useless_attribute`]: permit allowing [`wildcard_imports`] and [`enum_glob_use`]
[#5994](https://github.com/rust-lang/rust-clippy/pull/5994)
* [`transmute_ptr_to_ptr`]: avoid suggesting dereferencing raw pointers in const contexts
* [`transmute_ptr_to_ptr`]: avoid suggesting dereferencing raw pointers in const contexts
[#5999](https://github.com/rust-lang/rust-clippy/pull/5999)
* [`redundant_closure_call`]: take into account usages of the closure in nested functions and closures
[#5920](https://github.com/rust-lang/rust-clippy/pull/5920)
* Fix false positive in [`borrow_interior_mutable_const`] when referencing a field behind a pointer
[#5949](https://github.com/rust-lang/rust-clippy/pull/5949)
* [`doc_markdown`]: allow using "GraphQL" without backticks
[#5996](https://github.com/rust-lang/rust-clippy/pull/5996)
* [`to_string_in_display`]: avoid linting when calling `to_string()` on anything that is not `self`
* [`to_string_in_display`]: avoid linting when calling `to_string()` on anything that is not `self`
[#5971](https://github.com/rust-lang/rust-clippy/pull/5971)
* [`indexing_slicing`] and [`out_of_bounds_indexing`] treat references to arrays as arrays
[#6034](https://github.com/rust-lang/rust-clippy/pull/6034)
Expand All @@ -85,27 +191,27 @@ Current beta, release 2020-11-19
[#5946](https://github.com/rust-lang/rust-clippy/pull/5946)
* [`useless_conversion`]: show the type in the error message
[#6035](https://github.com/rust-lang/rust-clippy/pull/6035)
* [`unnecessary_mut_passed`]: discriminate between functions and methods in the error message
* [`unnecessary_mut_passed`]: discriminate between functions and methods in the error message
[#5892](https://github.com/rust-lang/rust-clippy/pull/5892)
* [`float_cmp`] and [`float_cmp_const`]: change wording to make margin of error less ambiguous
[#6043](https://github.com/rust-lang/rust-clippy/pull/6043)
* [`default_trait_access`]: do not use unnecessary type parameters in the suggestion
[#5993](https://github.com/rust-lang/rust-clippy/pull/5993)
* [`collapsible_if`]: don't use expanded code in the suggestion
* [`collapsible_if`]: don't use expanded code in the suggestion
[#5992](https://github.com/rust-lang/rust-clippy/pull/5992)
* Do not suggest empty format strings in [`print_with_newline`] and [`write_with_newline`]
[#6042](https://github.com/rust-lang/rust-clippy/pull/6042)
* [`unit_arg`]: improve the readability of the suggestion
[#5931](https://github.com/rust-lang/rust-clippy/pull/5931)
* [`stable_sort_primitive`]: print the type that is being sorted in the lint message
* [`stable_sort_primitive`]: print the type that is being sorted in the lint message
[#5935](https://github.com/rust-lang/rust-clippy/pull/5935)
* Show line count and max lines in [`too_many_lines`] lint message
[#6009](https://github.com/rust-lang/rust-clippy/pull/6009)
* Keep parentheses in the suggestion of [`useless_conversion`] where applicable
[#5900](https://github.com/rust-lang/rust-clippy/pull/5900)
* [`option_map_unit_fn`] and [`result_map_unit_fn`]: print the unit type `()` explicitly
[#6024](https://github.com/rust-lang/rust-clippy/pull/6024)
* [`redundant_allocation`]: suggest replacing `Rc<Box<T>>` with `Rc<T>`
* [`redundant_allocation`]: suggest replacing `Rc<Box<T>>` with `Rc<T>`
[#5899](https://github.com/rust-lang/rust-clippy/pull/5899)
* Make lint messages adhere to rustc dev guide conventions
[#5893](https://github.com/rust-lang/rust-clippy/pull/5893)
Expand All @@ -128,7 +234,7 @@ Current beta, release 2020-11-19

## Rust 1.47

Current stable, released 2020-10-08
Released 2020-10-08

[c2c07fa...09bd400](https://github.com/rust-lang/rust-clippy/compare/c2c07fa...09bd400)

Expand Down Expand Up @@ -1787,6 +1893,7 @@ Released 2018-09-13
[`len_without_is_empty`]: https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty
[`len_zero`]: https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
[`let_and_return`]: https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
[`let_underscore_drop`]: https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_drop
[`let_underscore_lock`]: https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_lock
[`let_underscore_must_use`]: https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_must_use
[`let_unit_value`]: https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
Expand Down Expand Up @@ -1956,6 +2063,7 @@ Released 2018-09-13
[`string_add`]: https://rust-lang.github.io/rust-clippy/master/index.html#string_add
[`string_add_assign`]: https://rust-lang.github.io/rust-clippy/master/index.html#string_add_assign
[`string_extend_chars`]: https://rust-lang.github.io/rust-clippy/master/index.html#string_extend_chars
[`string_from_utf8_as_bytes`]: https://rust-lang.github.io/rust-clippy/master/index.html#string_from_utf8_as_bytes
[`string_lit_as_bytes`]: https://rust-lang.github.io/rust-clippy/master/index.html#string_lit_as_bytes
[`string_to_string`]: https://rust-lang.github.io/rust-clippy/master/index.html#string_to_string
[`struct_excessive_bools`]: https://rust-lang.github.io/rust-clippy/master/index.html#struct_excessive_bools
Expand Down Expand Up @@ -2006,6 +2114,7 @@ Released 2018-09-13
[`unnecessary_operation`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_operation
[`unnecessary_sort_by`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by
[`unnecessary_unwrap`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap
[`unnecessary_wraps`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
[`unneeded_field_pattern`]: https://rust-lang.github.io/rust-clippy/master/index.html#unneeded_field_pattern
[`unneeded_wildcard_pattern`]: https://rust-lang.github.io/rust-clippy/master/index.html#unneeded_wildcard_pattern
[`unnested_or_patterns`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnested_or_patterns
Expand Down
32 changes: 13 additions & 19 deletions src/tools/clippy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,22 @@ A collection of lints to catch common mistakes and improve your [Rust](https://g

[There are over 400 lints included in this crate!](https://rust-lang.github.io/rust-clippy/master/index.html)

We have a bunch of lint categories to allow you to choose how much Clippy is supposed to ~~annoy~~ help you:

* `clippy::all` (everything that is on by default: all the categories below except for `nursery`, `pedantic`, and `cargo`)
* `clippy::correctness` (code that is just **outright wrong** or **very very useless**, causes hard errors by default)
* `clippy::style` (code that should be written in a more idiomatic way)
* `clippy::complexity` (code that does something simple but in a complex way)
* `clippy::perf` (code that can be written in a faster way)
* `clippy::pedantic` (lints which are rather strict, off by default)
* `clippy::nursery` (new lints that aren't quite ready yet, off by default)
* `clippy::cargo` (checks against the cargo manifest, off by default)
Lints are divided into categories, each with a default [lint level](https://doc.rust-lang.org/rustc/lints/levels.html).
You can choose how much Clippy is supposed to ~~annoy~~ help you by changing the lint level by category.

Category | Description | Default level
-- | -- | --
`clippy::all` | all lints that are on by default (correctness, style, complexity, perf) | **warn/deny**
`clippy::correctness` | code that is outright wrong or very useless | **deny**
`clippy::style` | code that should be written in a more idiomatic way | **warn**
`clippy::complexity` | code that does something simple but in a complex way | **warn**
`clippy::perf` | code that can be written to run faster | **warn**
`clippy::pedantic` | lints which are rather strict or might have false positives | allow
`clippy::nursery` | new lints that are still under development | allow
`clippy::cargo` | lints for the cargo manifest | allow

More to come, please [file an issue](https://github.com/rust-lang/rust-clippy/issues) if you have ideas!

Only the following of those categories are enabled by default:

* `clippy::style`
* `clippy::correctness`
* `clippy::complexity`
* `clippy::perf`

Other categories need to be enabled in order for their lints to be executed.

The [lint list](https://rust-lang.github.io/rust-clippy/master/index.html) also contains "restriction lints", which are
for things which are usually not considered "bad", but may be useful to turn on in specific cases. These should be used
very selectively, if at all.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ fn match_assert_with_message<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>)
if let ExprKind::Block(ref block, _) = arms[0].body.kind;
if block.stmts.is_empty();
if let Some(block_expr) = &block.expr;
// inner block is optional. unwarp it if it exists, or use the expression as is otherwise.
// inner block is optional. unwrap it if it exists, or use the expression as is otherwise.
if let Some(begin_panic_call) = match block_expr.kind {
ExprKind::Block(ref inner_block, _) => &inner_block.expr,
_ => &block.expr,
Expand Down
12 changes: 6 additions & 6 deletions src/tools/clippy/clippy_lints/src/await_holding_invalid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ declare_clippy_lint! {
/// }
/// ```
pub AWAIT_HOLDING_LOCK,
correctness,
pedantic,
"Inside an async function, holding a MutexGuard while calling await"
}

Expand All @@ -65,8 +65,8 @@ declare_clippy_lint! {
/// use std::cell::RefCell;
///
/// async fn foo(x: &RefCell<u32>) {
/// let b = x.borrow_mut()();
/// *ref += 1;
/// let mut y = x.borrow_mut();
/// *y += 1;
/// bar.await;
/// }
/// ```
Expand All @@ -77,14 +77,14 @@ declare_clippy_lint! {
///
/// async fn foo(x: &RefCell<u32>) {
/// {
/// let b = x.borrow_mut();
/// *ref += 1;
/// let mut y = x.borrow_mut();
/// *y += 1;
/// }
/// bar.await;
/// }
/// ```
pub AWAIT_HOLDING_REFCELL_REF,
correctness,
pedantic,
"Inside an async function, holding a RefCell ref while calling await"
}

Expand Down
15 changes: 15 additions & 0 deletions src/tools/clippy/clippy_lints/src/cargo_common_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,21 @@ declare_clippy_lint! {
/// [package]
/// name = "clippy"
/// version = "0.0.212"
/// description = "A bunch of helpful lints to avoid common pitfalls in Rust"
/// repository = "https://github.com/rust-lang/rust-clippy"
/// readme = "README.md"
/// license = "MIT OR Apache-2.0"
/// keywords = ["clippy", "lint", "plugin"]
/// categories = ["development-tools", "development-tools::cargo-plugins"]
/// ```
///
/// Should include an authors field like:
///
/// ```toml
/// # This `Cargo.toml` includes all common metadata
/// [package]
/// name = "clippy"
/// version = "0.0.212"
/// authors = ["Someone <[email protected]>"]
/// description = "A bunch of helpful lints to avoid common pitfalls in Rust"
/// repository = "https://github.com/rust-lang/rust-clippy"
Expand Down
5 changes: 5 additions & 0 deletions src/tools/clippy/clippy_lints/src/deprecated_lints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,8 @@ declare_deprecated_lint! {
pub TEMPORARY_CSTRING_AS_PTR,
"this lint has been uplifted to rustc and is now called `temporary_cstring_as_ptr`"
}

declare_deprecated_lint! {
pub PANIC_PARAMS,
"this lint has been uplifted to rustc and is now called `panic_fmt`"
}
2 changes: 1 addition & 1 deletion src/tools/clippy/clippy_lints/src/len_zero.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ declare_clippy_lint! {
}

declare_clippy_lint! {
/// **What it does:** Checks for comparing to an empty slice such as "" or [],`
/// **What it does:** Checks for comparing to an empty slice such as `""` or `[]`,
/// and suggests using `.is_empty()` where applicable.
///
/// **Why is this bad?** Some structures can answer `.is_empty()` much faster
Expand Down
Loading