Skip to content
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

Update Clippy #108974

Merged
merged 99 commits into from
Mar 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
99 commits
Select commit Hold shift + click to select a range
c439373
[arithmetic_side_effects] Fix #10252
c410-f3r Feb 12, 2023
f531abc
Do not suggest using Self in const generic parameters
samueltardieu Feb 19, 2023
783b55e
Rename many interner functions.
nnethercote Feb 17, 2023
e5df17a
Use `List::empty()` instead of `mk_substs(&[])`.
nnethercote Feb 20, 2023
730fa93
chore: remove unneeded rustfmt skip
calebcartwright Feb 25, 2023
9fd0a41
Make clippy happy
compiler-errors Feb 23, 2023
49a06ed
Scope missing_docs_in_private_items to only private items
andrewbanchich Feb 12, 2023
0413fb3
Merge commit '149392b0baa4730c68f3c3eadf5c6ed7b16b85a4' into clippyup
Jarcho Feb 26, 2023
e1ac133
Auto merge of #10375 - samueltardieu:issue-10371, r=Manishearth
bors Feb 26, 2023
3d193fa
Auto merge of #10400 - calebcartwright:rustfmt-cleanup, r=Jarcho
bors Feb 26, 2023
002e934
Don't assume paths work with `fn_sig` in `multiple_unsafe_ops_pre_blo…
Jarcho Feb 26, 2023
0f3446b
Remove `from_fn` lang item
Noratrieb Feb 26, 2023
2e2e45a
Rollup merge of #108484 - Nilstrieb:˂DiagnosticItem˂FromFn˃ as From˂˂…
matthiaskrgr Feb 26, 2023
c82ff00
Do not suggest to derive Default on generics with implicit arguments
samueltardieu Feb 25, 2023
5f3df6c
exit lint: potentualy -> potentially
cdown Feb 26, 2023
0966f59
Auto merge of #108474 - Jarcho:clippyup, r=Manishearth
bors Feb 26, 2023
ba7fd68
Auto merge of #10408 - cdown:cdown/2023-02-26/exit_lint_sp, r=Alexendoo
bors Feb 26, 2023
2a9c254
Add `collection_is_never_read`
schubart Feb 16, 2023
2742ac0
Auto merge of #10399 - samueltardieu:issue-10396, r=Manishearth
bors Feb 27, 2023
0870819
Fix lint documentation
schubart Feb 27, 2023
03a3f74
Fixing typos
deining Feb 27, 2023
8b65632
Auto merge of #10419 - deining:fix/typos, r=Jarcho
bors Feb 27, 2023
2cadea5
Fix array-size-threshold config deserialization error
Alexendoo Feb 28, 2023
69a1100
Run dogfood on all packages before failing
Jarcho Feb 27, 2023
90ba82b
Two small documentation improvements
smoelius Feb 28, 2023
acf70ea
Auto merge of #10423 - Alexendoo:array-size-threshold, r=flip1995
bors Feb 28, 2023
1a11ad7
Auto merge of #10405 - Jarcho:issue_10367, r=flip1995
bors Feb 28, 2023
d988734
Auto merge of #10418 - Jarcho:finish_dogfood, r=flip1995
bors Feb 28, 2023
ba86a99
Auto merge of #10324 - andrewbanchich:fix-missing-private-docs, r=dswij
bors Feb 28, 2023
2d9ca94
Auto merge of #10425 - smoelius:docs, r=llogiq
bors Feb 28, 2023
7fb76a1
Update version attribute for 1.68 lints
xFrednet Feb 28, 2023
917ebc3
Changelog for Rust 1.68 :dog:
xFrednet Feb 28, 2023
113c704
Auto merge of #10427 - xFrednet:changelog-1-68, r=Manishearth
bors Feb 28, 2023
5770d40
More compact `use` statements
schubart Feb 28, 2023
cb3bb8a
Add tests that show: insert() can be a read or not
schubart Feb 28, 2023
fbb7fd5
Add test for an interesting edge case
schubart Feb 28, 2023
09566cc
Use UnordSet instead of FxHashSet for names_imported_by_glob_use query.
michaelwoerister Feb 21, 2023
702a83b
Restrict `#[rustc_box]` to `Box::new` calls
clubby789 Feb 27, 2023
5cf9c34
Rollup merge of #108516 - clubby789:rustc-box-restrict, r=compiler-er…
matthiaskrgr Mar 2, 2023
79359cb
rustc_middle: Remove trait `DefIdTree`
petrochenkov Feb 22, 2023
64b54ef
Fix array-size-threshold config deserialization error
Alexendoo Feb 28, 2023
efbcb99
Use `snippet_with_context` more
Jarcho Mar 2, 2023
027f19c
Fix FP for `let_unit_value` when `await` used
giraffate Mar 3, 2023
03b9940
Downgrade let_underscore_untyped to restriction
dtolnay Mar 3, 2023
cc6180c
Include former name of renamed lints in lints.json
dtolnay Mar 4, 2023
d423703
Auto merge of #10443 - dtolnay-contrib:formerids, r=llogiq
bors Mar 4, 2023
308d680
Auto merge of #10442 - dtolnay-contrib:letunderscore, r=llogiq
bors Mar 4, 2023
446ae42
lintcheck: fix parallel processing handling
samueltardieu Mar 2, 2023
2500f96
Auto merge of #10439 - giraffate:fix_fp_for_let_unit_value, r=Jarcho
bors Mar 4, 2023
79829d8
lintcheck: use clap's derive interface
samueltardieu Mar 4, 2023
78f0f78
Auto merge of #10445 - samueltardieu:lintcheck-maintenance, r=llogiq
bors Mar 4, 2023
f95d9de
Handle ambiguous projections
smoelius Feb 25, 2023
70e85d1
Auto merge of #10403 - smoelius:fix-107877, r=Jarcho
bors Mar 5, 2023
ea2073a
Auto merge of #108351 - petrochenkov:rmdit, r=cjgillot
bors Mar 5, 2023
783bc62
Auto merge of #10438 - Jarcho:use_snip_ctxt, r=dswij
bors Mar 5, 2023
b6f0ebf
help: refer to `cargo check --help`
samueltardieu Mar 5, 2023
9035958
Auto merge of #10457 - samueltardieu:issue-10436, r=Manishearth
bors Mar 5, 2023
85ad8a6
Avoid false positives from extension traits
schubart Mar 6, 2023
a2906a1
Migrate `write.rs` to `rustc_ast::FormatArgs`
Alexendoo Feb 1, 2023
dc23e42
Add `format_args_collector` internal lint
Alexendoo Feb 2, 2023
fa0c3cc
Move test for 10148 to tests/ui/crashes
Alexendoo Mar 6, 2023
4ee6553
Add test where container is passed to a function
schubart Mar 6, 2023
5619fd5
Remove DropAndReplace terminator
zeegomo Mar 5, 2023
41fa24c
Auto merge of #10415 - schubart:collection_is_never_read, r=llogiq
bors Mar 7, 2023
5369052
Include async functions in the len_without_is_empty
mladedav Feb 16, 2023
5331d05
Auto merge of #108312 - michaelwoerister:hash-set-not-hash-stable, r=…
bors Mar 8, 2023
ce3415e
Add the `popular-crates` binary
samueltardieu Mar 7, 2023
ea2547b
Add `missing_assert_message` lint
unexge Feb 16, 2023
8f3ac65
Dogfood `missing_assert_message` on Clippy
unexge Feb 16, 2023
099d610
Apply suggestions from code review
unexge Feb 18, 2023
4eb6ccc
Update lint description and add help section
unexge Feb 18, 2023
6fac73b
Move lint to `restriction` category
unexge Feb 18, 2023
b4b2b12
Revert "Dogfood `missing_assert_message` on Clippy"
unexge Feb 18, 2023
e7065ef
Revert `tests/ui/filter_map_next_fixable.rs`
unexge Feb 18, 2023
682d52c
Update assertion macro parsing logic for Rust 1.52 changes
unexge Feb 24, 2023
87f58a1
Use late lint pass for `missing_assert_message` lint
unexge Feb 24, 2023
b554ff4
Add `Known problems` section
unexge Mar 5, 2023
216aefb
Auto merge of #10362 - unexge:missing-assert-message-lint, r=llogiq
bors Mar 8, 2023
5eefbb3
Auto merge of #10466 - samueltardieu:popular-crates, r=llogiq
bors Mar 8, 2023
d5429ea
Add new `redundant_async_block` lint
samueltardieu Mar 4, 2023
56fbfe5
Auto merge of #10448 - samueltardieu:issue-10444, r=llogiq
bors Mar 8, 2023
aff9b72
move clippy tests back to their intended directory
pietroalbini Mar 8, 2023
d9fdac5
Rollup merge of #108856 - Zeegomo:remove-drop-and-rep, r=tmiasko
matthiaskrgr Mar 8, 2023
a701af4
lintcheck: use multithreading unless --fix or --recursive is used
samueltardieu Mar 5, 2023
eceedd9
Auto merge of #108920 - matthiaskrgr:rollup-qrr9a0u, r=matthiaskrgr
bors Mar 9, 2023
ea4ebed
Auto merge of #10309 - c410-f3r:arith, r=giraffate
bors Mar 9, 2023
ca3bf94
Add `let_with_type_underscore` lint
blyxyas Mar 8, 2023
5f98734
Auto merge of #10467 - blyxyas:underscore_typed, r=Jarcho
bors Mar 9, 2023
a45f712
Auto merge of #10458 - samueltardieu:multithreading-lintcheck, r=llogiq
bors Mar 9, 2023
9074da0
Auto merge of #10359 - mladedav:dm/private/is-empty, r=llogiq
bors Mar 9, 2023
7ce9ca0
Mark Rust 1.68.0 as release in the changelog
xFrednet Mar 9, 2023
a7fae6e
Auto merge of #10471 - xFrednet:00000-mark-version-as-released, r=fli…
bors Mar 10, 2023
baa997c
Merge remote-tracking branch 'upstream/master' into rustup
flip1995 Mar 10, 2023
ec9029d
Bump Clippy version -> 0.1.70
flip1995 Mar 10, 2023
f3074c4
Bump nightly version -> 2023-03-10
flip1995 Mar 10, 2023
991610a
Auto merge of #10473 - flip1995:rustup, r=flip1995
bors Mar 10, 2023
3c06e0b
Auto merge of #10275 - Alexendoo:format-args-ast, r=flip1995
bors Mar 10, 2023
01ffa51
Merge commit '3c06e0b1ce003912f8fe0536d3a7fe22558e38cf' into clippyup
flip1995 Mar 10, 2023
a87abc2
Update Cargo.lock (Clippy version)
flip1995 Mar 10, 2023
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 Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ dependencies = [

[[package]]
name = "clippy"
version = "0.1.69"
version = "0.1.70"
dependencies = [
"clap 4.1.4",
"clippy_lints",
Expand Down Expand Up @@ -781,7 +781,7 @@ dependencies = [

[[package]]
name = "clippy_lints"
version = "0.1.69"
version = "0.1.70"
dependencies = [
"cargo_metadata 0.15.3",
"clippy_utils",
Expand All @@ -804,7 +804,7 @@ dependencies = [

[[package]]
name = "clippy_utils"
version = "0.1.69"
version = "0.1.70"
dependencies = [
"arrayvec 0.7.0",
"if_chain",
Expand Down Expand Up @@ -1150,7 +1150,7 @@ checksum = "a0afaad2b26fa326569eb264b1363e8ae3357618c43982b3f285f0774ce76b69"

[[package]]
name = "declare_clippy_lint"
version = "0.1.69"
version = "0.1.70"
dependencies = [
"itertools",
"quote",
Expand Down
153 changes: 151 additions & 2 deletions src/tools/clippy/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,156 @@ document.

## Unreleased / Beta / In Rust Nightly

[d822110d...master](/~https://github.com/rust-lang/rust-clippy/compare/d822110d...master)
[7f27e2e7...master](/~https://github.com/rust-lang/rust-clippy/compare/7f27e2e7...master)

## Rust 1.68

Current stable, released 2023-03-09

[d822110d...7f27e2e7](/~https://github.com/rust-lang/rust-clippy/compare/d822110d...7f27e2e7)

### New Lints

* [`permissions_set_readonly_false`]
[#10063](/~https://github.com/rust-lang/rust-clippy/pull/10063)
* [`almost_complete_range`]
[#10043](/~https://github.com/rust-lang/rust-clippy/pull/10043)
* [`size_of_ref`]
[#10098](/~https://github.com/rust-lang/rust-clippy/pull/10098)
* [`semicolon_outside_block`]
[#9826](/~https://github.com/rust-lang/rust-clippy/pull/9826)
* [`semicolon_inside_block`]
[#9826](/~https://github.com/rust-lang/rust-clippy/pull/9826)
* [`transmute_null_to_fn`]
[#10099](/~https://github.com/rust-lang/rust-clippy/pull/10099)
* [`fn_null_check`]
[#10099](/~https://github.com/rust-lang/rust-clippy/pull/10099)

### Moves and Deprecations

* Moved [`manual_clamp`] to `nursery` (Now allow-by-default)
[#10101](/~https://github.com/rust-lang/rust-clippy/pull/10101)
* Moved [`mutex_atomic`] to `restriction`
[#10115](/~https://github.com/rust-lang/rust-clippy/pull/10115)
* Renamed `derive_hash_xor_eq` to [`derived_hash_with_manual_eq`]
[#10184](/~https://github.com/rust-lang/rust-clippy/pull/10184)

### Enhancements

* [`collapsible_str_replace`]: Now takes MSRV into consideration. The minimal version is 1.58
[#10047](/~https://github.com/rust-lang/rust-clippy/pull/10047)
* [`unused_self`]: No longer lints, if the method body contains a `todo!()` call
[#10166](/~https://github.com/rust-lang/rust-clippy/pull/10166)
* [`derivable_impls`]: Now suggests deriving `Default` for enums with default unit variants
[#10161](/~https://github.com/rust-lang/rust-clippy/pull/10161)
* [`arithmetic_side_effects`]: Added two new config values
`arithmetic-side-effects-allowed-binary` and `arithmetic-side-effects-allowed-unary`
to allow operation on user types
[#9840](/~https://github.com/rust-lang/rust-clippy/pull/9840)
* [`large_const_arrays`], [`large_stack_arrays`]: avoid integer overflow when calculating
total array size
[#10103](/~https://github.com/rust-lang/rust-clippy/pull/10103)
* [`indexing_slicing`]: add new config `suppress-restriction-lint-in-const` to enable
restriction lints, even if the suggestion might not be applicable
[#9920](/~https://github.com/rust-lang/rust-clippy/pull/9920)
* [`needless_borrow`], [`redundant_clone`]: Now track references better and detect more cases
[#9701](/~https://github.com/rust-lang/rust-clippy/pull/9701)
* [`derived_hash_with_manual_eq`]: Now allows `#[derive(PartialEq)]` with custom `Hash`
implementations
[#10184](/~https://github.com/rust-lang/rust-clippy/pull/10184)
* [`manual_is_ascii_check`]: Now detects ranges with `.contains()` calls
[#10053](/~https://github.com/rust-lang/rust-clippy/pull/10053)
* [`transmuting_null`]: Now detects `const` pointers to all types
[#10099](/~https://github.com/rust-lang/rust-clippy/pull/10099)
* [`needless_return`]: Now detects more cases for returns of owned values
[#10110](/~https://github.com/rust-lang/rust-clippy/pull/10110)

### False Positive Fixes

* [`field_reassign_with_default`]: No longer lints cases, where values are initializes from
closures capturing struct values
[#10143](/~https://github.com/rust-lang/rust-clippy/pull/10143)
* [`seek_to_start_instead_of_rewind`]: No longer lints, if the return of `seek` is used.
[#10096](/~https://github.com/rust-lang/rust-clippy/pull/10096)
* [`manual_filter`]: Now ignores if expressions where the else branch has side effects or
doesn't return `None`
[#10091](/~https://github.com/rust-lang/rust-clippy/pull/10091)
* [`implicit_clone`]: No longer lints if the type doesn't implement clone
[#10022](/~https://github.com/rust-lang/rust-clippy/pull/10022)
* [`match_wildcard_for_single_variants`]: No longer lints on wildcards with a guard
[#10056](/~https://github.com/rust-lang/rust-clippy/pull/10056)
* [`drop_ref`]: No longer lints idiomatic expression in `match` arms
[#10142](/~https://github.com/rust-lang/rust-clippy/pull/10142)
* [`arithmetic_side_effects`]: No longer lints on corner cases with negative number literals
[#9867](/~https://github.com/rust-lang/rust-clippy/pull/9867)
* [`string_lit_as_bytes`]: No longer lints in scrutinies of `match` statements
[#10012](/~https://github.com/rust-lang/rust-clippy/pull/10012)
* [`manual_assert`]: No longer lints in `else if` statements
[#10013](/~https://github.com/rust-lang/rust-clippy/pull/10013)
* [`needless_return`]: don't lint when using `do yeet`
[#10109](/~https://github.com/rust-lang/rust-clippy/pull/10109)
* All lints: No longer lint in enum discriminant values when the suggestion won't work in a
const context
[#10008](/~https://github.com/rust-lang/rust-clippy/pull/10008)
* [`single_element_loop`]: No longer lints, if the loop contains a `break` or `continue`
[#10162](/~https://github.com/rust-lang/rust-clippy/pull/10162)
* [`uninlined_format_args`]: No longer suggests inlining arguments in `assert!` and
`debug_assert!` macros before 2021 edition
[#10055](/~https://github.com/rust-lang/rust-clippy/pull/10055)
* [`explicit_counter_loop`]: No longer ignores counter changes after `continue` expressions
[#10094](/~https://github.com/rust-lang/rust-clippy/pull/10094)
* [`from_over_into`]: No longer lints on opaque types
[#9982](/~https://github.com/rust-lang/rust-clippy/pull/9982)
* [`expl_impl_clone_on_copy`]: No longer lints on `#[repr(packed)]` structs with generic
parameters
[#10189](/~https://github.com/rust-lang/rust-clippy/pull/10189)

### Suggestion Fixes/Improvements

* [`zero_ptr`]: Now suggests `core::` paths for `no_std` crates
[#10023](/~https://github.com/rust-lang/rust-clippy/pull/10023)
* [`useless_conversion`]: Now suggests removing calls to `into_iter()` on an expression
implementing `Iterator`
[#10020](/~https://github.com/rust-lang/rust-clippy/pull/10020)
* [`box_default`]: The suggestion now uses short paths
[#10153](/~https://github.com/rust-lang/rust-clippy/pull/10153)
* [`default_trait_access`], [`clone_on_copy`]: The suggestion now uses short paths
[#10160](/~https://github.com/rust-lang/rust-clippy/pull/10160)
* [`comparison_to_empty`]: The suggestion now removes unused deref operations
[#9962](/~https://github.com/rust-lang/rust-clippy/pull/9962)
* [`manual_let_else`]: Suggestions for or-patterns now include required brackets.
[#9966](/~https://github.com/rust-lang/rust-clippy/pull/9966)
* [`match_single_binding`]: suggestion no longer introduces unneeded semicolons
[#10060](/~https://github.com/rust-lang/rust-clippy/pull/10060)
* [`case_sensitive_file_extension_comparisons`]: Now displays a suggestion with `Path`
[#10107](/~https://github.com/rust-lang/rust-clippy/pull/10107)
* [`empty_structs_with_brackets`]: The suggestion is no longer machine applicable, to avoid
errors when accessing struct fields
[#10141](/~https://github.com/rust-lang/rust-clippy/pull/10141)
* [`identity_op`]: Removes borrows in the suggestion when needed
[#10004](/~https://github.com/rust-lang/rust-clippy/pull/10004)
* [`suboptimal_flops`]: The suggestion now includes parentheses when required
[#10113](/~https://github.com/rust-lang/rust-clippy/pull/10113)
* [`iter_kv_map`]: Now handles `mut` and reference annotations in the suggestion
[#10159](/~https://github.com/rust-lang/rust-clippy/pull/10159)
* [`redundant_static_lifetimes`]: The suggestion no longer removes `mut` from references
[#10006](/~https://github.com/rust-lang/rust-clippy/pull/10006)

### ICE Fixes

* [`new_ret_no_self`]: Now avoids a stack overflow for `impl Trait` types
[#10086](/~https://github.com/rust-lang/rust-clippy/pull/10086)
* [`unnecessary_to_owned`]: Now handles compiler generated notes better
[#10027](/~https://github.com/rust-lang/rust-clippy/pull/10027)

### Others

* `SYSROOT` and `--sysroot` can now be set at the same time
[#10149](/~https://github.com/rust-lang/rust-clippy/pull/10149)

## Rust 1.67

Current stable, released 2023-01-26
Released 2023-01-26

[4f142aa1...d822110d](/~https://github.com/rust-lang/rust-clippy/compare/4f142aa1...d822110d)

Expand Down Expand Up @@ -4307,6 +4452,7 @@ Released 2018-09-13
[`collapsible_if`]: https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if
[`collapsible_match`]: https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match
[`collapsible_str_replace`]: https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_str_replace
[`collection_is_never_read`]: https://rust-lang.github.io/rust-clippy/master/index.html#collection_is_never_read
[`comparison_chain`]: https://rust-lang.github.io/rust-clippy/master/index.html#comparison_chain
[`comparison_to_empty`]: https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty
[`const_static_lifetime`]: https://rust-lang.github.io/rust-clippy/master/index.html#const_static_lifetime
Expand Down Expand Up @@ -4497,6 +4643,7 @@ Released 2018-09-13
[`let_underscore_must_use`]: https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_must_use
[`let_underscore_untyped`]: https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_untyped
[`let_unit_value`]: https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value
[`let_with_type_underscore`]: https://rust-lang.github.io/rust-clippy/master/index.html#let_with_type_underscore
[`linkedlist`]: https://rust-lang.github.io/rust-clippy/master/index.html#linkedlist
[`logic_bug`]: https://rust-lang.github.io/rust-clippy/master/index.html#logic_bug
[`lossy_float_literal`]: https://rust-lang.github.io/rust-clippy/master/index.html#lossy_float_literal
Expand Down Expand Up @@ -4560,6 +4707,7 @@ Released 2018-09-13
[`mismatching_type_param_order`]: https://rust-lang.github.io/rust-clippy/master/index.html#mismatching_type_param_order
[`misnamed_getters`]: https://rust-lang.github.io/rust-clippy/master/index.html#misnamed_getters
[`misrefactored_assign_op`]: https://rust-lang.github.io/rust-clippy/master/index.html#misrefactored_assign_op
[`missing_assert_message`]: https://rust-lang.github.io/rust-clippy/master/index.html#missing_assert_message
[`missing_const_for_fn`]: https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
[`missing_docs_in_private_items`]: https://rust-lang.github.io/rust-clippy/master/index.html#missing_docs_in_private_items
[`missing_enforced_import_renames`]: https://rust-lang.github.io/rust-clippy/master/index.html#missing_enforced_import_renames
Expand Down Expand Up @@ -4689,6 +4837,7 @@ Released 2018-09-13
[`read_zero_byte_vec`]: https://rust-lang.github.io/rust-clippy/master/index.html#read_zero_byte_vec
[`recursive_format_impl`]: https://rust-lang.github.io/rust-clippy/master/index.html#recursive_format_impl
[`redundant_allocation`]: https://rust-lang.github.io/rust-clippy/master/index.html#redundant_allocation
[`redundant_async_block`]: https://rust-lang.github.io/rust-clippy/master/index.html#redundant_async_block
[`redundant_clone`]: https://rust-lang.github.io/rust-clippy/master/index.html#redundant_clone
[`redundant_closure`]: https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
[`redundant_closure_call`]: https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_call
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "clippy"
version = "0.1.69"
version = "0.1.70"
description = "A bunch of helpful lints to avoid common pitfalls in Rust"
repository = "/~https://github.com/rust-lang/rust-clippy"
readme = "README.md"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ The second part of the motivation is clippy's dependence on unstable
compiler-internal data structures. Clippy lints are currently written against
the compiler's AST / HIR which means that even small changes in these data
structures might break a lot of lints. The second goal of this RFC is to **make
lints independant of the compiler's AST / HIR data structures**.
lints independent of the compiler's AST / HIR data structures**.

# Approach

A lot of complexity in writing lints currently seems to come from having to
manually implement the matching logic (see code samples above). It's an
imparative style that describes *how* to match a syntax tree node instead of
imperative style that describes *how* to match a syntax tree node instead of
specifying *what* should be matched against declaratively. In other areas, it's
common to use declarative patterns to describe desired information and let the
implementation do the actual matching. A well-known example of this approach are
Expand Down Expand Up @@ -270,7 +270,7 @@ pattern!{
// matches if expressions that **may or may not** have an else block
// Attn: `If(_, _, _)` matches only ifs that **have** an else block
//
// | if with else block | if witout else block
// | if with else block | if without else block
// If(_, _, _) | match | no match
// If(_, _, _?) | match | match
// If(_, _, ()) | no match | match
Expand Down Expand Up @@ -568,7 +568,7 @@ another example, `Array( Lit(_)* )` is a valid pattern because the parameter of

## The IsMatch Trait

The pattern syntax and the *PatternTree* are independant of specific syntax tree
The pattern syntax and the *PatternTree* are independent of specific syntax tree
implementations (rust ast / hir, syn, ...). When looking at the different
pattern examples in the previous sections, it can be seen that the patterns
don't contain any information specific to a certain syntax tree implementation.
Expand Down Expand Up @@ -717,7 +717,7 @@ if false {
#### Problems

Extending Rust syntax (which is quite complex by itself) with additional syntax
needed for specifying patterns (alternations, sequences, repetisions, named
needed for specifying patterns (alternations, sequences, repetitions, named
submatches, ...) might become difficult to read and really hard to parse
properly.

Expand Down Expand Up @@ -858,7 +858,7 @@ would be evaluated as soon as the `Block(_)#then` was matched.
Another idea in this area would be to introduce a syntax for backreferences.
They could be used to require that multiple parts of a pattern should match the
same value. For example, the `assign_op_pattern` lint that searches for `a = a
op b` and recommends changing it to `a op= b` requires that both occurrances of
op b` and recommends changing it to `a op= b` requires that both occurrences of
`a` are the same. Using `=#...` as syntax for backreferences, the lint could be
implemented like this:

Expand All @@ -882,7 +882,7 @@ least two return statements" could be a practical addition.
For patterns like "a literal that is not a boolean literal" one currently needs
to list all alternatives except the boolean case. Introducing a negation
operator that allows to write `Lit(!Bool(_))` might be a good idea. This pattern
would be eqivalent to `Lit( Char(_) | Int(_) )` (given that currently only three
would be equivalent to `Lit( Char(_) | Int(_) )` (given that currently only three
literal types are implemented).

#### Functional composition
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/clippy_lints/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "clippy_lints"
version = "0.1.69"
version = "0.1.70"
description = "A bunch of helpful lints to avoid common pitfalls in Rust"
repository = "/~https://github.com/rust-lang/rust-clippy"
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/clippy_lints/src/almost_complete_range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ declare_clippy_lint! {
/// ```rust
/// let _ = 'a'..='z';
/// ```
#[clippy::version = "1.63.0"]
#[clippy::version = "1.68.0"]
pub ALMOST_COMPLETE_RANGE,
suspicious,
"almost complete range"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use clippy_utils::diagnostics::span_lint_and_sugg;
use clippy_utils::msrvs::{self, Msrv};
use clippy_utils::source::snippet_with_applicability;
use clippy_utils::source::snippet_with_context;
use clippy_utils::{match_def_path, paths};
use if_chain::if_chain;
use rustc_errors::Applicability;
Expand Down Expand Up @@ -34,15 +34,17 @@ pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>, cast_expr: &Expr<'_>,
if let ExprKind::Path(ref qpath) = fun.kind;
if let Some(fun_def_id) = cx.qpath_res(qpath, fun.hir_id).opt_def_id();
if let Some(rpk) = raw_parts_kind(cx, fun_def_id);
let ctxt = expr.span.ctxt();
if cast_expr.span.ctxt() == ctxt;
then {
let func = match rpk {
RawPartsKind::Immutable => "from_raw_parts",
RawPartsKind::Mutable => "from_raw_parts_mut"
};
let span = expr.span;
let mut applicability = Applicability::MachineApplicable;
let ptr = snippet_with_applicability(cx, ptr_arg.span, "ptr", &mut applicability);
let len = snippet_with_applicability(cx, len_arg.span, "len", &mut applicability);
let ptr = snippet_with_context(cx, ptr_arg.span, ctxt, "ptr", &mut applicability).0;
let len = snippet_with_context(cx, len_arg.span, ctxt, "len", &mut applicability).0;
span_lint_and_sugg(
cx,
CAST_SLICE_FROM_RAW_PARTS,
Expand Down
Loading