Skip to content

Commit 48bbe12

Browse files
committed
Auto merge of rust-lang#128193 - flip1995:clippy-subtree-update, r=matthiaskrgr
Clippy subtree update r? `@Manishearth` Updates Cargo.lock due to the Clippy version update and the ui_test bump to v0.24
2 parents 72d73ce + 0949ff9 commit 48bbe12

File tree

292 files changed

+4866
-5172
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

292 files changed

+4866
-5172
lines changed

Diff for: Cargo.lock

+20-11
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70"
573573

574574
[[package]]
575575
name = "clippy"
576-
version = "0.1.81"
576+
version = "0.1.82"
577577
dependencies = [
578578
"anstream",
579579
"clippy_config",
@@ -594,13 +594,13 @@ dependencies = [
594594
"termize",
595595
"tokio",
596596
"toml 0.7.8",
597-
"ui_test 0.23.0",
597+
"ui_test 0.24.0",
598598
"walkdir",
599599
]
600600

601601
[[package]]
602602
name = "clippy_config"
603-
version = "0.1.81"
603+
version = "0.1.82"
604604
dependencies = [
605605
"rustc-semver",
606606
"serde",
@@ -623,7 +623,7 @@ dependencies = [
623623

624624
[[package]]
625625
name = "clippy_lints"
626-
version = "0.1.81"
626+
version = "0.1.82"
627627
dependencies = [
628628
"arrayvec",
629629
"cargo_metadata 0.18.1",
@@ -648,7 +648,7 @@ dependencies = [
648648

649649
[[package]]
650650
name = "clippy_utils"
651-
version = "0.1.81"
651+
version = "0.1.82"
652652
dependencies = [
653653
"arrayvec",
654654
"clippy_config",
@@ -969,7 +969,7 @@ dependencies = [
969969

970970
[[package]]
971971
name = "declare_clippy_lint"
972-
version = "0.1.81"
972+
version = "0.1.82"
973973
dependencies = [
974974
"itertools",
975975
"quote",
@@ -2977,6 +2977,16 @@ dependencies = [
29772977
"pad",
29782978
]
29792979

2980+
[[package]]
2981+
name = "prettydiff"
2982+
version = "0.7.0"
2983+
source = "registry+https://github.com/rust-lang/crates.io-index"
2984+
checksum = "abec3fb083c10660b3854367697da94c674e9e82aa7511014dc958beeb7215e9"
2985+
dependencies = [
2986+
"owo-colors",
2987+
"pad",
2988+
]
2989+
29802990
[[package]]
29812991
name = "proc-macro-hack"
29822992
version = "0.5.20+deprecated"
@@ -5825,7 +5835,7 @@ dependencies = [
58255835
"indicatif",
58265836
"lazy_static",
58275837
"levenshtein",
5828-
"prettydiff",
5838+
"prettydiff 0.6.4",
58295839
"regex",
58305840
"rustc_version",
58315841
"rustfix 0.6.1",
@@ -5836,9 +5846,9 @@ dependencies = [
58365846

58375847
[[package]]
58385848
name = "ui_test"
5839-
version = "0.23.0"
5849+
version = "0.24.0"
58405850
source = "registry+https://github.com/rust-lang/crates.io-index"
5841-
checksum = "29e5f4ffcbab82453958fbf59990e981b8e8a177dcd60c2bd8f9b52c3036a6e1"
5851+
checksum = "bc1c6c78d55482388711c8d417b8e547263046a607512278fed274c54633bbe4"
58425852
dependencies = [
58435853
"annotate-snippets 0.11.4",
58445854
"anyhow",
@@ -5852,14 +5862,13 @@ dependencies = [
58525862
"indicatif",
58535863
"lazy_static",
58545864
"levenshtein",
5855-
"prettydiff",
5865+
"prettydiff 0.7.0",
58565866
"regex",
58575867
"rustc_version",
58585868
"rustfix 0.8.1",
58595869
"serde",
58605870
"serde_json",
58615871
"spanned",
5862-
"tempfile",
58635872
]
58645873

58655874
[[package]]

Diff for: src/tools/clippy/.cargo/config.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ uibless = "test --test compile-test -- -- --bless"
44
bless = "test -- -- --bless"
55
dev = "run --package clippy_dev --bin clippy_dev --manifest-path clippy_dev/Cargo.toml --"
66
lintcheck = "run --package lintcheck --bin lintcheck --manifest-path lintcheck/Cargo.toml -- "
7-
collect-metadata = "test --test dogfood --features internal -- run_metadata_collection_lint --ignored"
7+
collect-metadata = "test --test dogfood --features internal -- collect_metadata"
88

99
[build]
1010
# -Zbinary-dep-depinfo allows us to track which rlib files to use for compiling UI tests

Diff for: src/tools/clippy/.github/workflows/lintcheck.yml

+22-6
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,18 @@ jobs:
5353
id: cache-json
5454
uses: actions/cache@v4
5555
with:
56-
path: lintcheck-logs/lintcheck_crates_logs.json
56+
path: lintcheck-logs/ci_crates_logs.json
5757
key: ${{ steps.key.outputs.key }}
5858

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

6363
- name: Upload base JSON
6464
uses: actions/upload-artifact@v4
6565
with:
6666
name: base
67-
path: lintcheck-logs/lintcheck_crates_logs.json
67+
path: lintcheck-logs/ci_crates_logs.json
6868

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

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

9191
- name: Upload head JSON
9292
uses: actions/upload-artifact@v4
9393
with:
9494
name: head
95-
path: lintcheck-logs/lintcheck_crates_logs.json
95+
path: lintcheck-logs/ci_crates_logs.json
9696

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

117117
- name: Diff results
118-
run: ./target/debug/lintcheck diff {base,head}/lintcheck_crates_logs.json >> $GITHUB_STEP_SUMMARY
118+
# GH's summery has a maximum size of 1024k:
119+
# https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-markdown-summary
120+
# That's why we first log to file and then to the summary and logs
121+
run: |
122+
./target/debug/lintcheck diff {base,head}/ci_crates_logs.json --truncate >> truncated_diff.md
123+
head -c 1024000 truncated_diff.md >> $GITHUB_STEP_SUMMARY
124+
cat truncated_diff.md
125+
./target/debug/lintcheck diff {base,head}/ci_crates_logs.json >> full_diff.md
126+
127+
- name: Upload full diff
128+
uses: actions/upload-artifact@v4
129+
with:
130+
name: diff
131+
if-no-files-found: ignore
132+
path: |
133+
full_diff.md
134+
truncated_diff.md

Diff for: src/tools/clippy/CHANGELOG.md

+45-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,53 @@ document.
66

77
## Unreleased / Beta / In Rust Nightly
88

9-
[ca3b3937...master](https://github.com/rust-lang/rust-clippy/compare/ca3b3937...master)
9+
[c9139bd5...master](https://github.com/rust-lang/rust-clippy/compare/c9139bd5...master)
10+
11+
## Rust 1.80
12+
13+
Current stable, released 2024-07-25
14+
15+
[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)
16+
17+
### New Lints
18+
19+
* Added [`while_float`] to `nursery`
20+
[#12765](https://github.com/rust-lang/rust-clippy/pull/12765)
21+
* Added [`macro_metavars_in_unsafe`] to `suspicious`
22+
[#12107](https://github.com/rust-lang/rust-clippy/pull/12107)
23+
* Added [`renamed_function_params`] to `restriction`
24+
[#11540](https://github.com/rust-lang/rust-clippy/pull/11540)
25+
* Added [`doc_lazy_continuation`] to `style`
26+
[#12770](https://github.com/rust-lang/rust-clippy/pull/12770)
27+
28+
### Moves and Deprecations
29+
30+
* Moved [`assigning_clones`] to `pedantic` (From `perf` now allow-by-default)
31+
[#12779](https://github.com/rust-lang/rust-clippy/pull/12779)
32+
* Moved [`single_char_pattern`] to `pedantic` (From `perf` now allow-by-default)
33+
[#11852](https://github.com/rust-lang/rust-clippy/pull/11852)
34+
35+
### Enhancements
36+
37+
* [`panic`]: Added [`allow-panic-in-tests`] configuration to allow the lint in tests
38+
[#12803](https://github.com/rust-lang/rust-clippy/pull/12803)
39+
* [`missing_const_for_fn`]: Now respects the [`msrv`] configuration
40+
[#12713](https://github.com/rust-lang/rust-clippy/pull/12713)
41+
* [`missing_panics_doc`]: No longer lints on compile-time panics
42+
[#12790](https://github.com/rust-lang/rust-clippy/pull/12790)
43+
* [`collapsible_match`]: Now considers the [`msrv`] configuration for the suggestion
44+
[#12745](https://github.com/rust-lang/rust-clippy/pull/12745)
45+
* [`useless_vec`]: Added [`allow-useless-vec-in-tests`] configuration to allow the lint in tests
46+
[#12725](https://github.com/rust-lang/rust-clippy/pull/12725)
47+
48+
### Suggestion Fixes/Improvements
49+
50+
* [`single_match`], [`single_match_else`]: Suggestions are now machine-applicable
51+
[#12726](https://github.com/rust-lang/rust-clippy/pull/12726)
1052

1153
## Rust 1.79
1254

13-
Current stable, released 2024-06-13
55+
Released 2024-06-13
1456

1557
[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)
1658

@@ -5712,6 +5754,7 @@ Released 2018-09-13
57125754
[`partialeq_to_none`]: https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none
57135755
[`path_buf_push_overwrite`]: https://rust-lang.github.io/rust-clippy/master/index.html#path_buf_push_overwrite
57145756
[`path_ends_with_ext`]: https://rust-lang.github.io/rust-clippy/master/index.html#path_ends_with_ext
5757+
[`pathbuf_init_then_push`]: https://rust-lang.github.io/rust-clippy/master/index.html#pathbuf_init_then_push
57155758
[`pattern_type_mismatch`]: https://rust-lang.github.io/rust-clippy/master/index.html#pattern_type_mismatch
57165759
[`permissions_set_readonly_false`]: https://rust-lang.github.io/rust-clippy/master/index.html#permissions_set_readonly_false
57175760
[`positional_named_format_parameters`]: https://rust-lang.github.io/rust-clippy/master/index.html#positional_named_format_parameters

Diff for: src/tools/clippy/Cargo.toml

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "clippy"
3-
version = "0.1.81"
3+
version = "0.1.82"
44
description = "A bunch of helpful lints to avoid common pitfalls in Rust"
55
repository = "https://github.com/rust-lang/rust-clippy"
66
readme = "README.md"
@@ -30,11 +30,10 @@ color-print = "0.3.4"
3030
anstream = "0.6.0"
3131

3232
[dev-dependencies]
33-
ui_test = "0.23"
33+
ui_test = "0.24"
3434
regex = "1.5.5"
3535
toml = "0.7.3"
3636
walkdir = "2.3"
37-
# This is used by the `collect-metadata` alias.
3837
filetime = "0.2.9"
3938
itertools = "0.12"
4039

@@ -63,3 +62,7 @@ rustc_private = true
6362
[[test]]
6463
name = "compile-test"
6564
harness = false
65+
66+
[[test]]
67+
name = "dogfood"
68+
harness = false

Diff for: src/tools/clippy/book/src/development/adding_lints.md

+5-9
Original file line numberDiff line numberDiff line change
@@ -458,9 +458,8 @@ pub struct ManualStrip {
458458
}
459459

460460
impl ManualStrip {
461-
#[must_use]
462-
pub fn new(msrv: Msrv) -> Self {
463-
Self { msrv }
461+
pub fn new(conf: &'static Conf) -> Self {
462+
Self { msrv: conf.msrv.clone() }
464463
}
465464
}
466465
```
@@ -689,7 +688,6 @@ for some users. Adding a configuration is done in the following steps:
689688
]);
690689

691690
// New manual definition struct
692-
#[derive(Copy, Clone)]
693691
pub struct StructName {}
694692

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

708705
// ...
709706

710707
impl StructName {
711-
pub fn new(configuration_ident: Type) -> Self {
708+
pub fn new(conf: &'static Conf) -> Self {
712709
Self {
713-
configuration_ident,
710+
configuration_ident: conf.configuration_ident,
714711
}
715712
}
716713
}
@@ -726,8 +723,7 @@ for some users. Adding a configuration is done in the following steps:
726723
store.register_*_pass(|| box module::StructName);
727724

728725
// New registration with configuration value
729-
let configuration_ident = conf.configuration_ident.clone();
730-
store.register_*_pass(move || box module::StructName::new(configuration_ident));
726+
store.register_*_pass(move || box module::StructName::new(conf));
731727
```
732728

733729
Congratulations the work is almost done. The configuration value can now be

Diff for: src/tools/clippy/book/src/lint_configuration.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ default configuration of Clippy. By default, any configuration will replace the
455455
* `doc-valid-idents = ["ClipPy"]` would replace the default list with `["ClipPy"]`.
456456
* `doc-valid-idents = ["ClipPy", ".."]` would append `ClipPy` to the default list.
457457

458-
**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"]`
458+
**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"]`
459459

460460
---
461461
**Affected lints:**
@@ -679,6 +679,7 @@ The minimum rust version that the project supports. Defaults to the `rust-versio
679679
* [`cast_abs_to_unsigned`](https://rust-lang.github.io/rust-clippy/master/index.html#cast_abs_to_unsigned)
680680
* [`checked_conversions`](https://rust-lang.github.io/rust-clippy/master/index.html#checked_conversions)
681681
* [`cloned_instead_of_copied`](https://rust-lang.github.io/rust-clippy/master/index.html#cloned_instead_of_copied)
682+
* [`collapsible_match`](https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match)
682683
* [`collapsible_str_replace`](https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_str_replace)
683684
* [`deprecated_cfg_attr`](https://rust-lang.github.io/rust-clippy/master/index.html#deprecated_cfg_attr)
684685
* [`derivable_impls`](https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls)

Diff for: src/tools/clippy/clippy.toml

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ reason = "this function does not add a link to our documentation, please use the
88
path = "rustc_lint::context::LintContext::span_lint"
99
reason = "this function does not add a link to our documentation, please use the `clippy_utils::diagnostics::span_lint*` functions instead"
1010

11-
1211
[[disallowed-methods]]
1312
path = "rustc_middle::ty::context::TyCtxt::node_span_lint"
1413
reason = "this function does not add a link to our documentation, please use the `clippy_utils::diagnostics::span_lint_hir*` functions instead"

Diff for: src/tools/clippy/clippy_config/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "clippy_config"
3-
version = "0.1.81"
3+
version = "0.1.82"
44
edition = "2021"
55

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

0 commit comments

Comments
 (0)