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

Rollup of 9 pull requests #92883

Merged
merged 118 commits into from
Jan 14, 2022
Merged
Changes from 1 commit
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
1788cfd
Remove NullOp::Box
nbdd0121 Sep 26, 2021
d5cbae9
fix clippy
lcnr Dec 23, 2021
dfd3254
Update pulldown-cmark version in clippy
GuillaumeGomez Dec 28, 2021
eddf806
Suggest `return`ing tail expressions in async fn's
ThePuzzlemaker Dec 29, 2021
ab7c446
Add regression test for #92308
ThePuzzlemaker Dec 29, 2021
828ddbe
fix [`redundant_closure`] fp with `Arc`
ebobrow Dec 29, 2021
97ab44c
Merge commit '0eff589afc83e21a03a168497bbab6b4dfbb4ef6' into clippyup
flip1995 Dec 30, 2021
2b5257e
Remove method_call! macro
camsteffen Dec 30, 2021
1f3d6a6
Auto merge of #92252 - GuillaumeGomez:update-pulldown, r=camelid,xFre…
bors Dec 31, 2021
65d1f83
Extend [`unused_io_amount`] to cover AsyncRead and AsyncWrite.
nmathewson Dec 27, 2021
b6bcf0c
unused_io_amount: Use span_lint_and_help.
nmathewson Dec 31, 2021
490566b
Auto merge of #8179 - nmathewson:unused_async_io_amount, r=xFrednet
bors Dec 31, 2021
c736a63
Auto merge of #8193 - ebobrow:redundant_closure_fp, r=Manishearth
bors Dec 31, 2021
3d41358
wrong_self_convention: Match `SelfKind::No` more restrictively
nmathewson Jan 1, 2022
f5bbd1b
Make tidy check for magic numbers that spell things
joshtriplett Jan 1, 2022
262b148
return_self_not_must_use document `#[must_use]` on the type
bors Jan 1, 2022
7616eb0
Auto merge of #8209 - xFrednet:8197-mention-attribute-on-struct, r=ll…
bors Jan 1, 2022
b25dbc6
Auto merge of #8208 - nmathewson:selfkind_no_fix, r=xFrednet
bors Jan 2, 2022
e8b6b2a
erasing_op lint ignored when output type is different from the non-co…
Dec 31, 2021
8419108
Auto merge of #8204 - wigy-opensource-developer:fix-7210, r=xFrednet
bors Jan 2, 2022
6975071
Rollup merge of #90102 - nbdd0121:box3, r=jonas-schievink
matthiaskrgr Jan 3, 2022
19cfcd5
Fix clippy warnings
pmnoxx Jan 3, 2022
3ea7784
Auto merge of #8216 - pmnoxx:piotr-fix-clippy-warnings, r=xFrednet
bors Jan 3, 2022
ff58efb
Better detect when a field can be moved from in `while_let_on_iterator`
Jarcho Jan 4, 2022
00da1b8
Remove in_macro from utils
camsteffen Jan 4, 2022
a7097b8
Consider auto-deref when linting `manual_swap`
Jarcho Jan 4, 2022
0e28e38
Auto merge of #8220 - Jarcho:manual_swap_8154, r=camsteffen
bors Jan 4, 2022
2dd216a
Check for full equality in `type_repetition_in_bounds` rather than ju…
Jarcho Jan 4, 2022
d7a6033
Rollup merge of #91907 - lcnr:const-arg-infer, r=BoxyUwU
matthiaskrgr Jan 4, 2022
786f874
New macro utils
bors Jan 4, 2022
ba03dc7
Auto merge of #8219 - camsteffen:macro-decoupling, r=llogiq
bors Jan 4, 2022
d5dcda2
Auto merge of #8223 - camsteffen:remove-in-macro, r=llogiq
bors Jan 5, 2022
20f2a89
Auto merge of #8224 - Jarcho:type_repetition_in_bounds_8162, r=llogiq
bors Jan 5, 2022
92048f4
Auto merge of #8221 - Jarcho:while_let_on_iterator_8113, r=llogiq
bors Jan 5, 2022
a4ebf6f
Change `unnecessary_to_owned` `into_iter` suggestions to `MaybeIncorr…
smoelius Dec 30, 2021
14f3445
Don't lint `DequeVec` in `manual_memcpy`
Jarcho Jan 5, 2022
3925def
Suggest `copy_from_slice` for `manual_memcpy` when possible
Jarcho Jan 5, 2022
2cc38a2
Lint `iter_not_returning_iterator` on the trait definition rather tha…
Jarcho Jan 5, 2022
d98339d
Handle type projections in `iter_not_returning_iterator`
Jarcho Jan 5, 2022
94fe671
Allow running lintcheck with a renamed rust-clippy dir
Alexendoo Jan 6, 2022
be7cf76
Auto merge of #8234 - Alexendoo:lintcheck-allow-renamed-dir, r=xFrednet
bors Jan 7, 2022
c34e3f0
Update clippy for associated item changes
matthewjasper Nov 18, 2021
366234a
Add `unnecessary_to_owned` "Known problems" section
smoelius Jan 8, 2022
917890b
Auto merge of #8201 - smoelius:master, r=camsteffen
bors Jan 8, 2022
3ea5208
Set binary-dep-depinfo in .cargo/config.toml
sourcefrog Jan 8, 2022
83a9f68
Auto merge of #8249 - sourcefrog:depinfo, r=Manishearth
bors Jan 9, 2022
1288b80
rustc_metadata: Optimize and document module children decoding
petrochenkov Dec 18, 2021
c8ea042
rustc_metadata: Rename `item_children(_untracked)` to `module_childre…
petrochenkov Dec 23, 2021
f690978
cover trait for `trait_duplication_in_bounds`
dswij Jan 6, 2022
a6f80fc
new lint: `single_char_lifetime_names`
bors Jan 9, 2022
5991695
Auto merge of #8236 - PatchMixolydic:single_char_lifetime_names, r=ll…
bors Jan 9, 2022
16d8488
Combine internal features in clippy_utils
camsteffen Jan 10, 2022
e2ce4f9
Combine internal features in clippy_lints
camsteffen Jan 10, 2022
f4dc348
`trait_duplication_in_bounds` Update description and add test
dswij Jan 10, 2022
88cfd70
Auto merge of #8252 - dswij:8229, r=xFrednet
bors Jan 10, 2022
1816361
Auto merge of #8257 - camsteffen:internal-features, r=giraffate
bors Jan 10, 2022
b66dbe8
Auto merge of #8228 - Jarcho:iter_not_returning_iterator_8225, r=gira…
bors Jan 10, 2022
cf86cee
Downgrade mutex_atomic to nursery
taiki-e Jan 10, 2022
5f143c6
Warn disallowed_methods and disallowed_types by default
taiki-e Jan 10, 2022
e66ecf6
Run dogfood on windows
camsteffen Jan 10, 2022
7cf4f44
Fix output capturing
camsteffen Jan 10, 2022
51dbbf3
Refactor test utils
camsteffen Jan 10, 2022
d356fb9
Use `rustup which rustfmt`
camsteffen Jan 10, 2022
920e9f0
Move workspace test
camsteffen Jan 10, 2022
4a54933
Merge dogfood tests
camsteffen Jan 10, 2022
21343ab
Remove rustfmt component check
camsteffen Jan 10, 2022
51282fc
Auto merge of #8261 - taiki-e:disallowed, r=giraffate
bors Jan 10, 2022
01ef7c7
Fix dogfood
camsteffen Jan 10, 2022
fccf07b
Auto merge of #8260 - taiki-e:mutex_atomic, r=llogiq
bors Jan 11, 2022
3298de7
Add borrow_as_ptr lint
guerinoni Jan 2, 2022
fd97d79
`README`: `clippy-driver` is not a replacement for `rustc`
ojeda Nov 27, 2021
3d4fded
`README`: mention `clippy-driver` on usage list
ojeda Dec 14, 2021
dda2aef
Store a `Symbol` instead of an `Ident` in `VariantDef`/`FieldDef`
Aaron1011 Jan 3, 2022
fd9cebe
Auto merge of #8210 - guerinoni:master, r=Manishearth
bors Jan 11, 2022
02ec39b
Stop using in_band_lifetimes
camsteffen Jan 11, 2022
8680a44
Partially stabilize `maybe_uninit_extra`
ojeda Jan 11, 2022
7e989ec
Improve documentation for `borrowed-box` lint
1nF0rmed Jan 10, 2022
88f5be2
Auto merge of #8262 - 1nF0rmed:chore-update-borrowed-box-doc, r=camst…
bors Jan 11, 2022
40f33a7
Deduplicate box deref and regular deref suggestions
compiler-errors Jan 12, 2022
d32277d
Don't lint `deref_addrof` when the two operations occur in different …
Jarcho Jan 12, 2022
37e9985
Auto merge of #8268 - Jarcho:deref_addrof_8247, r=flip1995
bors Jan 12, 2022
0d94167
Auto merge of #8198 - camsteffen:no-method-call-macro, r=flip1995
bors Jan 12, 2022
956db07
Don't fall back to crate-level opaque type definitions.
oli-obk Dec 8, 2021
ae01c4a
Auto merge of #8190 - camsteffen:no-in-band-liftetimes, r=flip1995
bors Jan 12, 2022
b9cae79
Auto merge of #8037 - ojeda:doc-codegen-change, r=camsteffen
bors Jan 12, 2022
166737f
Add manual_bits lint
paolobarbolini Jan 2, 2022
91581f6
Resolve primitive impls in clippy_utils::path_to_res
Alexendoo Dec 9, 2021
7c82ae1
Auto merge of #8213 - paolobarbolini:size-of-as-bits, r=flip1995
bors Jan 12, 2022
04eb27a
Use method name from conf::DisallowedMethod
Alexendoo Dec 9, 2021
6f33f69
Auto merge of #8112 - Alexendoo:disallowed_methods_primitives, r=flip…
bors Jan 12, 2022
90bf72c
Only run dogfood on linux in CI
camsteffen Jan 12, 2022
133b366
Auto merge of #8265 - camsteffen:which-rustfmt, r=xFrednet
bors Jan 12, 2022
5479024
Auto merge of #8266 - camsteffen:test-tweaks, r=flip1995
bors Jan 12, 2022
062db10
Add `manual_memcpy_test` for `VecDeque`
Jarcho Jan 12, 2022
60e68d6
Auto merge of #8226 - Jarcho:manual_memcpy_8160, r=flip1995
bors Jan 12, 2022
8568f44
suggest deref/unboxing before wrapping variant
compiler-errors Jan 12, 2022
7b74ded
Fix lints documents
hafeoz Jan 13, 2022
11be495
Merge remote-tracking branch 'upstream/master' into rustup
flip1995 Jan 13, 2022
8a2141b
Bump Clippy Version -> 0.1.60
flip1995 Jan 13, 2022
6ad05bc
Bump nightly version -> 2022-01-13
flip1995 Jan 13, 2022
97a5daa
Auto merge of #8272 - flip1995:rustup, r=flip1995
bors Jan 13, 2022
ba66384
Merge commit '97a5daa65908e59744e2bc625b14849352231c75' into clippyup
flip1995 Jan 13, 2022
159d6c3
Update Cargo.lock
flip1995 Jan 13, 2022
b83c77c
Fix Clippy sync fallout
flip1995 Jan 13, 2022
bc6b199
Use the updated Rust logo and change it's format to SVG
Urgau Jan 13, 2022
b8ef148
Regenerate the PNGs favicon with the updated Rust logo
Urgau Jan 13, 2022
7cc6a73
Remove `asm` feature from lints example
hafeoz Jan 13, 2022
d5871d0
Fix and improve missing dot in the item heading
Jan 13, 2022
241d977
Update documentation for doc_cfg
GuillaumeGomez Jan 12, 2022
f13e871
Rollup merge of #92045 - oli-obk:cleanup, r=petrochenkov
matthiaskrgr Jan 14, 2022
347c744
Rollup merge of #92381 - ThePuzzlemaker:issue-92308, r=estebank
matthiaskrgr Jan 14, 2022
558da93
Rollup merge of #92768 - ojeda:stabilize-maybe_uninit_extra, r=Mark-S…
matthiaskrgr Jan 14, 2022
9d5cb20
Rollup merge of #92810 - compiler-errors:deduplicate-box-deref-sugges…
matthiaskrgr Jan 14, 2022
3cbc448
Rollup merge of #92818 - GuillaumeGomez:update-doc-cfg-doc, r=camelid
matthiaskrgr Jan 14, 2022
1794b24
Rollup merge of #92840 - hafeoz:master, r=ehuss
matthiaskrgr Jan 14, 2022
ccfee3d
Rollup merge of #92849 - flip1995:clippyup, r=Manishearth
matthiaskrgr Jan 14, 2022
dae3ef2
Rollup merge of #92854 - Urgau:better-rust-logo, r=GuillaumeGomez
matthiaskrgr Jan 14, 2022
2ae4afd
Rollup merge of #92864 - Urgau:fix-missing-source-dot, r=jsha
matthiaskrgr Jan 14, 2022
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
Prev Previous commit
Next Next commit
Merge commit '0eff589afc83e21a03a168497bbab6b4dfbb4ef6' into clippyup
flip1995 committed Dec 30, 2021
commit 97ab44ca974544fdf5ef598b04d3794af513e4bf
4 changes: 4 additions & 0 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
@@ -58,6 +58,10 @@ jobs:
run: cargo test --features deny-warnings,internal-lints,metadata-collector-lint
working-directory: clippy_lints

- name: Test clippy_utils
run: cargo test --features deny-warnings,internal-lints,metadata-collector-lint
working-directory: clippy_utils

- name: Test rustc_tools_util
run: cargo test --features deny-warnings
working-directory: rustc_tools_util
4 changes: 4 additions & 0 deletions .github/workflows/clippy_bors.yml
Original file line number Diff line number Diff line change
@@ -121,6 +121,10 @@ jobs:
run: cargo test --features deny-warnings,internal-lints,metadata-collector-lint
working-directory: clippy_lints

- name: Test clippy_utils
run: cargo test --features deny-warnings,internal-lints,metadata-collector-lint
working-directory: clippy_utils

- name: Test rustc_tools_util
run: cargo test --features deny-warnings
working-directory: rustc_tools_util
123 changes: 119 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -6,13 +6,127 @@ document.

## Unreleased / In Rust Nightly

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

## Rust 1.58 (beta)

Current beta, release 2022-01-13

[00e31fa...e181011](https://github.com/rust-lang/rust-clippy/compare/00e31fa...e181011)

### New lints

* [`transmute_num_to_bytes`]
[#7805](https://github.com/rust-lang/rust-clippy/pull/7805)
* [`match_str_case_mismatch`]
[#7806](https://github.com/rust-lang/rust-clippy/pull/7806)
* [`format_in_format_args`], [`to_string_in_format_args`]
[#7743](https://github.com/rust-lang/rust-clippy/pull/7743)
* [`uninit_vec`]
[#7682](https://github.com/rust-lang/rust-clippy/pull/7682)
* [`fn_to_numeric_cast_any`]
[#7705](https://github.com/rust-lang/rust-clippy/pull/7705)
* [`undocumented_unsafe_blocks`]
[#7748](https://github.com/rust-lang/rust-clippy/pull/7748)
* [`trailing_empty_array`]
[#7838](https://github.com/rust-lang/rust-clippy/pull/7838)
* [`string_slice`]
[#7878](https://github.com/rust-lang/rust-clippy/pull/7878)

### Moves or deprecations of lints

* Move [`non_send_fields_in_send_ty`] to `suspicious`
[#7874](https://github.com/rust-lang/rust-clippy/pull/7874)
* Move [`non_ascii_literal`] to `restriction`
[#7907](https://github.com/rust-lang/rust-clippy/pull/7907)

### Changes that expand what code existing lints cover

* [`question_mark`] now covers `Result`
[#7840](https://github.com/rust-lang/rust-clippy/pull/7840)
* Make [`useless_format`] recognize bare `format!("")`
[#7801](https://github.com/rust-lang/rust-clippy/pull/7801)
* Lint on underscored variables with no side effects in [`no_effect`]
[#7775](https://github.com/rust-lang/rust-clippy/pull/7775)
* Expand [`match_ref_pats`] to check for multiple reference patterns
[#7800](https://github.com/rust-lang/rust-clippy/pull/7800)

### False positive fixes

* Fix false positive of [`implicit_saturating_sub`] with `else` clause
[#7832](https://github.com/rust-lang/rust-clippy/pull/7832)
* Fix [`question_mark`] when there is call in conditional predicate
[#7860](https://github.com/rust-lang/rust-clippy/pull/7860)
* [`mut_mut`] no longer lints when type is defined in external macros
[#7795](https://github.com/rust-lang/rust-clippy/pull/7795)
* Avoid [`eq_op`] in test functions
[#7811](https://github.com/rust-lang/rust-clippy/pull/7811)
* [`cast_possible_truncation`] no longer lints when cast is coming from `signum`
method call [#7850](https://github.com/rust-lang/rust-clippy/pull/7850)
* [`match_str_case_mismatch`] no longer lints on uncased characters
[#7865](https://github.com/rust-lang/rust-clippy/pull/7865)
* [`ptr_arg`] no longer lints references to type aliases
[#7890](https://github.com/rust-lang/rust-clippy/pull/7890)
* [`missing_safety_doc`] now also accepts "implementation safety" headers
[#7856](https://github.com/rust-lang/rust-clippy/pull/7856)
* [`missing_safety_doc`] no longer lints if any parent has `#[doc(hidden)]`
attribute [#7849](https://github.com/rust-lang/rust-clippy/pull/7849)
* [`if_not_else`] now ignores else-if statements
[#7895](https://github.com/rust-lang/rust-clippy/pull/7895)
* Avoid linting [`cast_possible_truncation`] on bit-reducing operations
[#7819](https://github.com/rust-lang/rust-clippy/pull/7819)
* Avoid linting [`field_reassign_with_default`] when `Drop` and `Copy` are
involved [#7794](https://github.com/rust-lang/rust-clippy/pull/7794)
* [`unnecessary_sort_by`] now checks if argument implements `Ord` trait
[#7824](https://github.com/rust-lang/rust-clippy/pull/7824)
* Fix false positive in [`match_overlapping_arm`]
[#7847](https://github.com/rust-lang/rust-clippy/pull/7847)
* Prevent [`needless_lifetimes`] false positive in `async` function definition
[#7901](https://github.com/rust-lang/rust-clippy/pull/7901)

### Suggestion fixes/improvements

* Keep an initial `::` when [`doc_markdown`] suggests to use ticks
[#7916](https://github.com/rust-lang/rust-clippy/pull/7916)
* Add a machine applicable suggestion for the [`doc_markdown`] missing backticks
lint [#7904](https://github.com/rust-lang/rust-clippy/pull/7904)
* [`equatable_if_let`] no longer expands macros in the suggestion
[#7788](https://github.com/rust-lang/rust-clippy/pull/7788)
* Make [`shadow_reuse`] suggestion less verbose
[#7782](https://github.com/rust-lang/rust-clippy/pull/7782)

### ICE fixes

* Fix ICE in [`enum_variant_names`]
[#7873](https://github.com/rust-lang/rust-clippy/pull/7873)
* Fix ICE in [`undocumented_unsafe_blocks`]
[#7891](https://github.com/rust-lang/rust-clippy/pull/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](https://github.com/rust-lang/rust-clippy/pull/7827)
* Fix typo in example for [`match_result_ok`]
[#7815](https://github.com/rust-lang/rust-clippy/pull/7815)

### Others

* Allow giving reasons for [`disallowed_types`]
[#7791](https://github.com/rust-lang/rust-clippy/pull/7791)
* Fix [`manual_assert`] and [`match_wild_err_arm`] for `#![no_std]` and Rust
2021. [#7851](https://github.com/rust-lang/rust-clippy/pull/7851)
* Fix regression in [`semicolon_if_nothing_returned`] on macros containing while
loops [#7789](https://github.com/rust-lang/rust-clippy/pull/7789)
* Added a new configuration `literal-suffix-style` to enforce a certain style
writing [`unseparated_literal_suffix`]
[#7726](https://github.com/rust-lang/rust-clippy/pull/7726)

## Rust 1.57

Current beta, release 2021-12-02
Current stable, released 2021-12-02

[7bfc26e...b7f3f7f](https://github.com/rust-lang/rust-clippy/compare/7bfc26e...b7f3f7f)
[7bfc26e...00e31fa](https://github.com/rust-lang/rust-clippy/compare/7bfc26e...00e31fa)

### New Lints

@@ -161,7 +275,7 @@ Current beta, release 2021-12-02

## Rust 1.56

Current stable, released 2021-10-21
Released 2021-10-21

[74d1561...7bfc26e](https://github.com/rust-lang/rust-clippy/compare/74d1561...7bfc26e)

@@ -2912,6 +3026,7 @@ Released 2018-09-13
[`infinite_iter`]: https://rust-lang.github.io/rust-clippy/master/index.html#infinite_iter
[`inherent_to_string`]: https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string
[`inherent_to_string_shadow_display`]: https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string_shadow_display
[`init_numbered_fields`]: https://rust-lang.github.io/rust-clippy/master/index.html#init_numbered_fields
[`inline_always`]: https://rust-lang.github.io/rust-clippy/master/index.html#inline_always
[`inline_asm_x86_att_syntax`]: https://rust-lang.github.io/rust-clippy/master/index.html#inline_asm_x86_att_syntax
[`inline_asm_x86_intel_syntax`]: https://rust-lang.github.io/rust-clippy/master/index.html#inline_asm_x86_intel_syntax
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -118,16 +118,16 @@ which `IntelliJ Rust` will be able to understand.
Run `cargo dev setup intellij --repo-path <repo-path>` where `<repo-path>` is a path to the rustc repo
you just cloned.
The command will add path-dependencies pointing towards rustc-crates inside the rustc repo to
Clippys `Cargo.toml`s and should allow `IntelliJ Rust` to understand most of the types that Clippy uses.
Clippy's `Cargo.toml`s and should allow `IntelliJ Rust` to understand most of the types that Clippy uses.
Just make sure to remove the dependencies again before finally making a pull request!

[rustc_repo]: https://github.com/rust-lang/rust/
[IntelliJ_rust_homepage]: https://intellij-rust.github.io/

### Rust Analyzer
As of [#6869][6869], [`rust-analyzer`][ra_homepage] can understand that Clippy uses compiler-internals
using `extern crate` when `package.metadata.rust-analyzer.rustc_private` is set to `true` in Clippys `Cargo.toml.`
You will required a `nightly` toolchain with the `rustc-dev` component installed.
using `extern crate` when `package.metadata.rust-analyzer.rustc_private` is set to `true` in Clippy's `Cargo.toml.`
You will require a `nightly` toolchain with the `rustc-dev` component installed.
Make sure that in the `rust-analyzer` configuration, you set
```
{ "rust-analyzer.rustcSource": "discover" }
@@ -228,7 +228,7 @@ about `subtree`s in the Rust repository see [Rust's `CONTRIBUTING.md`][subtree].

### Patching git-subtree to work with big repos

Currently there's a bug in `git-subtree` that prevents it from working properly
Currently, there's a bug in `git-subtree` that prevents it from working properly
with the [`rust-lang/rust`] repo. There's an open PR to fix that, but it's stale.
Before continuing with the following steps, we need to manually apply that fix to
our local copy of `git-subtree`.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -144,7 +144,7 @@ line. (You can swap `clippy::all` with the specific lint category you are target
## Configuration

Some lints can be configured in a TOML file named `clippy.toml` or `.clippy.toml`. It contains a basic `variable =
value` mapping eg.
value` mapping e.g.

```toml
avoid-breaking-exported-api = false
@@ -155,6 +155,10 @@ cognitive-complexity-threshold = 30
See the [list of lints](https://rust-lang.github.io/rust-clippy/master/index.html) for more information about which
lints can be configured and the meaning of the variables.

Note that configuration changes will not apply for code that has already been compiled and cached under `./target/`;
for example, adding a new string to `doc-valid-idents` may still result in Clippy flagging that string. To be sure that
any configuration changes are applied, you may want to run `cargo clean` and re-compile your crate from scratch.

To deactivate the “for further information visit *lint-link*” message you can
define the `CLIPPY_DISABLE_DOCS_LINKS` environment variable.

@@ -193,7 +197,7 @@ And to warn on `lint_name`, run
cargo clippy -- -W clippy::lint_name
```

This also works with lint groups. For example you
This also works with lint groups. For example, you
can run Clippy with warnings for all lints enabled:
```terminal
cargo clippy -- -W clippy::pedantic
@@ -228,7 +232,7 @@ fn main() {
You can also omit the patch version when specifying the MSRV, so `msrv = 1.30`
is equivalent to `msrv = 1.30.0`.

Note: `custom_inner_attributes` is an unstable feature so it has to be enabled explicitly.
Note: `custom_inner_attributes` is an unstable feature, so it has to be enabled explicitly.

Lints that recognize this configuration option can be found [here](https://rust-lang.github.io/rust-clippy/master/index.html#msrv)

2 changes: 1 addition & 1 deletion clippy_lints/src/approx_const.rs
Original file line number Diff line number Diff line change
@@ -87,7 +87,7 @@ impl ApproxConstant {
let s = s.as_str();
if s.parse::<f64>().is_ok() {
for &(constant, name, min_digits, msrv) in &KNOWN_CONSTS {
if is_approx_const(constant, &s, min_digits)
if is_approx_const(constant, s, min_digits)
&& msrv.as_ref().map_or(true, |msrv| meets_msrv(self.msrv.as_ref(), msrv))
{
span_lint_and_help(
6 changes: 4 additions & 2 deletions clippy_lints/src/attrs.rs
Original file line number Diff line number Diff line change
@@ -310,8 +310,10 @@ impl<'tcx> LateLintPass<'tcx> for Attributes {
|| is_word(lint, sym::deprecated)
|| is_word(lint, sym!(unreachable_pub))
|| is_word(lint, sym!(unused))
|| extract_clippy_lint(lint).map_or(false, |s| s.as_str() == "wildcard_imports")
|| extract_clippy_lint(lint).map_or(false, |s| s.as_str() == "enum_glob_use")
|| extract_clippy_lint(lint)
.map_or(false, |s| s.as_str() == "wildcard_imports")
|| extract_clippy_lint(lint)
.map_or(false, |s| s.as_str() == "enum_glob_use")
{
return;
}
5 changes: 3 additions & 2 deletions clippy_lints/src/casts/unnecessary_cast.rs
Original file line number Diff line number Diff line change
@@ -49,8 +49,9 @@ pub(super) fn check(
if cast_from.kind() == cast_to.kind() =>
{
if let Some(src) = snippet_opt(cx, lit.span) {
let num_lit = NumericLiteral::from_lit_kind(&src, &lit.node).unwrap();
lint_unnecessary_cast(cx, expr, num_lit.integer, cast_from, cast_to);
if let Some(num_lit) = NumericLiteral::from_lit_kind(&src, &lit.node) {
lint_unnecessary_cast(cx, expr, num_lit.integer, cast_from, cast_to);
}
}
},
_ => {
Loading