Skip to content

Commit

Permalink
Auto merge of #128193 - flip1995:clippy-subtree-update, r=matthiaskrgr
Browse files Browse the repository at this point in the history
Clippy subtree update

r? `@Manishearth`

Updates Cargo.lock due to the Clippy version update and the ui_test bump to v0.24
  • Loading branch information
bors committed Jul 26, 2024
2 parents 72d73ce + 0949ff9 commit 48bbe12
Show file tree
Hide file tree
Showing 292 changed files with 4,866 additions and 5,172 deletions.
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 @@ -5825,7 +5835,7 @@ dependencies = [
"indicatif",
"lazy_static",
"levenshtein",
"prettydiff",
"prettydiff 0.6.4",
"regex",
"rustc_version",
"rustfix 0.6.1",
Expand All @@ -5836,9 +5846,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 @@ -5852,14 +5862,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

0 comments on commit 48bbe12

Please sign in to comment.