Skip to content

Commit 1f26d8c

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents e1718e0 + c490974 commit 1f26d8c

File tree

921 files changed

+5035
-2031
lines changed

Some content is hidden

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

921 files changed

+5035
-2031
lines changed

.github/workflows/clippy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
github_token: "${{ secrets.github_token }}"
4040

4141
- name: Checkout
42-
uses: actions/checkout@v3.0.2
42+
uses: actions/checkout@v3
4343

4444
- name: Install toolchain
4545
run: rustup show active-toolchain

.github/workflows/clippy_bors.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
github_token: "${{ secrets.github_token }}"
2828

2929
- name: Checkout
30-
uses: actions/checkout@v3.0.2
30+
uses: actions/checkout@v3
3131
with:
3232
ref: ${{ github.ref }}
3333

@@ -83,7 +83,7 @@ jobs:
8383
github_token: "${{ secrets.github_token }}"
8484

8585
- name: Checkout
86-
uses: actions/checkout@v3.0.2
86+
uses: actions/checkout@v3
8787

8888
- name: Install toolchain
8989
run: rustup show active-toolchain
@@ -149,7 +149,7 @@ jobs:
149149
github_token: "${{ secrets.github_token }}"
150150

151151
- name: Checkout
152-
uses: actions/checkout@v3.0.2
152+
uses: actions/checkout@v3
153153

154154
- name: Install toolchain
155155
run: rustup show active-toolchain
@@ -173,7 +173,7 @@ jobs:
173173
github_token: "${{ secrets.github_token }}"
174174

175175
- name: Checkout
176-
uses: actions/checkout@v3.0.2
176+
uses: actions/checkout@v3
177177

178178
- name: Install toolchain
179179
run: rustup show active-toolchain
@@ -233,7 +233,7 @@ jobs:
233233
github_token: "${{ secrets.github_token }}"
234234

235235
- name: Checkout
236-
uses: actions/checkout@v3.0.2
236+
uses: actions/checkout@v3
237237

238238
- name: Install toolchain
239239
run: rustup show active-toolchain

.github/workflows/clippy_dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
steps:
2626
# Setup
2727
- name: Checkout
28-
uses: actions/checkout@v3.0.2
28+
uses: actions/checkout@v3
2929

3030
# Run
3131
- name: Build

.github/workflows/deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ jobs:
2121
steps:
2222
# Setup
2323
- name: Checkout
24-
uses: actions/checkout@v3.0.2
24+
uses: actions/checkout@v3
2525

2626
- name: Checkout
27-
uses: actions/checkout@v3.0.2
27+
uses: actions/checkout@v3
2828
with:
2929
ref: ${{ env.TARGET_BRANCH }}
3030
path: 'out'

.github/workflows/remark.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ jobs:
1616
steps:
1717
# Setup
1818
- name: Checkout
19-
uses: actions/checkout@v3.0.2
19+
uses: actions/checkout@v3
2020

2121
- name: Setup Node.js
22-
uses: actions/setup-node@v1.4.4
22+
uses: actions/setup-node@v3
2323
with:
2424
node-version: '14.x'
2525

@@ -36,6 +36,12 @@ jobs:
3636
- name: Check *.md files
3737
run: git ls-files -z '*.md' | xargs -0 -n 1 -I {} ./node_modules/.bin/remark {} -u lint -f > /dev/null
3838

39+
- name: Linkcheck book
40+
run: |
41+
rustup toolchain install nightly --component rust-docs
42+
curl https://raw.githubusercontent.com/rust-lang/rust/master/src/tools/linkchecker/linkcheck.sh -o linkcheck.sh
43+
sh linkcheck.sh clippy --path ./book
44+
3945
- name: Build mdbook
4046
run: mdbook build book
4147

CHANGELOG.md

Lines changed: 124 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,126 @@ document.
66

77
## Unreleased / Beta / In Rust Nightly
88

9-
[7f27e2e7...master](https://github.com/rust-lang/rust-clippy/compare/7f27e2e7...master)
9+
[149392b0...master](https://github.com/rust-lang/rust-clippy/compare/149392b0...master)
10+
11+
## Rust 1.69
12+
13+
Current stable, released 2023-04-20
14+
15+
[7f27e2e7...149392b0](https://github.com/rust-lang/rust-clippy/compare/7f27e2e7...149392b0)
16+
17+
### New Lints
18+
19+
* [`no_mangle_with_rust_abi`]
20+
[#10369](https://github.com/rust-lang/rust-clippy/pull/10369)
21+
* [`significant_drop_tightening`]
22+
[#10163](https://github.com/rust-lang/rust-clippy/pull/10163)
23+
* [`suspicious_command_arg_space`]
24+
[#10317](https://github.com/rust-lang/rust-clippy/pull/10317)
25+
* [`let_underscore_untyped`]
26+
[#10356](https://github.com/rust-lang/rust-clippy/pull/10356)
27+
* [`question_mark_used`]
28+
[#10342](https://github.com/rust-lang/rust-clippy/pull/10342)
29+
* [`extra_unused_type_parameters`]
30+
[#10028](https://github.com/rust-lang/rust-clippy/pull/10028)
31+
* [`impl_trait_in_params`]
32+
[10197](https://github.com/rust-lang/rust-clippy/pull/10197)
33+
* [`transmute_int_to_non_zero`]
34+
[#10360](https://github.com/rust-lang/rust-clippy/pull/10360)
35+
* [`multiple_unsafe_ops_per_block`]
36+
[#10206](https://github.com/rust-lang/rust-clippy/pull/10206)
37+
38+
### Moves and Deprecations
39+
40+
* Moved [`uninlined_format_args`] to `pedantic` (Now allow-by-default)
41+
[#10265](https://github.com/rust-lang/rust-clippy/pull/10265)
42+
* Moved [`unchecked_duration_subtraction`] to `pedantic` (Now allow-by-default)
43+
[#10194](https://github.com/rust-lang/rust-clippy/pull/10194)
44+
45+
### Enhancements
46+
47+
* [`arithmetic_side_effects`]: No longer lints if safe constant values are used.
48+
[#10310](https://github.com/rust-lang/rust-clippy/pull/10310)
49+
* [`needless_lifetimes`]: Now works in local macros
50+
[#10257](https://github.com/rust-lang/rust-clippy/pull/10257)
51+
* [`unused_io_amount`]: Now detects usages of `is_ok` and `is_err`
52+
[#10225](https://github.com/rust-lang/rust-clippy/pull/10225)
53+
* [`missing_docs_in_private_items`]: Added new configuration `missing-docs-in-crate-items` to lint
54+
on items visible within the current crate. For example, `pub(crate)` items.
55+
[#10303](https://github.com/rust-lang/rust-clippy/pull/10303)
56+
* [`almost_swapped`]: Now detects almost swaps using `let` statements
57+
[#10177](https://github.com/rust-lang/rust-clippy/pull/10177)
58+
* [`wildcard_enum_match_arm`]: Now lints missing private variants, for local enums
59+
[#10250](https://github.com/rust-lang/rust-clippy/pull/10250)
60+
61+
### False Positive Fixes
62+
63+
* [`explicit_auto_deref`]: Now considers projections when determining if auto deref is applicable
64+
[#10386](https://github.com/rust-lang/rust-clippy/pull/10386)
65+
* [`manual_let_else`]: Now considers side effects of branches before linting
66+
[#10336](https://github.com/rust-lang/rust-clippy/pull/10336)
67+
* [`uninlined_format_args`]: No longer lints for arguments with generic parameters
68+
[#10343](https://github.com/rust-lang/rust-clippy/pull/10343)
69+
* [`needless_lifetimes`]: No longer lints signatures in macros if the lifetime is a metavariable
70+
[#10380](https://github.com/rust-lang/rust-clippy/pull/10380)
71+
* [`len_without_is_empty`]: No longer lints if `len` as a non-default signature
72+
[#10255](https://github.com/rust-lang/rust-clippy/pull/10255)
73+
* [`unusual_byte_groupings`]: Relaxed the required restrictions for specific sizes to reduce false
74+
positives
75+
[#10353](https://github.com/rust-lang/rust-clippy/pull/10353)
76+
* [`manual_let_else`]: No longer lints `if-else` blocks if they can divergent
77+
[#10332](https://github.com/rust-lang/rust-clippy/pull/10332)
78+
* [`expect_used`], [`unwrap_used`], [`dbg_macro`], [`print_stdout`], [`print_stderr`]: No longer lint
79+
in test functions if `allow-expect-in-tests` is set
80+
[#10391](https://github.com/rust-lang/rust-clippy/pull/10391)
81+
* [`unnecessary_safety_comment`]: No longer lints code inside macros
82+
[#10106](https://github.com/rust-lang/rust-clippy/pull/10106)
83+
* [`never_loop`]: No longer lints statements following break statements for outer blocks.
84+
[#10311](https://github.com/rust-lang/rust-clippy/pull/10311)
85+
86+
### Suggestion Fixes/Improvements
87+
88+
* [`box_default`]: The suggestion now includes the type for trait objects when needed
89+
[#10382](https://github.com/rust-lang/rust-clippy/pull/10382)
90+
* [`cast_possible_truncation`]: Now suggests using `try_from` or allowing the lint
91+
[#10038](https://github.com/rust-lang/rust-clippy/pull/10038)
92+
* [`invalid_regex`]: Regex errors for non-literals or regular strings containing escape sequences will
93+
now show the complete error
94+
[#10231](https://github.com/rust-lang/rust-clippy/pull/10231)
95+
* [`transmutes_expressible_as_ptr_casts`]: The suggestion now works if the base type is borrowed
96+
[#10193](https://github.com/rust-lang/rust-clippy/pull/10193)
97+
* [`needless_return`]: Now removes all semicolons on the same line
98+
[#10187](https://github.com/rust-lang/rust-clippy/pull/10187)
99+
* [`suspicious_to_owned`]: The suggestion now shows all options clearly
100+
[#10295](https://github.com/rust-lang/rust-clippy/pull/10295)
101+
* [`bytes_nth`]: Now suggests the correct replacement based on the context
102+
[#10361](https://github.com/rust-lang/rust-clippy/pull/10361)
103+
* [`bool_assert_comparison`]: The suggestion is now machine applicable
104+
[#10218](https://github.com/rust-lang/rust-clippy/pull/10218)
105+
* [`cast_possible_truncation`]: Corrected the lint name in the help message
106+
[#10330](https://github.com/rust-lang/rust-clippy/pull/10330)
107+
* [`needless_return`]: The suggestion now works on if sequences
108+
[#10345](https://github.com/rust-lang/rust-clippy/pull/10345)
109+
* [`needless_lifetimes`]: The suggestion is now machine applicable
110+
[#10222](https://github.com/rust-lang/rust-clippy/pull/10222)
111+
* [`map_entry`]: The suggestion no longer expands macros
112+
[#10346](https://github.com/rust-lang/rust-clippy/pull/10346)
113+
114+
### ICE Fixes
115+
116+
* [`needless_pass_by_value`]: Fixed an ICE caused by how late bounds were handled
117+
[#10328](https://github.com/rust-lang/rust-clippy/pull/10328)
118+
* [`needless_borrow`]: No longer panics on ambiguous projections
119+
[#10403](https://github.com/rust-lang/rust-clippy/pull/10403)
120+
121+
### Documentation Improvements
122+
123+
* All configurations are now documented in the Clippy Book
124+
[#10199](https://github.com/rust-lang/rust-clippy/pull/10199)
10125

11126
## Rust 1.68
12127

13-
Current stable, released 2023-03-09
128+
Released 2023-03-09
14129

15130
[d822110d...7f27e2e7](https://github.com/rust-lang/rust-clippy/compare/d822110d...7f27e2e7)
16131

@@ -4467,6 +4582,7 @@ Released 2018-09-13
44674582
[`debug_assert_with_mut_call`]: https://rust-lang.github.io/rust-clippy/master/index.html#debug_assert_with_mut_call
44684583
[`decimal_literal_representation`]: https://rust-lang.github.io/rust-clippy/master/index.html#decimal_literal_representation
44694584
[`declare_interior_mutable_const`]: https://rust-lang.github.io/rust-clippy/master/index.html#declare_interior_mutable_const
4585+
[`default_constructed_unit_structs`]: https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs
44704586
[`default_instead_of_iter_empty`]: https://rust-lang.github.io/rust-clippy/master/index.html#default_instead_of_iter_empty
44714587
[`default_numeric_fallback`]: https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
44724588
[`default_trait_access`]: https://rust-lang.github.io/rust-clippy/master/index.html#default_trait_access
@@ -4504,6 +4620,7 @@ Released 2018-09-13
45044620
[`else_if_without_else`]: https://rust-lang.github.io/rust-clippy/master/index.html#else_if_without_else
45054621
[`empty_drop`]: https://rust-lang.github.io/rust-clippy/master/index.html#empty_drop
45064622
[`empty_enum`]: https://rust-lang.github.io/rust-clippy/master/index.html#empty_enum
4623+
[`empty_line_after_doc_comments`]: https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments
45074624
[`empty_line_after_outer_attr`]: https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_outer_attr
45084625
[`empty_loop`]: https://rust-lang.github.io/rust-clippy/master/index.html#empty_loop
45094626
[`empty_structs_with_brackets`]: https://rust-lang.github.io/rust-clippy/master/index.html#empty_structs_with_brackets
@@ -4615,6 +4732,7 @@ Released 2018-09-13
46154732
[`invisible_characters`]: https://rust-lang.github.io/rust-clippy/master/index.html#invisible_characters
46164733
[`is_digit_ascii_radix`]: https://rust-lang.github.io/rust-clippy/master/index.html#is_digit_ascii_radix
46174734
[`items_after_statements`]: https://rust-lang.github.io/rust-clippy/master/index.html#items_after_statements
4735+
[`items_after_test_module`]: https://rust-lang.github.io/rust-clippy/master/index.html#items_after_test_module
46184736
[`iter_cloned_collect`]: https://rust-lang.github.io/rust-clippy/master/index.html#iter_cloned_collect
46194737
[`iter_count`]: https://rust-lang.github.io/rust-clippy/master/index.html#iter_count
46204738
[`iter_kv_map`]: https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map
@@ -4668,6 +4786,7 @@ Released 2018-09-13
46684786
[`manual_main_separator_str`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_main_separator_str
46694787
[`manual_map`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_map
46704788
[`manual_memcpy`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_memcpy
4789+
[`manual_next_back`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_next_back
46714790
[`manual_non_exhaustive`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_non_exhaustive
46724791
[`manual_ok_or`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_ok_or
46734792
[`manual_range_contains`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains
@@ -4681,6 +4800,7 @@ Released 2018-09-13
46814800
[`manual_strip`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip
46824801
[`manual_swap`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_swap
46834802
[`manual_unwrap_or`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or
4803+
[`manual_while_let_some`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_while_let_some
46844804
[`many_single_char_names`]: https://rust-lang.github.io/rust-clippy/master/index.html#many_single_char_names
46854805
[`map_clone`]: https://rust-lang.github.io/rust-clippy/master/index.html#map_clone
46864806
[`map_collect_result_unit`]: https://rust-lang.github.io/rust-clippy/master/index.html#map_collect_result_unit
@@ -4748,6 +4868,7 @@ Released 2018-09-13
47484868
[`needless_arbitrary_self_type`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_arbitrary_self_type
47494869
[`needless_bitwise_bool`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_bitwise_bool
47504870
[`needless_bool`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool
4871+
[`needless_bool_assign`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool_assign
47514872
[`needless_borrow`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
47524873
[`needless_borrowed_reference`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference
47534874
[`needless_collect`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_collect
@@ -4860,6 +4981,7 @@ Released 2018-09-13
48604981
[`ref_binding_to_reference`]: https://rust-lang.github.io/rust-clippy/master/index.html#ref_binding_to_reference
48614982
[`ref_in_deref`]: https://rust-lang.github.io/rust-clippy/master/index.html#ref_in_deref
48624983
[`ref_option_ref`]: https://rust-lang.github.io/rust-clippy/master/index.html#ref_option_ref
4984+
[`ref_patterns`]: https://rust-lang.github.io/rust-clippy/master/index.html#ref_patterns
48634985
[`regex_macro`]: https://rust-lang.github.io/rust-clippy/master/index.html#regex_macro
48644986
[`repeat_once`]: https://rust-lang.github.io/rust-clippy/master/index.html#repeat_once
48654987
[`replace_consts`]: https://rust-lang.github.io/rust-clippy/master/index.html#replace_consts

Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "clippy"
3-
version = "0.1.70"
3+
version = "0.1.71"
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"
@@ -22,13 +22,12 @@ path = "src/driver.rs"
2222

2323
[dependencies]
2424
clippy_lints = { path = "clippy_lints" }
25-
semver = "1.0"
2625
rustc_tools_util = "0.3.0"
2726
tempfile = { version = "3.2", optional = true }
2827
termize = "0.1"
2928

3029
[dev-dependencies]
31-
compiletest_rs = { version = "0.9", features = ["tmp"] }
30+
compiletest_rs = { version = "0.10", features = ["tmp"] }
3231
tester = "0.9"
3332
regex = "1.5"
3433
toml = "0.5"

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ cargo clippy
9191

9292
#### Automatically applying Clippy suggestions
9393

94-
Clippy can automatically apply some lint suggestions, just like the compiler.
94+
Clippy can automatically apply some lint suggestions, just like the compiler. Note that `--fix` implies
95+
`--all-targets`, so it can fix as much code as it can.
9596

9697
```terminal
9798
cargo clippy --fix
@@ -277,7 +278,7 @@ If you want to contribute to Clippy, you can find more information in [CONTRIBUT
277278

278279
<!-- REUSE-IgnoreStart -->
279280

280-
Copyright 2014-2022 The Rust Project Developers
281+
Copyright 2014-2023 The Rust Project Developers
281282

282283
Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
283284
[https://www.apache.org/licenses/LICENSE-2.0](https://www.apache.org/licenses/LICENSE-2.0)> or the MIT license

book/src/development/adding_lints.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ The process of generating the `.stderr` file is the same, and prepending the
164164
## Rustfix tests
165165

166166
If the lint you are working on is making use of structured suggestions, the test
167-
file should include a `// run-rustfix` comment at the top. This will
167+
file should include a `//@run-rustfix` comment at the top. This will
168168
additionally run [rustfix] for that test. Rustfix will apply the suggestions
169169
from the lint to the code of the test file and compare that to the contents of a
170170
`.fixed` file.

book/src/development/lint_passes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ questions already, but the parser is okay with it. This is what we
5050
mean when we say `EarlyLintPass` deals with only syntax on the AST level.
5151

5252
Alternatively, think of the `foo_functions` lint we mentioned in
53-
[define new lints](define_lints.md#name-the-lint) chapter.
53+
define new lints <!-- FIXME: add link --> chapter.
5454

5555
We want the `foo_functions` lint to detect functions with `foo` as their name.
5656
Writing a lint that only checks for the name of a function means that we only

book/src/development/proposals/syntax-tree-patterns.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ whether the pattern matched.
139139
140140
## Pattern syntax
141141

142-
The following examples demonstate the pattern syntax:
142+
The following examples demonstrate the pattern syntax:
143143

144144

145145
#### Any (`_`)

0 commit comments

Comments
 (0)