Skip to content

Update Clippy #105140

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 121 commits into from
Dec 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
121 commits
Select commit Hold shift + click to select a range
70b3d0e
add syntax-tree-patterns RFC
fkohlgrueber Mar 12, 2019
329dc47
Fix `redundant_closure_for_method_calls` suggestion
matttpt Oct 28, 2022
f27ca5c
Fix #9771 (`unnecessary_to_owned` false positive)
smoelius Nov 4, 2022
a091438
drive-by: PolyExistentialPredicate
compiler-errors Nov 19, 2022
31b83d0
Add missnamed_getters lint
sgued Nov 1, 2022
9891af3
missnamed_getters: Match owned methods
sgued Nov 1, 2022
ddc4996
Fix suggestion to point to the whole method
sgued Nov 1, 2022
81d4590
missnamed_getters: use all_fields iterator
sgued Nov 1, 2022
5fa0e07
Document missname_getters
sgued Nov 1, 2022
3e2e81b
Fix internal warnings
sgued Nov 1, 2022
3428da6
Fix typo missnamed -> misnamed
sgued Nov 2, 2022
a867c17
Improve code
sgued Nov 2, 2022
3f1a186
misnamed_getters: Trigger on unsafe with _unchecked
sgued Nov 2, 2022
77374a9
Add failing test
sgued Nov 12, 2022
d9993cb
Remove error when fields use autoderef
sgued Nov 20, 2022
6178dda
misname-getters: Fix documentation
sgued Nov 20, 2022
0411edf
Improve diagnostic for cases where autoderef is used
sgued Nov 20, 2022
1f2f50c
Fix many false negatives caused by autoderef
sgued Nov 20, 2022
ed183ee
Fix [`unnecessary_lazy_eval`] when type has significant drop
kraktus Oct 29, 2022
3597ed5
Rollup merge of #104595 - compiler-errors:poly-existential-predicate,…
matthiaskrgr Nov 21, 2022
386d0a5
Add an always-ambiguous predicate to make sure that we don't accident…
oli-obk Nov 2, 2022
637139d
Add `clippy_utils::msrv::Msrv` to keep track of the current MSRV
Alexendoo Nov 21, 2022
ae8f75c
Unreserve braced enum variants in value namespace
petrochenkov Oct 25, 2022
73efce9
Auto merge of #9770 - sgued:missnamed-getters, r=llogiq
bors Nov 21, 2022
46c5a5d
Merge commit 'f4850f7292efa33759b4f7f9b7621268979e9914' into clippyup
flip1995 Nov 21, 2022
28fb084
Fix declare_clippy_lint crate
flip1995 Nov 21, 2022
6fce469
Clippy: Don't import GenericParamDefKind
flip1995 Nov 21, 2022
c782822
Allow iterators instead of requiring slices that will get turned into…
oli-obk Nov 17, 2022
f60e43e
Fix clippy's missing substs
oli-obk Nov 18, 2022
595ae83
Stop passing the self-type as a separate argument.
oli-obk Nov 21, 2022
eb850ae
Use `as_closure` helper method
oli-obk Nov 21, 2022
48b10fe
Split `MacArgs` in two.
nnethercote Nov 18, 2022
e6c33e0
Auto merge of #104696 - matthiaskrgr:rollup-gi1pdb0, r=matthiaskrgr
bors Nov 22, 2022
f4083c5
Auto merge of #9745 - matttpt:fix-redundant-closure-for-method-calls-…
bors Nov 22, 2022
9e09307
Auto merge of #103578 - petrochenkov:nofict, r=nagisa
bors Nov 22, 2022
94ce446
Auto merge of #9796 - smoelius:issue-9771, r=flip1995
bors Nov 22, 2022
e95d409
Clippy: Workaround for let_chains issue
flip1995 Nov 22, 2022
b33afd6
Auto merge of #104688 - flip1995:clippyup, r=Manishearth,flip1995
bors Nov 22, 2022
5595d7f
Auto merge of #9750 - kraktus:lazy_eval, r=xFrednet
bors Nov 22, 2022
2cda73f
Use `walk_generic_arg`
smoelius Nov 22, 2022
f6f6d54
Auto merge of #9930 - smoelius:use-walk_generic_arg, r=Alexendoo
bors Nov 22, 2022
69c5128
Auto merge of #9924 - Alexendoo:msrv-stack, r=Jarcho
bors Nov 22, 2022
91d2ce3
Rollup merge of #103488 - oli-obk:impl_trait_for_tait, r=lcnr
Manishearth Nov 23, 2022
284ce9e
Move `get_associated_type` from `clippy` to `rustc_lint`
WaffleLapkin Nov 22, 2022
93cfced
Separate lifetime ident from resolution in HIR.
cjgillot Nov 5, 2022
2a530dc
Fix clippy code
estebank Nov 3, 2022
be172c5
Merge pull request #3875 from fkohlgrueber/syntax-tree-patterns
Manishearth Nov 23, 2022
ac6a77e
Rollup merge of #104742 - WaffleLapkin:forbidden-SUPER-deref, r=compi…
matthiaskrgr Nov 24, 2022
1ebdcca
Avoid `GenFuture` shim when compiling async constructs
Swatinem Nov 18, 2022
0aaea40
move some layout logic to rustc_target::abi::layout
HKalbasi Nov 1, 2022
300d10f
Auto merge of #104321 - Swatinem:async-gen, r=oli-obk
bors Nov 24, 2022
42db5e5
Use kw::Empty for elided lifetimes in path.
cjgillot Nov 6, 2022
2ad5e48
Auto merge of #103693 - HKalbasi:master, r=oli-obk
bors Nov 24, 2022
4d0fb08
Fix remark for `rfcs/0001-syntax-tree-patterns.md`
Alexendoo Nov 24, 2022
1a96571
Auto merge of #9941 - Alexendoo:syntax-tree-rfc-remark, r=Manishearth
bors Nov 24, 2022
53f78ae
Simplify a bunch of trait ref obligation creations
oli-obk Nov 18, 2022
3f059a4
Introduce PredicateKind::Clause
spastorino Nov 24, 2022
424ae23
RefCell::get_mut: fix typo
RalfJung Nov 25, 2022
a116b9b
Lint unnecessary safety comments on items
Veykril Nov 14, 2022
b8c3f64
Add some more test cases for undocumented_unsafe_blocks
Veykril Nov 17, 2022
4fa5757
Lint unnecessary safety comments on statements and block tail express…
Veykril Nov 17, 2022
9c69e1c
Simplify
Veykril Nov 17, 2022
f96dd38
Address reviews
Veykril Nov 24, 2022
268d230
Rollup merge of #104873 - RalfJung:therefore, r=Dylan-DPC
matthiaskrgr Nov 25, 2022
bbcc260
`manual_let_else`: keep macro call on suggestion blocks
dswij Nov 25, 2022
a4b53c9
`manual_let_else`: Add test with expanded macros
dswij Nov 25, 2022
4faf11a
Move syntax tree patterns RFC to the book
flip1995 Nov 25, 2022
c6a1184
Book: Format syntax tree pattern proposal
flip1995 Nov 25, 2022
efadb55
Auto merge of #9851 - Veykril:unnecessary-safety-comment, r=giraffate
bors Nov 25, 2022
5610d22
Re-enable `uninlined_format_args` on multiline `format!`
kraktus Nov 25, 2022
2fd10bc
dogfood with expanded `uninlined_format_args`
kraktus Nov 25, 2022
8b2f7e3
Auto merge of #104846 - spastorino:santa-clauses-make-goals-early-chr…
bors Nov 25, 2022
08a80d3
Auto merge of #9944 - flip1995:move-syntax-tree-patterns, r=Manishearth
bors Nov 25, 2022
6d0b4e3
Auto merge of #9945 - kraktus:uninlined_multiple_lines, r=llogiq
bors Nov 25, 2022
459621d
Improve `EXIT` lint docs
xFrednet Nov 25, 2022
030b4b7
Auto merge of #9950 - xFrednet:0000-improve-exit-docs, r=llogiq
bors Nov 27, 2022
28976ce
Link to a list of configurable lints in documentation
Alexendoo Nov 20, 2022
461e219
Allow using `clippy::msrv` as an outer attribute
Alexendoo Nov 19, 2022
ef99041
Auto merge of #9860 - Alexendoo:msrv-outer-attr, r=Jarcho
bors Nov 27, 2022
8c50dfb
Remove blank lines when needless_return returns no value
koka831 Nov 27, 2022
39d0477
Refactor BytePos handling
koka831 Nov 27, 2022
696ea06
Auto merge of #104048 - cjgillot:split-lifetime, r=compiler-errors
bors Nov 27, 2022
c55cadc
Auto merge of #9919 - Alexendoo:configuration-link, r=xFrednet
bors Nov 27, 2022
7a2d92e
Add allow-mixed-uninlined-format-args config
nyurik Nov 27, 2022
13dfbb2
Migrate from highfive to triagebot
ehuss Oct 24, 2022
ab576af
addressed review feedback
nyurik Nov 27, 2022
ef84397
Auto merge of #9963 - ehuss:highfive-triagebot, r=xFrednet
bors Nov 27, 2022
c8eba8e
Auto merge of #9967 - koka831:fix/9416, r=llogiq
bors Nov 27, 2022
5011c67
Rename `ast::Lit` as `ast::MetaItemLit`.
nnethercote Nov 23, 2022
fc108d4
fix clippy tests
estebank Nov 28, 2022
0eaa0d3
Rollup merge of #104804 - nnethercote:MetaItemLit, r=petrochenkov
matthiaskrgr Nov 28, 2022
1207480
Auto merge of #9865 - nyurik:allow-mixed, r=xFrednet
bors Nov 28, 2022
82c07f0
partially_normalize_... -> At::normalize
compiler-errors Nov 25, 2022
a61e2a9
FnCtxt normalization stuff
compiler-errors Nov 25, 2022
6bbf166
Move `index_refutable_slice` to `pedantic`
xFrednet Nov 28, 2022
0893322
Don't lint `unnecessary_operation` in mixed macro contexts
Jarcho Nov 29, 2022
f44b7aa
Don't lint `unnecessary_cast` in mixed macro context
Jarcho Nov 29, 2022
e9a8b8c
Auto merge of #9980 - Jarcho:issue_9960, r=xFrednet
bors Nov 29, 2022
4cda21d
Auto merge of #9981 - Jarcho:issue_9954, r=flip1995
bors Nov 29, 2022
bfb973f
Auto merge of #9975 - xFrednet:0000-refutable-slice-pedantic, r=llogiq
bors Nov 29, 2022
8759f33
Add S-waiting-on-review autolabel.
ehuss Nov 29, 2022
3cf2c17
Auto merge of #9985 - ehuss:triagebot-autolabel, r=xFrednet
bors Nov 29, 2022
c502dee
Use `snippet_with_context` instead of `_with_macro_callsite`
dswij Nov 30, 2022
58100c0
Auto merge of #104905 - compiler-errors:normalization-changes, r=spas…
bors Nov 30, 2022
cc43c3d
Move `unnecessary_unsafety_doc` to `pedantic`
xFrednet Nov 29, 2022
78589ff
Auto merge of #9989 - xFrednet:9986-move-safety-thingy, r=flip1995
bors Nov 30, 2022
e0eba9c
Don't cross contexts while building the suggestion for `redundant_clo…
Jarcho Nov 29, 2022
73f4546
Fix `unnecessary_cast` suggestion when taking a reference
Jarcho Nov 30, 2022
2d32b40
Don't lint `explicit_auto_deref` when the initial type is neither a r…
Jarcho Nov 30, 2022
87963f0
Auto merge of #9987 - Jarcho:issue_9957, r=flip1995
bors Nov 30, 2022
c1b8bc6
Fix ICE in `unused_rounding`
Jarcho Nov 30, 2022
d7d098a
Auto merge of #9997 - Jarcho:issue_9901, r=llogiq
bors Nov 30, 2022
846c9b8
Auto merge of #9996 - Jarcho:issue_9906, r=Alexendoo
bors Nov 30, 2022
1cdb06d
Auto merge of #10001 - Jarcho:issue_9866, r=llogiq
bors Nov 30, 2022
ee12b12
Auto merge of #9943 - dswij:pr-9940, r=Jarcho
bors Nov 30, 2022
7ae5c81
Fix ICE in `result large_err` with uninhabited enums
Jarcho Dec 1, 2022
641ced4
Auto merge of #10007 - Jarcho:issue_10005, r=giraffate
bors Dec 1, 2022
11434f2
Merge remote-tracking branch 'upstream/master' into rustup
flip1995 Dec 1, 2022
4063712
Bump nightly version -> 2022-12-01
flip1995 Dec 1, 2022
d822110
Auto merge of #10010 - flip1995:rustup, r=flip1995
bors Dec 1, 2022
ebf5799
Merge commit 'd822110d3b5625b9dc80ccc442e06fc3cc851d76' into clippyup
flip1995 Dec 1, 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
2 changes: 2 additions & 0 deletions src/tools/clippy/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4188,6 +4188,7 @@ Released 2018-09-13
[`misaligned_transmute`]: https://rust-lang.github.io/rust-clippy/master/index.html#misaligned_transmute
[`mismatched_target_os`]: https://rust-lang.github.io/rust-clippy/master/index.html#mismatched_target_os
[`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_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
Expand Down Expand Up @@ -4450,6 +4451,7 @@ Released 2018-09-13
[`unnecessary_mut_passed`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed
[`unnecessary_operation`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_operation
[`unnecessary_owned_empty_strings`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_owned_empty_strings
[`unnecessary_safety_comment`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_safety_comment
[`unnecessary_safety_doc`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_safety_doc
[`unnecessary_self_imports`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_self_imports
[`unnecessary_sort_by`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by
Expand Down
6 changes: 3 additions & 3 deletions src/tools/clippy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ disallowed-names = ["toto", "tata", "titi"]
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.
See the [list of configurable lints](https://rust-lang.github.io/rust-clippy/master/index.html#Configuration),
the lint descriptions contain the names and meanings of these configuration variables.

> **Note**
>
Expand All @@ -224,7 +224,7 @@ in the `Cargo.toml` can be used.
rust-version = "1.30"
```

The MSRV can also be specified as an inner attribute, like below.
The MSRV can also be specified as an attribute, like below.

```rust
#![feature(custom_inner_attributes)]
Expand Down
1 change: 1 addition & 0 deletions src/tools/clippy/book/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@
- [The Clippy Book](development/infrastructure/book.md)
- [Proposals](development/proposals/README.md)
- [Roadmap 2021](development/proposals/roadmap-2021.md)
- [Syntax Tree Patterns](development/proposals/syntax-tree-patterns.md)
6 changes: 3 additions & 3 deletions src/tools/clippy/book/src/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ disallowed-names = ["toto", "tata", "titi"]
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.
See the [list of configurable lints](https://rust-lang.github.io/rust-clippy/master/index.html#Configuration),
the lint descriptions contain the names and meanings of these configuration variables.

To deactivate the "for further information visit *lint-link*" message you can define the `CLIPPY_DISABLE_DOCS_LINKS`
environment variable.
Expand Down Expand Up @@ -72,7 +72,7 @@ minimum supported Rust version (MSRV) in the clippy configuration file.
msrv = "1.30.0"
```

The MSRV can also be specified as an inner attribute, like below.
The MSRV can also be specified as an attribute, like below.

```rust
#![feature(custom_inner_attributes)]
Expand Down
18 changes: 7 additions & 11 deletions src/tools/clippy/book/src/development/adding_lints.md
Original file line number Diff line number Diff line change
Expand Up @@ -443,27 +443,27 @@ value is passed to the constructor in `clippy_lints/lib.rs`.

```rust
pub struct ManualStrip {
msrv: Option<RustcVersion>,
msrv: Msrv,
}

impl ManualStrip {
#[must_use]
pub fn new(msrv: Option<RustcVersion>) -> Self {
pub fn new(msrv: Msrv) -> Self {
Self { msrv }
}
}
```

The project's MSRV can then be matched against the feature MSRV in the LintPass
using the `meets_msrv` utility function.
using the `Msrv::meets` method.

``` rust
if !meets_msrv(self.msrv, msrvs::STR_STRIP_PREFIX) {
if !self.msrv.meets(msrvs::STR_STRIP_PREFIX) {
return;
}
```

The project's MSRV can also be specified as an inner attribute, which overrides
The project's MSRV can also be specified as an attribute, which overrides
the value from `clippy.toml`. This can be accounted for using the
`extract_msrv_attr!(LintContext)` macro and passing
`LateContext`/`EarlyContext`.
Expand All @@ -483,19 +483,15 @@ have a case for the version below the MSRV and one with the same contents but
for the MSRV version itself.

```rust
#![feature(custom_inner_attributes)]

...

#[clippy::msrv = "1.44"]
fn msrv_1_44() {
#![clippy::msrv = "1.44"]

/* something that would trigger the lint */
}

#[clippy::msrv = "1.45"]
fn msrv_1_45() {
#![clippy::msrv = "1.45"]

/* something that would trigger the lint */
}
```
Expand Down
Loading