Skip to content

Commit e1e72db

Browse files
committed
Auto merge of rust-lang#155996 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update r? Manishearth
2 parents 77f1fca + 0a73f89 commit e1e72db

144 files changed

Lines changed: 2911 additions & 410 deletions

File tree

Some content is hidden

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

.github/workflows/clippy_mq.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ jobs:
135135
find $DIR ! -executable -o -type d ! -path $DIR | xargs rm -rf
136136
137137
- name: Upload Binaries
138-
uses: actions/upload-artifact@v4
138+
uses: actions/upload-artifact@v7
139139
with:
140140
name: binaries
141141
path: target/debug
@@ -179,7 +179,7 @@ jobs:
179179
180180
# Download
181181
- name: Download target dir
182-
uses: actions/download-artifact@v6
182+
uses: actions/download-artifact@v8
183183
with:
184184
name: binaries
185185
path: target/debug

.github/workflows/lintcheck.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
4545
- name: Cache lintcheck bin
4646
id: cache-lintcheck-bin
47-
uses: actions/cache@v4
47+
uses: actions/cache@v5
4848
with:
4949
path: target/debug/lintcheck
5050
key: lintcheck-bin-${{ hashfiles('lintcheck/**') }}
@@ -59,7 +59,7 @@ jobs:
5959

6060
- name: Cache results JSON
6161
id: cache-json
62-
uses: actions/cache@v4
62+
uses: actions/cache@v5
6363
with:
6464
path: lintcheck-logs/ci_crates_logs.json
6565
key: ${{ steps.key.outputs.key }}
@@ -69,7 +69,7 @@ jobs:
6969
run: env CLIPPY_CONF_DIR="$PWD/lintcheck/ci-config" ./target/debug/lintcheck --format json --all-lints --crates-toml ./lintcheck/ci_crates.toml
7070

7171
- name: Upload base JSON
72-
uses: actions/upload-artifact@v4
72+
uses: actions/upload-artifact@v7
7373
with:
7474
name: base
7575
path: lintcheck-logs/ci_crates_logs.json
@@ -87,7 +87,7 @@ jobs:
8787

8888
- name: Cache lintcheck bin
8989
id: cache-lintcheck-bin
90-
uses: actions/cache@v4
90+
uses: actions/cache@v5
9191
with:
9292
path: target/debug/lintcheck
9393
key: lintcheck-bin-${{ hashfiles('lintcheck/**') }}
@@ -100,7 +100,7 @@ jobs:
100100
run: env CLIPPY_CONF_DIR="$PWD/lintcheck/ci-config" ./target/debug/lintcheck --format json --all-lints --crates-toml ./lintcheck/ci_crates.toml
101101

102102
- name: Upload head JSON
103-
uses: actions/upload-artifact@v4
103+
uses: actions/upload-artifact@v7
104104
with:
105105
name: head
106106
path: lintcheck-logs/ci_crates_logs.json
@@ -119,14 +119,14 @@ jobs:
119119
persist-credentials: false
120120

121121
- name: Restore lintcheck bin
122-
uses: actions/cache/restore@v4
122+
uses: actions/cache/restore@v5
123123
with:
124124
path: target/debug/lintcheck
125125
key: lintcheck-bin-${{ hashfiles('lintcheck/**') }}
126126
fail-on-cache-miss: true
127127

128128
- name: Download JSON
129-
uses: actions/download-artifact@v5
129+
uses: actions/download-artifact@v8
130130

131131
- name: Store PR number
132132
run: echo ${{ github.event.pull_request.number }} > pr.txt
@@ -140,13 +140,13 @@ jobs:
140140
./target/debug/lintcheck diff {base,head}/ci_crates_logs.json --write-summary summary.json > full_diff.md
141141
142142
- name: Upload full diff
143-
uses: actions/upload-artifact@v4
143+
uses: actions/upload-artifact@v7
144144
with:
145145
name: full_diff
146146
path: full_diff.md
147147

148148
- name: Upload summary
149-
uses: actions/upload-artifact@v4
149+
uses: actions/upload-artifact@v7
150150
with:
151151
name: summary
152152
path: |

.github/workflows/lintcheck_summary.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ jobs:
2727
if: ${{ github.event.workflow_run.conclusion == 'success' }}
2828
steps:
2929
- name: Download artifact
30-
uses: actions/download-artifact@v5
30+
uses: actions/download-artifact@v8
3131
with:
3232
name: summary
3333
path: untrusted
3434
run-id: ${{ github.event.workflow_run.id }}
3535
github-token: ${{ github.token }}
3636

3737
- name: Format comment
38-
uses: actions/github-script@v8
38+
uses: actions/github-script@v9
3939
with:
4040
script: |
4141
const fs = require("fs");

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6804,6 +6804,7 @@ Released 2018-09-13
68046804
[`inline_asm_x86_att_syntax`]: https://rust-lang.github.io/rust-clippy/master/index.html#inline_asm_x86_att_syntax
68056805
[`inline_asm_x86_intel_syntax`]: https://rust-lang.github.io/rust-clippy/master/index.html#inline_asm_x86_intel_syntax
68066806
[`inline_fn_without_body`]: https://rust-lang.github.io/rust-clippy/master/index.html#inline_fn_without_body
6807+
[`inline_modules`]: https://rust-lang.github.io/rust-clippy/master/index.html#inline_modules
68076808
[`inspect_for_each`]: https://rust-lang.github.io/rust-clippy/master/index.html#inspect_for_each
68086809
[`int_plus_one`]: https://rust-lang.github.io/rust-clippy/master/index.html#int_plus_one
68096810
[`integer_arithmetic`]: https://rust-lang.github.io/rust-clippy/master/index.html#integer_arithmetic
@@ -6878,6 +6879,7 @@ Released 2018-09-13
68786879
[`main_recursion`]: https://rust-lang.github.io/rust-clippy/master/index.html#main_recursion
68796880
[`manual_abs_diff`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_abs_diff
68806881
[`manual_assert`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_assert
6882+
[`manual_assert_eq`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_assert_eq
68816883
[`manual_async_fn`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_async_fn
68826884
[`manual_bits`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_bits
68836885
[`manual_c_str_literals`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_c_str_literals
@@ -7393,6 +7395,7 @@ Released 2018-09-13
73937395
[`used_underscore_items`]: https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_items
73947396
[`useless_asref`]: https://rust-lang.github.io/rust-clippy/master/index.html#useless_asref
73957397
[`useless_attribute`]: https://rust-lang.github.io/rust-clippy/master/index.html#useless_attribute
7398+
[`useless_borrows_in_formatting`]: https://rust-lang.github.io/rust-clippy/master/index.html#useless_borrows_in_formatting
73967399
[`useless_concat`]: https://rust-lang.github.io/rust-clippy/master/index.html#useless_concat
73977400
[`useless_conversion`]: https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
73987401
[`useless_format`]: https://rust-lang.github.io/rust-clippy/master/index.html#useless_format

book/src/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ This also works with lint groups. For example, you can run Clippy with warnings
7979
cargo clippy -- -W clippy::pedantic
8080
```
8181

82-
If you care only about a certain lints, you can allow all others and then explicitly warn on the lints you are
82+
If you care only about certain lints, you can allow all others and then explicitly warn on the lints you are
8383
interested in:
8484

8585
```terminal

clippy_dev/src/new_lint.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ fn setup_mod_file(path: &Path, lint: &LintData<'_>) -> io::Result<&'static str>
502502
file_contents.replace_range(arr_start + 1..arr_end, &new_arr_content);
503503

504504
// Just add the mod declaration at the top, it'll be fixed by rustfmt
505-
file_contents.insert_str(0, &format!("mod {};\n", &lint.name));
505+
file_contents.insert_str(0, &format!("mod {};\n", lint.name));
506506

507507
let mut file = OpenOptions::new()
508508
.write(true)

clippy_lints/src/arbitrary_source_item_ordering.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -307,15 +307,15 @@ impl<'tcx> LateLintPass<'tcx> for ArbitrarySourceItemOrdering {
307307
}
308308
},
309309
ItemKind::Trait {
310-
impl_restriction:_,
311-
constness:_,
310+
impl_restriction: _,
311+
constness: _,
312312
is_auto,
313-
safety:_,
314-
ident:_,
313+
safety: _,
314+
ident: _,
315315
generics: _,
316316
bounds: _,
317-
items: item_ref}
318-
if self.enable_ordering_for_trait && *is_auto == IsAuto::No => {
317+
items: item_ref,
318+
} if self.enable_ordering_for_trait && *is_auto == IsAuto::No => {
319319
let mut cur_t: Option<(TraitItemId, Ident)> = None;
320320

321321
for &item in *item_ref {

clippy_lints/src/bool_assert_comparison.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@ use clippy_utils::source::walk_span_to_context;
44
use clippy_utils::sugg::Sugg;
55
use clippy_utils::sym;
66
use clippy_utils::ty::{implements_trait, is_copy};
7-
use rustc_middle::ty::Unnormalized;
87
use rustc_ast::ast::LitKind;
98
use rustc_errors::Applicability;
109
use rustc_hir::{Expr, ExprKind, Lit};
1110
use rustc_lint::{LateContext, LateLintPass, LintContext};
12-
use rustc_middle::ty::{self, Ty};
11+
use rustc_middle::ty::{self, Ty, Unnormalized};
1312
use rustc_session::declare_lint_pass;
1413
use rustc_span::symbol::Ident;
1514

@@ -65,7 +64,9 @@ fn is_impl_not_trait_with_bool_out<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -
6564
})
6665
.is_some_and(|assoc_item| {
6766
let proj = Ty::new_projection(cx.tcx, assoc_item.def_id, cx.tcx.mk_args_trait(ty, []));
68-
let nty = cx.tcx.normalize_erasing_regions(cx.typing_env(), Unnormalized::new_wip(proj));
67+
let nty = cx
68+
.tcx
69+
.normalize_erasing_regions(cx.typing_env(), Unnormalized::new_wip(proj));
6970

7071
nty.is_bool()
7172
})

clippy_lints/src/booleans.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ impl SuggestContext<'_, '_, '_> {
360360
if app != Applicability::MachineApplicable {
361361
return None;
362362
}
363-
let _cannot_fail = write!(&mut self.output, "{}", &(!snip));
363+
let _cannot_fail = write!(&mut self.output, "{}", !snip);
364364
}
365365
},
366366
True | False | Not(_) => {

clippy_lints/src/casts/cast_ptr_alignment.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,12 @@ fn is_used_as_unaligned(cx: &LateContext<'_>, e: &Expr<'_>) -> bool {
5959
if matches!(name.ident.name, sym::read_unaligned | sym::write_unaligned)
6060
&& let Some(def_id) = cx.typeck_results().type_dependent_def_id(parent.hir_id)
6161
&& let Some(def_id) = cx.tcx.impl_of_assoc(def_id)
62-
&& cx.tcx.type_of(def_id).instantiate_identity().skip_norm_wip().is_raw_ptr()
62+
&& cx
63+
.tcx
64+
.type_of(def_id)
65+
.instantiate_identity()
66+
.skip_norm_wip()
67+
.is_raw_ptr()
6368
{
6469
true
6570
} else {

0 commit comments

Comments
 (0)