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

Clippy subtree update #128193

Merged
merged 141 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
dd9e8c8
Refactor `arc_with_non_send_sync`
Jarcho Jun 8, 2024
01f53c2
Refactor `borrow_deref_ref`: Match HIR tree before checking for macros.
Jarcho Jun 9, 2024
39cd58e
Refactor `collapsible_if`: Check AST before checking for macros
Jarcho Jun 9, 2024
1f530ab
Refactor `collection_is_never_read`: Check HIR tree before checking t…
Jarcho Jun 9, 2024
d15ec0f
Refactor `crate_in_macro_def`:
Jarcho Jun 9, 2024
441500b
Refactor `else_if_without_else`: Check the AST before the macro check.
Jarcho Jun 10, 2024
d1dcd91
`equatable_if_let`: Check HIR tree before checking for macros.
Jarcho Jun 10, 2024
672b8b5
Refactor `empty_enums`: Check the HIR tree before the feature check.
Jarcho Jun 10, 2024
5b0dac6
`error_impl_error`: Get `Error` `DefId` after checking the HIR tree.
Jarcho Jun 10, 2024
5368895
`exhaustive_items`: Don't check the item kind twice.
Jarcho Jun 11, 2024
ca7e5c1
`exit`: Use `OwnerNode`.
Jarcho Jun 11, 2024
278e837
`float_literal`: Check HIR tree before checking types.
Jarcho Jun 11, 2024
3fcac2c
`from_over_into`: Check HIR tree first.
Jarcho Jun 11, 2024
9f59e9a
`from_str_radix_10` : Reorder checks
Jarcho Jun 11, 2024
65b9fae
Refactor `checked_conversions`:
Jarcho Jun 9, 2024
0a25df8
Refactor `double_parens`:
Jarcho Jun 10, 2024
e864519
Add test for manual_unwrap_or in issue 13018
tesuji Jul 7, 2024
c46c1f6
Fix 13018: self should be T
tesuji Jul 7, 2024
1b0230c
Refactor `endian_bytes`:
Jarcho Jun 10, 2024
f178316
Refactor `excessive_bools`:
Jarcho Jun 11, 2024
d409b5c
`extra_unused_type_parameters`:
Jarcho Jun 11, 2024
c32af26
Refactor `future_not_send`
Jarcho Jun 11, 2024
776a523
`if_let_mutex`: Use `for_each_expr`.
Jarcho Jun 11, 2024
b26b820
Refactor `if_not_else`:
Jarcho Jun 11, 2024
517e1ac
`if_then_some_else_none`: Check HIR tree before other checks.
Jarcho Jun 11, 2024
3869e93
`ignored_unit_patterns`: Reorder checks.
Jarcho Jun 11, 2024
b58b491
`inconsistent_struct_constructor`: Check HIR tree first.
Jarcho Jun 11, 2024
06f83b4
`index_refutable_slice`: Check HIR tree first.
Jarcho Jun 11, 2024
c73aceb
`indexing_slicing`: Check HIR tree first.
Jarcho Jun 11, 2024
f493d71
`infinite_iter`: Only lock the symbol table once.
Jarcho Jun 12, 2024
36a14e3
`misc`:
Jarcho Jun 13, 2024
58aa804
`mismatching_type_param_order`: Delay macro check.
Jarcho Jun 13, 2024
c226088
`needless_borrowed_ref`: Check HIR tree first.
Jarcho Jun 13, 2024
139dad8
`mut_mut`: Delay macro check
Jarcho Jun 13, 2024
7c17dd3
`needless_for_each`: Check HIR tree first.
Jarcho Jun 15, 2024
ff28de2
`neg_cmp_op_on_partial_ord`: Delay macro check
Jarcho Jun 15, 2024
15eac5a
Simplify `option_env_unwrap`.
Jarcho Jun 15, 2024
e12ff63
`permissions_set_readonly_false`: Check HIR tree first.
Jarcho Jun 16, 2024
0c72a99
`raw_strings` Check HIR tree first.
Jarcho Jun 16, 2024
296dcf0
unnecessary_struct_initialization: extend to assignments moving all f…
phi-gamma Apr 19, 2024
601a61f
Lintcheck: Refactor `CrateSource`
xFrednet Jul 9, 2024
c1fd25d
Merge commit 'b794b8e08c16517a941dc598bb1483e8e12a8592' into clippy-s…
flip1995 Jul 11, 2024
d5e1aca
Add Expand All and Collapse All
SpencerAWill Apr 4, 2024
8bfd992
Fix button styling on desktop and mobile views.
SpencerAWill Apr 9, 2024
6ae5fd9
Remove event propagation calls. Adjust column spacing for filter pane…
SpencerAWill Jul 7, 2024
86d348d
Auto merge of #12656 - SpencerAWill:Add-expand-all-to-the-web-site, r…
bors Jul 11, 2024
edeb0fc
Fix syntax errors in example code
flba-eb Jul 12, 2024
983b4c3
[`unwrap_or_default`]: skip warning when calling inside of suggested …
J-ZhengLi Jul 12, 2024
51a1cf0
Auto merge of #13089 - flba-eb:fix_example, r=y21
bors Jul 12, 2024
0cbbee1
Auto merge of #13090 - J-ZhengLi:issue9790, r=blyxyas
bors Jul 12, 2024
39378cf
Add more doc-valid-idents
waywardmonkeys Jul 13, 2024
cc1bb8f
make [`or_fun_call`] and [`unwrap_or_default`] recursive.
J-ZhengLi Jul 11, 2024
1aac778
Auto merge of #13085 - J-ZhengLi:issue12973, r=llogiq
bors Jul 13, 2024
e7d17e6
Auto merge of #13061 - tesuji:fix-map-unwrap-or-13018, r=dswij
bors Jul 13, 2024
206e4ad
Auto merge of #13046 - Jarcho:check_conv, r=dswij
bors Jul 13, 2024
10ba798
Auto merge of #13093 - waywardmonkeys:more-doc-valid-idents, r=Alexendoo
bors Jul 14, 2024
185f4b0
Fix trivial gen ident usage in tools
compiler-errors Jul 14, 2024
3b390d4
Bump clippy version
oli-obk Jul 15, 2024
22eeb11
Auto merge of #13098 - oli-obk:bump_ui_test, r=Alexendoo
bors Jul 15, 2024
4264548
Add regression test for issue 13077
tesuji Jul 15, 2024
dcee2e8
Dont stop find loop node at struct field node
tesuji Jul 15, 2024
eb4d88e
Auto merge of #13102 - tesuji:fix-needless_option_as_deref, r=Alexendoo
bors Jul 15, 2024
489a778
fix [`excessive_precision`] suggestions on float literal written in s…
apoisternex Jul 14, 2024
c1c945a
Move rustc_infer::infer::error_reporting to rustc_infer::error_report…
compiler-errors Jul 9, 2024
0ee9f44
Auto merge of #13096 - apoisternex:issue12954, r=y21
bors Jul 16, 2024
620a056
hir: Create `hir::ConstArgKind` enum
camelid Jun 3, 2024
6e99e2d
Use `ConstArg` for array lengths
camelid Jun 5, 2024
f2c1265
Add `ConstArgKind::Path` and make `ConstArg` its own HIR node
camelid Jul 17, 2024
c65ddb8
Add regression test for issue 13110
tesuji Jul 17, 2024
5540060
Skip linting if array length is from a macro.
tesuji Jul 17, 2024
0b0c39c
Show progress while running dogfood test
Alexendoo Jul 15, 2024
e34c6db
Refactor for using config values:
Jarcho Jul 12, 2024
f74037e
Auto merge of #13088 - Jarcho:conf_refactor2, r=flip1995
bors Jul 17, 2024
acc41f4
Auto merge of #13100 - Alexendoo:dogfood-progress, r=xFrednet
bors Jul 17, 2024
3c50e7a
Lint only if array length is a literal zero.
tesuji Jul 18, 2024
b0209dc
valtree construction: keep track of which type was valtree-incompatible
RalfJung Jul 13, 2024
073f9d9
Auto merge of #13116 - tesuji:fix_zero_repeat_side_effects, r=y21
bors Jul 18, 2024
8dd310d
Fix wrong suggestion for `single_element_loop` where parens were missing
GuillaumeGomez Jul 17, 2024
bc2feea
Auto merge of #13117 - GuillaumeGomez:fix-single_element_loop-suggest…
bors Jul 18, 2024
0e3d197
Lintcheck: Construct links for sources
xFrednet Jul 9, 2024
b31bce4
Auto merge of #13104 - xFrednet:00000-lintcheck-better-md-links, r=Al…
bors Jul 18, 2024
31fdc2e
Lintcheck: Remove `rust-toolchain` from downloaded crates
xFrednet Jul 18, 2024
9d82fb4
Lintcheck: More info on Diags without spans
xFrednet Jul 18, 2024
e34db99
Update version attribute for 1.80 lints
xFrednet Jul 18, 2024
642ab11
Changelog for Clippy 1.80 :sun_with_face:
xFrednet Jul 18, 2024
8a0ccd3
Make clippy and rustdoc happy
compiler-errors Feb 8, 2024
8051d07
Auto merge of #125915 - camelid:const-arg-refactor, r=BoxyUwU
bors Jul 19, 2024
14e2711
Triagebot: Add xFrednet back to Clippy's reviewer roulette
xFrednet Jul 19, 2024
ac2ba15
Auto merge of #13129 - xFrednet:interesting-life-choices, r=xFrednet
bors Jul 19, 2024
46ebe0c
Lintcheck: Normalize thread IDs in shared_target_dir
xFrednet Jul 18, 2024
4ece12d
Lintcheck: Update the default testset for local lintcheck
xFrednet Jul 18, 2024
8940bc3
Lintcheck: New testset for Clippy's CI (200 crates for ~10 min)
xFrednet Jul 18, 2024
057c4ae
Auto merge of #13124 - xFrednet:00000-lintcheck-crates, r=Alexendoo
bors Jul 19, 2024
cf4270d
Reduce typo count.
waywardmonkeys Jul 20, 2024
b02cb24
Auto merge of #13131 - waywardmonkeys:reduce-typo-count, r=Alexendoo
bors Jul 20, 2024
09906b8
Lintcheck: Linkify counts in CI summery
xFrednet Jul 19, 2024
83c8385
Lintcheck: Remove empty lines from rendered CI output
xFrednet Jul 20, 2024
69c3289
Lintcheck: Include the crate name in the CI job summary
xFrednet Jul 20, 2024
cb77f12
[`pathbuf_init_then_push`]: Checks for calls to `push` immediately a…
lengyijun Oct 23, 2023
8fe5c75
Auto merge of #11700 - lengyijun:pathbuf_join, r=xFrednet
bors Jul 21, 2024
7f0ed11
Auto merge of #13133 - xFrednet:lintcheck-linkify-summary, r=Alexendoo
bors Jul 21, 2024
5f3d385
Auto merge of #120812 - compiler-errors:impl-sorting, r=lcnr
bors Jul 21, 2024
1807580
Auto merge of #12772 - phi-gamma:redundant-struct-recreation, r=y21
bors Jul 21, 2024
897c4d3
Move all error reporting into rustc_trait_selection
compiler-errors Jul 21, 2024
efde1c0
Fix tools
compiler-errors Jul 21, 2024
3149037
Sync `mut_visit` function names with immut `visit` ones (s/noop_visit…
oli-obk Jul 10, 2024
221ac86
Always pass the visitor as the first argument to walk* functions
oli-obk Jul 17, 2024
4798383
Lintcheck: Limit summary size to 1024k and copy to logs
xFrednet Jul 21, 2024
4fea519
Lintcheck: Order summary by lint and truncate messages
xFrednet Jul 21, 2024
1f879fc
Lintcheck: Minor cleanup and function moves
xFrednet Jul 22, 2024
10bf729
Lintcheck: Include truncated diff in CI artifacts
xFrednet Jul 22, 2024
23b231a
Lintcheck: Fix Errors, because of course
xFrednet Jul 22, 2024
afe811a
Suggest `.cast`/`.cast_const`/`.cast_mut` in `transmute_ptr_as_ptr`
Alexendoo Jul 22, 2024
637d39f
Auto merge of #13065 - Jarcho:misc_small2, r=xFrednet
bors Jul 22, 2024
f9c2407
Auto merge of #13072 - Jarcho:misc_small5, r=xFrednet
bors Jul 22, 2024
e2a7000
Get rid of infer_ctxt_ext
compiler-errors Jul 22, 2024
df1baed
Auto merge of #13050 - Jarcho:misc_small, r=xFrednet
bors Jul 22, 2024
04693a4
Lintcheck: Support underscores replacement in URL crate names
xFrednet Jul 23, 2024
7010d3c
Don't suggest `.cast_mut`/`.cast_const` for types with erased lifetimes
Alexendoo Jul 23, 2024
bd1224d
Auto merge of #13148 - xFrednet:lintcheck-link-correction-again, r=Al…
bors Jul 23, 2024
af6d49d
Fix running compile-test under cargo nextest
Alexendoo Jul 23, 2024
493498b
Make `BindInsteadOfMap` a struct
Alexendoo Jul 23, 2024
e91d82e
Auto merge of #13143 - Alexendoo:transmute-ptr-to-ptr-suggestions, r=y21
bors Jul 23, 2024
5ea7044
Temporarily remove myself from reviewer rotation
blyxyas Jul 23, 2024
760a278
Auto merge of #13154 - blyxyas:focus-on-contribs, r=blyxyas
bors Jul 23, 2024
615284a
Auto merge of #13151 - Alexendoo:nextest, r=Jarcho
bors Jul 23, 2024
b21a91a
Replace local variables signifying "done" or "loop break", use Contro…
blyxyas May 29, 2024
959477e
Auto merge of #13153 - Alexendoo:bind-instead-of-map-struct, r=Manish…
bors Jul 24, 2024
6d67468
Auto merge of #127524 - oli-obk:feed_item_attrs2, r=petrochenkov
bors Jul 24, 2024
16953ce
Auto merge of #12830 - blyxyas:more-controlflow, r=y21,xFredNet
bors Jul 24, 2024
6d28e1a
Lint casts to `u128` in `cast_lossless`
Alexendoo Jul 22, 2024
bdf3e58
Lintcheck: Review comments <3
xFrednet Jul 24, 2024
5e6540f
Auto merge of #13146 - Alexendoo:cast-lossless-128, r=y21
bors Jul 24, 2024
be82340
Auto merge of #13139 - xFrednet:lintcheck-limit-summery-output, r=Ale…
bors Jul 25, 2024
df0cb6c
Auto merge of #13125 - xFrednet:changelog-1-80, r=dswij
bors Jul 25, 2024
9f53fc3
Merge remote-tracking branch 'upstream/master' into rustup
flip1995 Jul 25, 2024
09419e4
Bump nightly version -> 2024-07-25
flip1995 Jul 25, 2024
71b0f0f
Bump Clippy version -> 0.1.82
flip1995 Jul 25, 2024
37f4fbb
Auto merge of #13157 - flip1995:rustup, r=flip1995
bors Jul 25, 2024
b270543
Merge commit '37f4fbb92913586b73a35772efd00eccd1cbbe13' into clippy-s…
flip1995 Jul 25, 2024
0949ff9
Update Cargo.lock
flip1995 Jul 25, 2024
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
31 changes: 20 additions & 11 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70"

[[package]]
name = "clippy"
version = "0.1.81"
version = "0.1.82"
dependencies = [
"anstream",
"clippy_config",
Expand All @@ -594,13 +594,13 @@ dependencies = [
"termize",
"tokio",
"toml 0.7.8",
"ui_test 0.23.0",
"ui_test 0.24.0",
"walkdir",
]

[[package]]
name = "clippy_config"
version = "0.1.81"
version = "0.1.82"
dependencies = [
"rustc-semver",
"serde",
Expand All @@ -623,7 +623,7 @@ dependencies = [

[[package]]
name = "clippy_lints"
version = "0.1.81"
version = "0.1.82"
dependencies = [
"arrayvec",
"cargo_metadata 0.18.1",
Expand All @@ -648,7 +648,7 @@ dependencies = [

[[package]]
name = "clippy_utils"
version = "0.1.81"
version = "0.1.82"
dependencies = [
"arrayvec",
"clippy_config",
Expand Down Expand Up @@ -969,7 +969,7 @@ dependencies = [

[[package]]
name = "declare_clippy_lint"
version = "0.1.81"
version = "0.1.82"
dependencies = [
"itertools",
"quote",
Expand Down Expand Up @@ -2977,6 +2977,16 @@ dependencies = [
"pad",
]

[[package]]
name = "prettydiff"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "abec3fb083c10660b3854367697da94c674e9e82aa7511014dc958beeb7215e9"
dependencies = [
"owo-colors",
"pad",
]

[[package]]
name = "proc-macro-hack"
version = "0.5.20+deprecated"
Expand Down Expand Up @@ -5824,7 +5834,7 @@ dependencies = [
"indicatif",
"lazy_static",
"levenshtein",
"prettydiff",
"prettydiff 0.6.4",
"regex",
"rustc_version",
"rustfix 0.6.1",
Expand All @@ -5835,9 +5845,9 @@ dependencies = [

[[package]]
name = "ui_test"
version = "0.23.0"
version = "0.24.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "29e5f4ffcbab82453958fbf59990e981b8e8a177dcd60c2bd8f9b52c3036a6e1"
checksum = "bc1c6c78d55482388711c8d417b8e547263046a607512278fed274c54633bbe4"
dependencies = [
"annotate-snippets 0.11.4",
"anyhow",
Expand All @@ -5851,14 +5861,13 @@ dependencies = [
"indicatif",
"lazy_static",
"levenshtein",
"prettydiff",
"prettydiff 0.7.0",
"regex",
"rustc_version",
"rustfix 0.8.1",
"serde",
"serde_json",
"spanned",
"tempfile",
]

[[package]]
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/.cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ uibless = "test --test compile-test -- -- --bless"
bless = "test -- -- --bless"
dev = "run --package clippy_dev --bin clippy_dev --manifest-path clippy_dev/Cargo.toml --"
lintcheck = "run --package lintcheck --bin lintcheck --manifest-path lintcheck/Cargo.toml -- "
collect-metadata = "test --test dogfood --features internal -- run_metadata_collection_lint --ignored"
collect-metadata = "test --test dogfood --features internal -- collect_metadata"

[build]
# -Zbinary-dep-depinfo allows us to track which rlib files to use for compiling UI tests
Expand Down
28 changes: 22 additions & 6 deletions src/tools/clippy/.github/workflows/lintcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,18 @@ jobs:
id: cache-json
uses: actions/cache@v4
with:
path: lintcheck-logs/lintcheck_crates_logs.json
path: lintcheck-logs/ci_crates_logs.json
key: ${{ steps.key.outputs.key }}

- name: Run lintcheck
if: steps.cache-json.outputs.cache-hit != 'true'
run: ./target/debug/lintcheck --format json --warn-all
run: ./target/debug/lintcheck --format json --warn-all --crates-toml ./lintcheck/ci_crates.toml

- name: Upload base JSON
uses: actions/upload-artifact@v4
with:
name: base
path: lintcheck-logs/lintcheck_crates_logs.json
path: lintcheck-logs/ci_crates_logs.json

# Runs lintcheck on the PR and stores the results as an artifact
head:
Expand All @@ -86,13 +86,13 @@ jobs:
run: cargo build --manifest-path=lintcheck/Cargo.toml

- name: Run lintcheck
run: ./target/debug/lintcheck --format json --warn-all
run: ./target/debug/lintcheck --format json --warn-all --crates-toml ./lintcheck/ci_crates.toml

- name: Upload head JSON
uses: actions/upload-artifact@v4
with:
name: head
path: lintcheck-logs/lintcheck_crates_logs.json
path: lintcheck-logs/ci_crates_logs.json

# Retrieves the head and base JSON results and prints the diff to the GH actions step summary
diff:
Expand All @@ -115,4 +115,20 @@ jobs:
uses: actions/download-artifact@v4

- name: Diff results
run: ./target/debug/lintcheck diff {base,head}/lintcheck_crates_logs.json >> $GITHUB_STEP_SUMMARY
# GH's summery has a maximum size of 1024k:
# https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-markdown-summary
# That's why we first log to file and then to the summary and logs
run: |
./target/debug/lintcheck diff {base,head}/ci_crates_logs.json --truncate >> truncated_diff.md
head -c 1024000 truncated_diff.md >> $GITHUB_STEP_SUMMARY
cat truncated_diff.md
./target/debug/lintcheck diff {base,head}/ci_crates_logs.json >> full_diff.md

- name: Upload full diff
uses: actions/upload-artifact@v4
with:
name: diff
if-no-files-found: ignore
path: |
full_diff.md
truncated_diff.md
47 changes: 45 additions & 2 deletions src/tools/clippy/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,53 @@ document.

## Unreleased / Beta / In Rust Nightly

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

## Rust 1.80

Current stable, released 2024-07-25

[View all 68 merged pull requests](https://github.com/rust-lang/rust-clippy/pulls?q=merged%3A2024-04-18T22%3A50%3A22Z..2024-05-30T08%3A26%3A18Z+base%3Amaster)

### New Lints

* Added [`while_float`] to `nursery`
[#12765](https://github.com/rust-lang/rust-clippy/pull/12765)
* Added [`macro_metavars_in_unsafe`] to `suspicious`
[#12107](https://github.com/rust-lang/rust-clippy/pull/12107)
* Added [`renamed_function_params`] to `restriction`
[#11540](https://github.com/rust-lang/rust-clippy/pull/11540)
* Added [`doc_lazy_continuation`] to `style`
[#12770](https://github.com/rust-lang/rust-clippy/pull/12770)

### Moves and Deprecations

* Moved [`assigning_clones`] to `pedantic` (From `perf` now allow-by-default)
[#12779](https://github.com/rust-lang/rust-clippy/pull/12779)
* Moved [`single_char_pattern`] to `pedantic` (From `perf` now allow-by-default)
[#11852](https://github.com/rust-lang/rust-clippy/pull/11852)

### Enhancements

* [`panic`]: Added [`allow-panic-in-tests`] configuration to allow the lint in tests
[#12803](https://github.com/rust-lang/rust-clippy/pull/12803)
* [`missing_const_for_fn`]: Now respects the [`msrv`] configuration
[#12713](https://github.com/rust-lang/rust-clippy/pull/12713)
* [`missing_panics_doc`]: No longer lints on compile-time panics
[#12790](https://github.com/rust-lang/rust-clippy/pull/12790)
* [`collapsible_match`]: Now considers the [`msrv`] configuration for the suggestion
[#12745](https://github.com/rust-lang/rust-clippy/pull/12745)
* [`useless_vec`]: Added [`allow-useless-vec-in-tests`] configuration to allow the lint in tests
[#12725](https://github.com/rust-lang/rust-clippy/pull/12725)

### Suggestion Fixes/Improvements

* [`single_match`], [`single_match_else`]: Suggestions are now machine-applicable
[#12726](https://github.com/rust-lang/rust-clippy/pull/12726)

## Rust 1.79

Current stable, released 2024-06-13
Released 2024-06-13

[View all 102 merged pull requests](https://github.com/rust-lang/rust-clippy/pulls?q=merged%3A2024-03-08T11%3A13%3A58Z..2024-04-18T15%3A50%3A50Z+base%3Amaster)

Expand Down Expand Up @@ -5712,6 +5754,7 @@ Released 2018-09-13
[`partialeq_to_none`]: https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none
[`path_buf_push_overwrite`]: https://rust-lang.github.io/rust-clippy/master/index.html#path_buf_push_overwrite
[`path_ends_with_ext`]: https://rust-lang.github.io/rust-clippy/master/index.html#path_ends_with_ext
[`pathbuf_init_then_push`]: https://rust-lang.github.io/rust-clippy/master/index.html#pathbuf_init_then_push
[`pattern_type_mismatch`]: https://rust-lang.github.io/rust-clippy/master/index.html#pattern_type_mismatch
[`permissions_set_readonly_false`]: https://rust-lang.github.io/rust-clippy/master/index.html#permissions_set_readonly_false
[`positional_named_format_parameters`]: https://rust-lang.github.io/rust-clippy/master/index.html#positional_named_format_parameters
Expand Down
9 changes: 6 additions & 3 deletions 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.81"
version = "0.1.82"
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 Expand Up @@ -30,11 +30,10 @@ color-print = "0.3.4"
anstream = "0.6.0"

[dev-dependencies]
ui_test = "0.23"
ui_test = "0.24"
regex = "1.5.5"
toml = "0.7.3"
walkdir = "2.3"
# This is used by the `collect-metadata` alias.
filetime = "0.2.9"
itertools = "0.12"

Expand Down Expand Up @@ -63,3 +62,7 @@ rustc_private = true
[[test]]
name = "compile-test"
harness = false

[[test]]
name = "dogfood"
harness = false
14 changes: 5 additions & 9 deletions src/tools/clippy/book/src/development/adding_lints.md
Original file line number Diff line number Diff line change
Expand Up @@ -458,9 +458,8 @@ pub struct ManualStrip {
}

impl ManualStrip {
#[must_use]
pub fn new(msrv: Msrv) -> Self {
Self { msrv }
pub fn new(conf: &'static Conf) -> Self {
Self { msrv: conf.msrv.clone() }
}
}
```
Expand Down Expand Up @@ -689,7 +688,6 @@ for some users. Adding a configuration is done in the following steps:
]);

// New manual definition struct
#[derive(Copy, Clone)]
pub struct StructName {}

impl_lint_pass!(StructName => [
Expand All @@ -700,17 +698,16 @@ for some users. Adding a configuration is done in the following steps:
2. Next add the configuration value and a corresponding creation method like
this:
```rust
#[derive(Copy, Clone)]
pub struct StructName {
configuration_ident: Type,
}

// ...

impl StructName {
pub fn new(configuration_ident: Type) -> Self {
pub fn new(conf: &'static Conf) -> Self {
Self {
configuration_ident,
configuration_ident: conf.configuration_ident,
}
}
}
Expand All @@ -726,8 +723,7 @@ for some users. Adding a configuration is done in the following steps:
store.register_*_pass(|| box module::StructName);

// New registration with configuration value
let configuration_ident = conf.configuration_ident.clone();
store.register_*_pass(move || box module::StructName::new(configuration_ident));
store.register_*_pass(move || box module::StructName::new(conf));
```

Congratulations the work is almost done. The configuration value can now be
Expand Down
3 changes: 2 additions & 1 deletion src/tools/clippy/book/src/lint_configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ default configuration of Clippy. By default, any configuration will replace the
* `doc-valid-idents = ["ClipPy"]` would replace the default list with `["ClipPy"]`.
* `doc-valid-idents = ["ClipPy", ".."]` would append `ClipPy` to the default list.

**Default Value:** `["KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "DevOps", "DirectX", "ECMAScript", "GPLv2", "GPLv3", "GitHub", "GitLab", "IPv4", "IPv6", "ClojureScript", "CoffeeScript", "JavaScript", "PureScript", "TypeScript", "WebAssembly", "NaN", "NaNs", "OAuth", "GraphQL", "OCaml", "OpenDNS", "OpenGL", "OpenMP", "OpenSSH", "OpenSSL", "OpenStreetMap", "OpenTelemetry", "WebGL", "WebGL2", "WebGPU", "WebP", "OpenExr", "YCbCr", "sRGB", "TensorFlow", "TrueType", "iOS", "macOS", "FreeBSD", "TeX", "LaTeX", "BibTeX", "BibLaTeX", "MinGW", "CamelCase"]`
**Default Value:** `["TiB", "CoreGraphics", "CoffeeScript", "TeX", "Direct2D", "PiB", "DirectX", "NetBSD", "OAuth", "NaN", "OpenType", "WebGL2", "WebTransport", "JavaScript", "OpenSSL", "OpenSSH", "EiB", "PureScript", "OpenAL", "MiB", "WebAssembly", "MinGW", "CoreFoundation", "WebGPU", "ClojureScript", "CamelCase", "OpenDNS", "NaNs", "OpenMP", "GitLab", "KiB", "sRGB", "CoreText", "macOS", "TypeScript", "GiB", "OpenExr", "YCbCr", "OpenTelemetry", "OpenBSD", "FreeBSD", "GPLv2", "PostScript", "WebP", "LaTeX", "TensorFlow", "AccessKit", "TrueType", "OpenStreetMap", "OpenGL", "DevOps", "OCaml", "WebRTC", "WebGL", "BibLaTeX", "GitHub", "GraphQL", "iOS", "Direct3D", "BibTeX", "DirectWrite", "GPLv3", "IPv6", "WebSocket", "IPv4", "ECMAScript"]`

---
**Affected lints:**
Expand Down Expand Up @@ -679,6 +679,7 @@ The minimum rust version that the project supports. Defaults to the `rust-versio
* [`cast_abs_to_unsigned`](https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned)
* [`checked_conversions`](https://rust-lang.github.io/rust-clippy/master/index.html#checked_conversions)
* [`cloned_instead_of_copied`](https://rust-lang.github.io/rust-clippy/master/index.html#cloned_instead_of_copied)
* [`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)
* [`deprecated_cfg_attr`](https://rust-lang.github.io/rust-clippy/master/index.html#deprecated_cfg_attr)
* [`derivable_impls`](https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls)
Expand Down
1 change: 0 additions & 1 deletion src/tools/clippy/clippy.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ reason = "this function does not add a link to our documentation, please use the
path = "rustc_lint::context::LintContext::span_lint"
reason = "this function does not add a link to our documentation, please use the `clippy_utils::diagnostics::span_lint*` functions instead"


[[disallowed-methods]]
path = "rustc_middle::ty::context::TyCtxt::node_span_lint"
reason = "this function does not add a link to our documentation, please use the `clippy_utils::diagnostics::span_lint_hir*` functions instead"
2 changes: 1 addition & 1 deletion src/tools/clippy/clippy_config/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "clippy_config"
version = "0.1.81"
version = "0.1.82"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
Loading
Loading