Skip to content

Commit 7636fbc

Browse files
committed
Merge commit '27afd6ade4bb1123a8bf82001629b69d23d62aff' into clippyup
2 parents 434cb43 + 27afd6a commit 7636fbc

File tree

183 files changed

+4143
-1285
lines changed

Some content is hidden

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

183 files changed

+4143
-1285
lines changed

src/tools/clippy/.cargo/config

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ lintcheck = "run --target-dir lintcheck/target --package lintcheck --bin lintche
55
collect-metadata = "test --test dogfood --features metadata-collector-lint -- run_metadata_collection_lint --ignored"
66

77
[build]
8-
rustflags = ["-Zunstable-options"]
8+
# -Zbinary-dep-depinfo allows us to track which rlib files to use for compiling UI tests
9+
rustflags = ["-Zunstable-options", "-Zbinary-dep-depinfo"]

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

+14
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,17 @@
22
name: Blank Issue
33
about: Create a blank issue.
44
---
5+
6+
7+
<!--
8+
Additional labels can be added to this issue by including the following command
9+
(without the space after the @ symbol):
10+
11+
`@rustbot label +<label>`
12+
13+
Common labels for this issue type are:
14+
* C-an-interesting-project
15+
* C-enhancement
16+
* C-question
17+
* C-tracking-issue
18+
-->

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

+18-22
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,24 @@ Instead, this happened: *explanation*
2020

2121
### Meta
2222

23-
- `cargo clippy -V`: e.g. clippy 0.0.212 (f455e46 2020-06-20)
24-
- `rustc -Vv`:
25-
```
26-
rustc 1.46.0-nightly (f455e46ea 2020-06-20)
27-
binary: rustc
28-
commit-hash: f455e46eae1a227d735091091144601b467e1565
29-
commit-date: 2020-06-20
30-
host: x86_64-unknown-linux-gnu
31-
release: 1.46.0-nightly
32-
LLVM version: 10.0
33-
```
23+
**Rust version (`rustc -Vv`):**
24+
25+
```
26+
rustc 1.46.0-nightly (f455e46ea 2020-06-20)
27+
binary: rustc
28+
commit-hash: f455e46eae1a227d735091091144601b467e1565
29+
commit-date: 2020-06-20
30+
host: x86_64-unknown-linux-gnu
31+
release: 1.46.0-nightly
32+
LLVM version: 10.0
33+
```
3434

3535
<!--
36-
Include a backtrace in the code block by setting `RUST_BACKTRACE=1` in your
37-
environment. E.g. `RUST_BACKTRACE=1 cargo clippy`.
36+
Additional labels can be added to this issue by including the following command
37+
(without the space after the @ symbol):
38+
39+
`@rustbot label +<label>`
40+
41+
Common labels for this issue type are:
42+
* `I-suggestion-causes-error`
3843
-->
39-
<details><summary>Backtrace</summary>
40-
<p>
41-
42-
```
43-
<backtrace>
44-
```
45-
46-
</p>
47-
</details>

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

+11-11
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ Instead, this happened: *explanation*
2222

2323
### Meta
2424

25-
- `cargo clippy -V`: e.g. clippy 0.0.212 (f455e46 2020-06-20)
26-
- `rustc -Vv`:
27-
```
28-
rustc 1.46.0-nightly (f455e46ea 2020-06-20)
29-
binary: rustc
30-
commit-hash: f455e46eae1a227d735091091144601b467e1565
31-
commit-date: 2020-06-20
32-
host: x86_64-unknown-linux-gnu
33-
release: 1.46.0-nightly
34-
LLVM version: 10.0
35-
```
25+
**Rust version (`rustc -Vv`):**
26+
27+
```
28+
rustc 1.46.0-nightly (f455e46ea 2020-06-20)
29+
binary: rustc
30+
commit-hash: f455e46eae1a227d735091091144601b467e1565
31+
commit-date: 2020-06-20
32+
host: x86_64-unknown-linux-gnu
33+
release: 1.46.0-nightly
34+
LLVM version: 10.0
35+
```

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

+20-11
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,23 @@ Instead, this happened: *explanation*
2222

2323
### Meta
2424

25-
- `cargo clippy -V`: e.g. clippy 0.0.212 (f455e46 2020-06-20)
26-
- `rustc -Vv`:
27-
```
28-
rustc 1.46.0-nightly (f455e46ea 2020-06-20)
29-
binary: rustc
30-
commit-hash: f455e46eae1a227d735091091144601b467e1565
31-
commit-date: 2020-06-20
32-
host: x86_64-unknown-linux-gnu
33-
release: 1.46.0-nightly
34-
LLVM version: 10.0
35-
```
25+
**Rust version (`rustc -Vv`):**
26+
```
27+
rustc 1.46.0-nightly (f455e46ea 2020-06-20)
28+
binary: rustc
29+
commit-hash: f455e46eae1a227d735091091144601b467e1565
30+
commit-date: 2020-06-20
31+
host: x86_64-unknown-linux-gnu
32+
release: 1.46.0-nightly
33+
LLVM version: 10.0
34+
```
35+
36+
<!--
37+
Additional labels can be added to this issue by including the following command
38+
(without the space after the @ symbol):
39+
40+
`@rustbot label +<label>`
41+
42+
Common labels for this issue type are:
43+
* I-suggestion-causes-error
44+
-->

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

+10-11
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,16 @@ http://blog.pnkfx.org/blog/2019/11/18/rust-bug-minimization-patterns/
2020

2121
### Meta
2222

23-
- `cargo clippy -V`: e.g. clippy 0.0.212 (f455e46 2020-06-20)
24-
- `rustc -Vv`:
25-
```
26-
rustc 1.46.0-nightly (f455e46ea 2020-06-20)
27-
binary: rustc
28-
commit-hash: f455e46eae1a227d735091091144601b467e1565
29-
commit-date: 2020-06-20
30-
host: x86_64-unknown-linux-gnu
31-
release: 1.46.0-nightly
32-
LLVM version: 10.0
33-
```
23+
**Rust version (`rustc -Vv`):**
24+
```
25+
rustc 1.46.0-nightly (f455e46ea 2020-06-20)
26+
binary: rustc
27+
commit-hash: f455e46eae1a227d735091091144601b467e1565
28+
commit-date: 2020-06-20
29+
host: x86_64-unknown-linux-gnu
30+
release: 1.46.0-nightly
31+
LLVM version: 10.0
32+
```
3433

3534
### Error output
3635

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

-3
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ jobs:
4242
run: cargo build --features deny-warnings
4343
working-directory: clippy_dev
4444

45-
- name: Test limit_stderr_length
46-
run: cargo dev limit_stderr_length
47-
4845
- name: Test update_lints
4946
run: cargo dev update_lints --check
5047

src/tools/clippy/CHANGELOG.md

+9-3
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,7 @@ Released 2020-11-19
964964
[#5907](https://github.com/rust-lang/rust-clippy/pull/5907)
965965
* [`suspicious_arithmetic_impl`]: extend to implementations of `BitAnd`, `BitOr`, `BitXor`, `Rem`, `Shl`, and `Shr`
966966
[#5884](https://github.com/rust-lang/rust-clippy/pull/5884)
967-
* [`invalid_atomic_ordering`]: detect misuse of `compare_exchange`, `compare_exchange_weak`, and `fetch_update`
967+
* `invalid_atomic_ordering`: detect misuse of `compare_exchange`, `compare_exchange_weak`, and `fetch_update`
968968
[#6025](https://github.com/rust-lang/rust-clippy/pull/6025)
969969
* Avoid [`redundant_pattern_matching`] triggering in macros
970970
[#6069](https://github.com/rust-lang/rust-clippy/pull/6069)
@@ -1451,7 +1451,7 @@ Released 2020-03-12
14511451
* [`option_as_ref_deref`] [#4945](https://github.com/rust-lang/rust-clippy/pull/4945)
14521452
* [`wildcard_in_or_patterns`] [#4960](https://github.com/rust-lang/rust-clippy/pull/4960)
14531453
* [`iter_nth_zero`] [#4966](https://github.com/rust-lang/rust-clippy/pull/4966)
1454-
* [`invalid_atomic_ordering`] [#4999](https://github.com/rust-lang/rust-clippy/pull/4999)
1454+
* `invalid_atomic_ordering` [#4999](https://github.com/rust-lang/rust-clippy/pull/4999)
14551455
* [`skip_while_next`] [#5067](https://github.com/rust-lang/rust-clippy/pull/5067)
14561456

14571457
### Moves and Deprecations
@@ -2613,6 +2613,7 @@ Released 2018-09-13
26132613
[`deprecated_cfg_attr`]: https://rust-lang.github.io/rust-clippy/master/index.html#deprecated_cfg_attr
26142614
[`deprecated_semver`]: https://rust-lang.github.io/rust-clippy/master/index.html#deprecated_semver
26152615
[`deref_addrof`]: https://rust-lang.github.io/rust-clippy/master/index.html#deref_addrof
2616+
[`derivable_impls`]: https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls
26162617
[`derive_hash_xor_eq`]: https://rust-lang.github.io/rust-clippy/master/index.html#derive_hash_xor_eq
26172618
[`derive_ord_xor_partial_ord`]: https://rust-lang.github.io/rust-clippy/master/index.html#derive_ord_xor_partial_ord
26182619
[`disallowed_method`]: https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_method
@@ -2712,7 +2713,6 @@ Released 2018-09-13
27122713
[`integer_arithmetic`]: https://rust-lang.github.io/rust-clippy/master/index.html#integer_arithmetic
27132714
[`integer_division`]: https://rust-lang.github.io/rust-clippy/master/index.html#integer_division
27142715
[`into_iter_on_ref`]: https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref
2715-
[`invalid_atomic_ordering`]: https://rust-lang.github.io/rust-clippy/master/index.html#invalid_atomic_ordering
27162716
[`invalid_null_ptr_usage`]: https://rust-lang.github.io/rust-clippy/master/index.html#invalid_null_ptr_usage
27172717
[`invalid_regex`]: https://rust-lang.github.io/rust-clippy/master/index.html#invalid_regex
27182718
[`invalid_upcast_comparisons`]: https://rust-lang.github.io/rust-clippy/master/index.html#invalid_upcast_comparisons
@@ -2754,6 +2754,7 @@ Released 2018-09-13
27542754
[`manual_ok_or`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_ok_or
27552755
[`manual_range_contains`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains
27562756
[`manual_saturating_arithmetic`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_saturating_arithmetic
2757+
[`manual_split_once`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_split_once
27572758
[`manual_str_repeat`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_str_repeat
27582759
[`manual_strip`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip
27592760
[`manual_swap`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_swap
@@ -2795,6 +2796,7 @@ Released 2018-09-13
27952796
[`missing_safety_doc`]: https://rust-lang.github.io/rust-clippy/master/index.html#missing_safety_doc
27962797
[`mistyped_literal_suffixes`]: https://rust-lang.github.io/rust-clippy/master/index.html#mistyped_literal_suffixes
27972798
[`mixed_case_hex_literals`]: https://rust-lang.github.io/rust-clippy/master/index.html#mixed_case_hex_literals
2799+
[`mod_module_files`]: https://rust-lang.github.io/rust-clippy/master/index.html#mod_module_files
27982800
[`module_inception`]: https://rust-lang.github.io/rust-clippy/master/index.html#module_inception
27992801
[`module_name_repetitions`]: https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions
28002802
[`modulo_arithmetic`]: https://rust-lang.github.io/rust-clippy/master/index.html#modulo_arithmetic
@@ -2821,13 +2823,15 @@ Released 2018-09-13
28212823
[`needless_doctest_main`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_doctest_main
28222824
[`needless_for_each`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_for_each
28232825
[`needless_lifetimes`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
2826+
[`needless_option_as_deref`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_option_as_deref
28242827
[`needless_pass_by_value`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_value
28252828
[`needless_question_mark`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
28262829
[`needless_range_loop`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop
28272830
[`needless_return`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
28282831
[`needless_update`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_update
28292832
[`neg_cmp_op_on_partial_ord`]: https://rust-lang.github.io/rust-clippy/master/index.html#neg_cmp_op_on_partial_ord
28302833
[`neg_multiply`]: https://rust-lang.github.io/rust-clippy/master/index.html#neg_multiply
2834+
[`negative_feature_names`]: https://rust-lang.github.io/rust-clippy/master/index.html#negative_feature_names
28312835
[`never_loop`]: https://rust-lang.github.io/rust-clippy/master/index.html#never_loop
28322836
[`new_ret_no_self`]: https://rust-lang.github.io/rust-clippy/master/index.html#new_ret_no_self
28332837
[`new_without_default`]: https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
@@ -2881,6 +2885,7 @@ Released 2018-09-13
28812885
[`redundant_closure_call`]: https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_call
28822886
[`redundant_closure_for_method_calls`]: https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_for_method_calls
28832887
[`redundant_else`]: https://rust-lang.github.io/rust-clippy/master/index.html#redundant_else
2888+
[`redundant_feature_names`]: https://rust-lang.github.io/rust-clippy/master/index.html#redundant_feature_names
28842889
[`redundant_field_names`]: https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
28852890
[`redundant_pattern`]: https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern
28862891
[`redundant_pattern_matching`]: https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching
@@ -2903,6 +2908,7 @@ Released 2018-09-13
29032908
[`search_is_some`]: https://rust-lang.github.io/rust-clippy/master/index.html#search_is_some
29042909
[`self_assignment`]: https://rust-lang.github.io/rust-clippy/master/index.html#self_assignment
29052910
[`self_named_constructors`]: https://rust-lang.github.io/rust-clippy/master/index.html#self_named_constructors
2911+
[`self_named_module_files`]: https://rust-lang.github.io/rust-clippy/master/index.html#self_named_module_files
29062912
[`semicolon_if_nothing_returned`]: https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
29072913
[`serde_api_misuse`]: https://rust-lang.github.io/rust-clippy/master/index.html#serde_api_misuse
29082914
[`shadow_reuse`]: https://rust-lang.github.io/rust-clippy/master/index.html#shadow_reuse

src/tools/clippy/Cargo.toml

+10-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "clippy"
3-
version = "0.1.56"
3+
version = "0.1.57"
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"
@@ -32,11 +32,7 @@ tempfile = { version = "3.1.0", optional = true }
3232
cargo_metadata = "0.12"
3333
compiletest_rs = { version = "0.6.0", features = ["tmp"] }
3434
tester = "0.9"
35-
serde = { version = "1.0", features = ["derive"] }
36-
derive-new = "0.5"
3735
regex = "1.4"
38-
quote = "1"
39-
syn = { version = "1", features = ["full"] }
4036
# This is used by the `collect-metadata` alias.
4137
filetime = "0.2"
4238

@@ -45,6 +41,15 @@ filetime = "0.2"
4541
# for more information.
4642
rustc-workspace-hack = "1.0.0"
4743

44+
# UI test dependencies
45+
clippy_utils = { path = "clippy_utils" }
46+
derive-new = "0.5"
47+
if_chain = "1.0"
48+
itertools = "0.10.1"
49+
quote = "1"
50+
serde = { version = "1.0", features = ["derive"] }
51+
syn = { version = "1", features = ["full"] }
52+
4853
[build-dependencies]
4954
rustc_tools_util = { version = "0.2.0", path = "rustc_tools_util" }
5055

src/tools/clippy/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ or in Travis CI.
4545
One way to use Clippy is by installing Clippy through rustup as a cargo
4646
subcommand.
4747

48-
#### Step 1: Install rustup
48+
#### Step 1: Install Rustup
4949

50-
You can install [rustup](https://rustup.rs/) on supported platforms. This will help
50+
You can install [Rustup](https://rustup.rs/) on supported platforms. This will help
5151
us install Clippy and its dependencies.
5252

53-
If you already have rustup installed, update to ensure you have the latest
54-
rustup and compiler:
53+
If you already have Rustup installed, update to ensure you have the latest
54+
Rustup and compiler:
5555

5656
```terminal
5757
rustup update

src/tools/clippy/clippy_dev/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ pub mod fmt;
1717
pub mod new_lint;
1818
pub mod serve;
1919
pub mod setup;
20-
pub mod stderr_length_check;
2120
pub mod update_lints;
2221

2322
static DEC_CLIPPY_LINT_RE: SyncLazy<Regex> = SyncLazy::new(|| {

src/tools/clippy/clippy_dev/src/main.rs

+1-8
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#![warn(rust_2018_idioms, unused_lifetimes)]
44

55
use clap::{App, AppSettings, Arg, ArgMatches, SubCommand};
6-
use clippy_dev::{bless, fmt, new_lint, serve, setup, stderr_length_check, update_lints};
6+
use clippy_dev::{bless, fmt, new_lint, serve, setup, update_lints};
77
fn main() {
88
let matches = get_clap_config();
99

@@ -33,9 +33,6 @@ fn main() {
3333
Err(e) => eprintln!("Unable to create lint: {}", e),
3434
}
3535
},
36-
("limit_stderr_length", _) => {
37-
stderr_length_check::check();
38-
},
3936
("setup", Some(sub_command)) => match sub_command.subcommand() {
4037
("intellij", Some(matches)) => setup::intellij::setup_rustc_src(
4138
matches
@@ -152,10 +149,6 @@ fn get_clap_config<'a>() -> ArgMatches<'a> {
152149
.takes_value(true),
153150
),
154151
)
155-
.subcommand(
156-
SubCommand::with_name("limit_stderr_length")
157-
.about("Ensures that stderr files do not grow longer than a certain amount of lines."),
158-
)
159152
.subcommand(
160153
SubCommand::with_name("setup")
161154
.about("Support for setting up your personal development environment")

src/tools/clippy/clippy_dev/src/stderr_length_check.rs

-51
This file was deleted.

0 commit comments

Comments
 (0)