Skip to content

Commit 81af346

Browse files
committed
Merge commit '928e72dd10749875cbd412f74bfbfd7765dbcd8a' into clippyup
2 parents 63bacf1 + 928e72d commit 81af346

File tree

113 files changed

+6454
-3273
lines changed

Some content is hidden

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

113 files changed

+6454
-3273
lines changed

src/tools/clippy/.github/ISSUE_TEMPLATE/bug_report.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: Bug Report
33
about: Create a bug report for Clippy
4-
labels: L-bug
4+
labels: C-bug
55
---
66
<!--
77
Thank you for filing a bug report! 🐛 Please provide a short summary of the bug,

src/tools/clippy/.github/ISSUE_TEMPLATE/false_negative.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: Bug Report (False Negative)
33
about: Create a bug report about missing warnings from a lint
4-
labels: L-bug, L-false-negative
4+
labels: C-bug, I-false-negative
55
---
66
<!--
77
Thank you for filing a bug report! 🐛 Please provide a short summary of the bug,

src/tools/clippy/.github/ISSUE_TEMPLATE/false_positive.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: Bug Report (False Positive)
33
about: Create a bug report about a wrongly emitted lint warning
4-
labels: L-bug, L-false-positive
4+
labels: C-bug, I-false-positive
55
---
66
<!--
77
Thank you for filing a bug report! 🐛 Please provide a short summary of the bug,

src/tools/clippy/.github/ISSUE_TEMPLATE/ice.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: Internal Compiler Error
33
about: Create a report for an internal compiler error in Clippy.
4-
labels: L-bug, L-crash
4+
labels: C-bug, I-ICE
55
---
66
<!--
77
Thank you for finding an Internal Compiler Error! 🧊 If possible, try to provide

src/tools/clippy/.github/ISSUE_TEMPLATE/new_lint.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: New lint suggestion
33
about: Suggest a new Clippy lint.
4-
labels: L-lint
4+
labels: A-lint
55
---
66

77
### What it does

src/tools/clippy/.github/workflows/clippy.yml

+2-10
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,8 @@ jobs:
5353
- name: Test "--fix -Zunstable-options"
5454
run: cargo run --features deny-warnings,internal-lints --bin cargo-clippy -- clippy --fix -Zunstable-options
5555

56-
- name: Test
57-
run: cargo test --features deny-warnings,internal-lints
58-
59-
- name: Test clippy_lints
60-
run: cargo test --features deny-warnings,internal-lints
61-
working-directory: clippy_lints
62-
63-
- name: Test rustc_tools_util
64-
run: cargo test --features deny-warnings
65-
working-directory: rustc_tools_util
56+
- name: Test Workspace
57+
run: cargo test --all --features deny-warnings,internal-lints
6658

6759
- name: Test clippy_dev
6860
run: cargo test --features deny-warnings

src/tools/clippy/.github/workflows/clippy_bors.yml

+2-10
Original file line numberDiff line numberDiff line change
@@ -112,16 +112,8 @@ jobs:
112112
- name: Build
113113
run: cargo build --features deny-warnings,internal-lints
114114

115-
- name: Test
116-
run: cargo test --features deny-warnings,internal-lints
117-
118-
- name: Test clippy_lints
119-
run: cargo test --features deny-warnings,internal-lints
120-
working-directory: clippy_lints
121-
122-
- name: Test rustc_tools_util
123-
run: cargo test --features deny-warnings
124-
working-directory: rustc_tools_util
115+
- name: Test Workspace
116+
run: cargo test --all --features deny-warnings,internal-lints
125117

126118
- name: Test clippy_dev
127119
run: cargo test --features deny-warnings

src/tools/clippy/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ out
1818
*Cargo.lock
1919
/target
2020
/clippy_lints/target
21+
/clippy_utils/target
2122
/clippy_workspace_tests/target
2223
/clippy_dev/target
2324
/rustc_tools_util/target

src/tools/clippy/CHANGELOG.md

+125-4
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,128 @@ document.
66

77
## Unreleased / In Rust Nightly
88

9-
[4911ab1...master](https://github.com/rust-lang/rust-clippy/compare/4911ab1...master)
9+
[3e41797...master](https://github.com/rust-lang/rust-clippy/compare/3e41797...master)
10+
11+
## Rust 1.51
12+
13+
Current beta, release 2021-03-25
14+
15+
[4911ab1...3e41797](https://github.com/rust-lang/rust-clippy/compare/4911ab1...3e41797)
16+
17+
### New Lints
18+
19+
* [`upper_case_acronyms`]
20+
[#6475](https://github.com/rust-lang/rust-clippy/pull/6475)
21+
* [`from_over_into`] [#6476](https://github.com/rust-lang/rust-clippy/pull/6476)
22+
* [`case_sensitive_file_extension_comparisons`]
23+
[#6500](https://github.com/rust-lang/rust-clippy/pull/6500)
24+
* [`needless_question_mark`]
25+
[#6507](https://github.com/rust-lang/rust-clippy/pull/6507)
26+
* [`missing_panics_doc`]
27+
[#6523](https://github.com/rust-lang/rust-clippy/pull/6523)
28+
* [`redundant_slicing`]
29+
[#6528](https://github.com/rust-lang/rust-clippy/pull/6528)
30+
* [`vec_init_then_push`]
31+
[#6538](https://github.com/rust-lang/rust-clippy/pull/6538)
32+
* [`ptr_as_ptr`] [#6542](https://github.com/rust-lang/rust-clippy/pull/6542)
33+
* [`collapsible_else_if`] (split out from `collapsible_if`)
34+
[#6544](https://github.com/rust-lang/rust-clippy/pull/6544)
35+
* [`inspect_for_each`] [#6577](https://github.com/rust-lang/rust-clippy/pull/6577)
36+
* [`manual_filter_map`]
37+
[#6591](https://github.com/rust-lang/rust-clippy/pull/6591)
38+
* [`exhaustive_enums`]
39+
[#6617](https://github.com/rust-lang/rust-clippy/pull/6617)
40+
* [`exhaustive_structs`]
41+
[#6617](https://github.com/rust-lang/rust-clippy/pull/6617)
42+
43+
### Moves and Deprecations
44+
45+
* Replace [`find_map`] with [`manual_find_map`]
46+
[#6591](https://github.com/rust-lang/rust-clippy/pull/6591)
47+
* [`unknown_clippy_lints`] Now integrated in the `unknown_lints` rustc lint
48+
[#6653](https://github.com/rust-lang/rust-clippy/pull/6653)
49+
50+
### Enhancements
51+
52+
* [`ptr_arg`] Now also suggests to use `&Path` instead of `&PathBuf`
53+
[#6506](https://github.com/rust-lang/rust-clippy/pull/6506)
54+
* [`cast_ptr_alignment`] Also lint when the `pointer::cast` method is used
55+
[#6557](https://github.com/rust-lang/rust-clippy/pull/6557)
56+
* [`collapsible_match`] Now also deals with `&` and `*` operators in the `match`
57+
scrutinee [#6619](https://github.com/rust-lang/rust-clippy/pull/6619)
58+
59+
### False Positive Fixes
60+
61+
* [`similar_names`] Ignore underscore prefixed names
62+
[#6403](https://github.com/rust-lang/rust-clippy/pull/6403)
63+
* [`print_literal`] and [`write_literal`] No longer lint numeric literals
64+
[#6408](https://github.com/rust-lang/rust-clippy/pull/6408)
65+
* [`large_enum_variant`] No longer lints in external macros
66+
[#6485](https://github.com/rust-lang/rust-clippy/pull/6485)
67+
* [`empty_enum`] Only lint if `never_type` feature is enabled
68+
[#6513](https://github.com/rust-lang/rust-clippy/pull/6513)
69+
* [`field_reassign_with_default`] No longer lints in macros
70+
[#6553](https://github.com/rust-lang/rust-clippy/pull/6553)
71+
* [`size_of_in_element_count`] No longer lints when dividing by element size
72+
[#6578](https://github.com/rust-lang/rust-clippy/pull/6578)
73+
* [`needless_return`] No longer lints in macros
74+
[#6586](https://github.com/rust-lang/rust-clippy/pull/6586)
75+
* [`match_overlapping_arm`] No longer lint when first arm is completely included
76+
in second arm [#6603](https://github.com/rust-lang/rust-clippy/pull/6603)
77+
* [`doc_markdown`] Add `WebGL` to the default configuration as an allowed
78+
identifier [#6605](https://github.com/rust-lang/rust-clippy/pull/6605)
79+
80+
### Suggestion Fixes/Improvements
81+
82+
* [`field_reassign_with_default`] Don't expand macro in lint suggestion
83+
[#6531](https://github.com/rust-lang/rust-clippy/pull/6531)
84+
* [`match_like_matches_macro`] Strip references in suggestion
85+
[#6532](https://github.com/rust-lang/rust-clippy/pull/6532)
86+
* [`single_match`] Suggest `if` over `if let` when possible
87+
[#6574](https://github.com/rust-lang/rust-clippy/pull/6574)
88+
* [`ref_in_deref`] Use parentheses correctly in suggestion
89+
[#6609](https://github.com/rust-lang/rust-clippy/pull/6609)
90+
* [`stable_sort_primitive`] Clarify error message
91+
[#6611](https://github.com/rust-lang/rust-clippy/pull/6611)
92+
93+
### ICE Fixes
94+
95+
* [`zero_sized_map_values`]
96+
[#6582](https://github.com/rust-lang/rust-clippy/pull/6582)
97+
98+
### Documentation Improvements
99+
100+
* Improve search performance on the Clippy website and make it possible to
101+
directly search for lints on the GitHub issue tracker
102+
[#6483](https://github.com/rust-lang/rust-clippy/pull/6483)
103+
* Clean up `README.md` by removing outdated paragraph
104+
[#6488](https://github.com/rust-lang/rust-clippy/pull/6488)
105+
* [`await_holding_refcell_ref`] and [`await_holding_lock`]
106+
[#6585](https://github.com/rust-lang/rust-clippy/pull/6585)
107+
* [`as_conversions`] [#6608](https://github.com/rust-lang/rust-clippy/pull/6608)
108+
109+
### Others
110+
111+
* Clippy now has a [Roadmap] for 2021. If you like to get involved in a bigger
112+
project, take a look at the [Roadmap project page]. All issues listed there
113+
are actively mentored
114+
[#6462](https://github.com/rust-lang/rust-clippy/pull/6462)
115+
* The Clippy version number now corresponds to the Rust version number
116+
[#6526](https://github.com/rust-lang/rust-clippy/pull/6526)
117+
* Fix oversight which caused Clippy to lint deps in some environments, where
118+
`CLIPPY_TESTS=true` was set somewhere
119+
[#6575](https://github.com/rust-lang/rust-clippy/pull/6575)
120+
* Add `cargo dev-lintcheck` tool to the Clippy Dev Tool
121+
[#6469](https://github.com/rust-lang/rust-clippy/pull/6469)
122+
123+
[Roadmap]: https://github.com/rust-lang/rust-clippy/blob/master/doc/roadmap-2021.md
124+
[Roadmap project page]: https://github.com/rust-lang/rust-clippy/projects/3
10125

11126
## Rust 1.50
12127

13-
Current beta, release 2021-02-11
128+
Current stable, released 2021-02-11
14129

15-
[b20d4c1...4911ab1](https://github.com/rust-lang/rust-clippy/compare/b20d4c1...4911ab1)
130+
[b20d4c1...4bd77a1](https://github.com/rust-lang/rust-clippy/compare/b20d4c1...4bd77a1)
16131

17132
### New Lints
18133

@@ -90,6 +205,8 @@ Current beta, release 2021-02-11
90205
* [`declare_interior_mutable_const`] and [`borrow_interior_mutable_const`]:
91206
Both now ignore enums with frozen variants
92207
[#6110](https://github.com/rust-lang/rust-clippy/pull/6110)
208+
* [`field_reassign_with_default`] No longer lint for private fields
209+
[#6537](https://github.com/rust-lang/rust-clippy/pull/6537)
93210

94211

95212
### Suggestion Fixes/Improvements
@@ -137,7 +254,7 @@ Current beta, release 2021-02-11
137254

138255
## Rust 1.49
139256

140-
Current stable, released 2020-12-31
257+
Released 2020-12-31
141258

142259
[e636b88...b20d4c1](https://github.com/rust-lang/rust-clippy/compare/e636b88...b20d4c1)
143260

@@ -1910,6 +2027,7 @@ Released 2018-09-13
19102027
[`debug_assert_with_mut_call`]: https://rust-lang.github.io/rust-clippy/master/index.html#debug_assert_with_mut_call
19112028
[`decimal_literal_representation`]: https://rust-lang.github.io/rust-clippy/master/index.html#decimal_literal_representation
19122029
[`declare_interior_mutable_const`]: https://rust-lang.github.io/rust-clippy/master/index.html#declare_interior_mutable_const
2030+
[`default_numeric_fallback`]: https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
19132031
[`default_trait_access`]: https://rust-lang.github.io/rust-clippy/master/index.html#default_trait_access
19142032
[`deprecated_cfg_attr`]: https://rust-lang.github.io/rust-clippy/master/index.html#deprecated_cfg_attr
19152033
[`deprecated_semver`]: https://rust-lang.github.io/rust-clippy/master/index.html#deprecated_semver
@@ -1975,6 +2093,7 @@ Released 2018-09-13
19752093
[`forget_ref`]: https://rust-lang.github.io/rust-clippy/master/index.html#forget_ref
19762094
[`from_iter_instead_of_collect`]: https://rust-lang.github.io/rust-clippy/master/index.html#from_iter_instead_of_collect
19772095
[`from_over_into`]: https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
2096+
[`from_str_radix_10`]: https://rust-lang.github.io/rust-clippy/master/index.html#from_str_radix_10
19782097
[`future_not_send`]: https://rust-lang.github.io/rust-clippy/master/index.html#future_not_send
19792098
[`get_last_with_len`]: https://rust-lang.github.io/rust-clippy/master/index.html#get_last_with_len
19802099
[`get_unwrap`]: https://rust-lang.github.io/rust-clippy/master/index.html#get_unwrap
@@ -1990,6 +2109,7 @@ Released 2018-09-13
19902109
[`implicit_saturating_sub`]: https://rust-lang.github.io/rust-clippy/master/index.html#implicit_saturating_sub
19912110
[`imprecise_flops`]: https://rust-lang.github.io/rust-clippy/master/index.html#imprecise_flops
19922111
[`inconsistent_digit_grouping`]: https://rust-lang.github.io/rust-clippy/master/index.html#inconsistent_digit_grouping
2112+
[`inconsistent_struct_constructor`]: https://rust-lang.github.io/rust-clippy/master/index.html#inconsistent_struct_constructor
19932113
[`indexing_slicing`]: https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
19942114
[`ineffective_bit_mask`]: https://rust-lang.github.io/rust-clippy/master/index.html#ineffective_bit_mask
19952115
[`inefficient_to_string`]: https://rust-lang.github.io/rust-clippy/master/index.html#inefficient_to_string
@@ -2042,6 +2162,7 @@ Released 2018-09-13
20422162
[`manual_filter_map`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_filter_map
20432163
[`manual_find_map`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_find_map
20442164
[`manual_flatten`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten
2165+
[`manual_map`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_map
20452166
[`manual_memcpy`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_memcpy
20462167
[`manual_non_exhaustive`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_non_exhaustive
20472168
[`manual_ok_or`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_ok_or

src/tools/clippy/Cargo.toml

+5-2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ build = "build.rs"
1818
edition = "2018"
1919
publish = false
2020

21+
[workspace]
22+
exclude = ["clippy_dev", "mini-macro", "target/lintcheck/crates"]
23+
2124
[[bin]]
2225
name = "cargo-clippy"
2326
test = false
@@ -37,8 +40,8 @@ tempfile = { version = "3.1.0", optional = true }
3740

3841
[dev-dependencies]
3942
cargo_metadata = "0.12"
40-
compiletest_rs = { version = "0.5.0", features = ["tmp"] }
41-
tester = "0.7"
43+
compiletest_rs = { version = "0.6.0", features = ["tmp"] }
44+
tester = "0.9"
4245
clippy-mini-macro-test = { version = "0.2", path = "mini-macro" }
4346
serde = { version = "1.0", features = ["derive"] }
4447
derive-new = "0.5"

src/tools/clippy/README.md

+17
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,23 @@ If you want to run Clippy **only** on the given crate, use the `--no-deps` optio
9898
cargo clippy -p example -- --no-deps
9999
```
100100

101+
### As a rustc replacement (`clippy-driver`)
102+
103+
Clippy can also be used in projects that do not use cargo. To do so, you will need to replace
104+
your `rustc` compilation commands with `clippy-driver`. For example, if your project runs:
105+
106+
```terminal
107+
rustc --edition 2018 -Cpanic=abort foo.rs
108+
```
109+
110+
Then, to enable Clippy, you will need to call:
111+
112+
```terminal
113+
clippy-driver --edition 2018 -Cpanic=abort foo.rs
114+
```
115+
116+
Note that `rustc` will still run, i.e. it will still emit the output files it normally does.
117+
101118
### Travis CI
102119

103120
You can add Clippy to Travis CI in the same way you use it locally:

src/tools/clippy/clippy_dev/Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ shell-escape = "0.1"
1919
tar = { version = "0.4.30", optional = true }
2020
toml = { version = "0.5", optional = true }
2121
ureq = { version = "2.0.0-rc3", optional = true }
22+
rayon = { version = "1.5.0", optional = true }
2223
walkdir = "2"
2324

2425
[features]
25-
lintcheck = ["flate2", "serde_json", "tar", "toml", "ureq", "serde", "fs_extra"]
26+
lintcheck = ["flate2", "serde_json", "tar", "toml", "ureq", "serde", "fs_extra", "rayon"]
2627
deny-warnings = []

0 commit comments

Comments
 (0)