Skip to content

Commit acdcdfb

Browse files
committed
Auto merge of #98706 - flip1995:clippyup, r=Dylan-DPC
Update Clippy r? `@Manishearth`
2 parents 7425fb2 + 5fead7a commit acdcdfb

File tree

244 files changed

+9051
-3492
lines changed

Some content is hidden

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

244 files changed

+9051
-3492
lines changed

Diff for: Cargo.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ dependencies = [
638638

639639
[[package]]
640640
name = "clippy"
641-
version = "0.1.63"
641+
version = "0.1.64"
642642
dependencies = [
643643
"clippy_lints",
644644
"clippy_utils",
@@ -661,6 +661,7 @@ dependencies = [
661661
"termize",
662662
"tester",
663663
"tokio",
664+
"toml",
664665
]
665666

666667
[[package]]
@@ -679,10 +680,9 @@ dependencies = [
679680

680681
[[package]]
681682
name = "clippy_lints"
682-
version = "0.1.63"
683+
version = "0.1.64"
683684
dependencies = [
684685
"cargo_metadata",
685-
"clippy_dev",
686686
"clippy_utils",
687687
"if_chain",
688688
"itertools",
@@ -702,7 +702,7 @@ dependencies = [
702702

703703
[[package]]
704704
name = "clippy_utils"
705-
version = "0.1.63"
705+
version = "0.1.64"
706706
dependencies = [
707707
"arrayvec",
708708
"if_chain",

Diff for: src/tools/clippy/.github/workflows/remark.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Setup Node.js
2222
uses: actions/[email protected]
2323
with:
24-
node-version: '12.x'
24+
node-version: '14.x'
2525

2626
- name: Install remark
2727
run: npm install remark-cli remark-lint remark-lint-maximum-line-length remark-preset-lint-recommended remark-gfm

Diff for: src/tools/clippy/CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -3348,6 +3348,7 @@ Released 2018-09-13
33483348
[`debug_assert_with_mut_call`]: https://rust-lang.github.io/rust-clippy/master/index.html#debug_assert_with_mut_call
33493349
[`decimal_literal_representation`]: https://rust-lang.github.io/rust-clippy/master/index.html#decimal_literal_representation
33503350
[`declare_interior_mutable_const`]: https://rust-lang.github.io/rust-clippy/master/index.html#declare_interior_mutable_const
3351+
[`default_instead_of_iter_empty`]: https://rust-lang.github.io/rust-clippy/master/index.html#default_instead_of_iter_empty
33513352
[`default_numeric_fallback`]: https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
33523353
[`default_trait_access`]: https://rust-lang.github.io/rust-clippy/master/index.html#default_trait_access
33533354
[`default_union_representation`]: https://rust-lang.github.io/rust-clippy/master/index.html#default_union_representation
@@ -3399,6 +3400,7 @@ Released 2018-09-13
33993400
[`expect_fun_call`]: https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call
34003401
[`expect_used`]: https://rust-lang.github.io/rust-clippy/master/index.html#expect_used
34013402
[`expl_impl_clone_on_copy`]: https://rust-lang.github.io/rust-clippy/master/index.html#expl_impl_clone_on_copy
3403+
[`explicit_auto_deref`]: https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref
34023404
[`explicit_counter_loop`]: https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop
34033405
[`explicit_deref_methods`]: https://rust-lang.github.io/rust-clippy/master/index.html#explicit_deref_methods
34043406
[`explicit_into_iter_loop`]: https://rust-lang.github.io/rust-clippy/master/index.html#explicit_into_iter_loop
@@ -3519,13 +3521,16 @@ Released 2018-09-13
35193521
[`manual_async_fn`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_async_fn
35203522
[`manual_bits`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_bits
35213523
[`manual_filter_map`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_filter_map
3524+
[`manual_find`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_find
35223525
[`manual_find_map`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_find_map
35233526
[`manual_flatten`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten
35243527
[`manual_map`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_map
35253528
[`manual_memcpy`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_memcpy
35263529
[`manual_non_exhaustive`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_non_exhaustive
35273530
[`manual_ok_or`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_ok_or
35283531
[`manual_range_contains`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains
3532+
[`manual_rem_euclid`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_rem_euclid
3533+
[`manual_retain`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_retain
35293534
[`manual_saturating_arithmetic`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_saturating_arithmetic
35303535
[`manual_split_once`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_split_once
35313536
[`manual_str_repeat`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_str_repeat

Diff for: src/tools/clippy/Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "clippy"
3-
version = "0.1.63"
3+
version = "0.1.64"
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"
@@ -31,6 +31,7 @@ termize = "0.1"
3131
compiletest_rs = { version = "0.8", features = ["tmp"] }
3232
tester = "0.9"
3333
regex = "1.5"
34+
toml = "0.5"
3435
# This is used by the `collect-metadata` alias.
3536
filetime = "0.2"
3637

Diff for: src/tools/clippy/README.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
A collection of lints to catch common mistakes and improve your [Rust](https://github.com/rust-lang/rust) code.
77

8-
[There are over 500 lints included in this crate!](https://rust-lang.github.io/rust-clippy/master/index.html)
8+
[There are over 550 lints included in this crate!](https://rust-lang.github.io/rust-clippy/master/index.html)
99

1010
Lints are divided into categories, each with a default [lint level](https://doc.rust-lang.org/rustc/lints/levels.html).
1111
You can choose how much Clippy is supposed to ~~annoy~~ help you by changing the lint level by category.
@@ -214,6 +214,14 @@ specifying the minimum supported Rust version (MSRV) in the clippy configuration
214214
msrv = "1.30.0"
215215
```
216216

217+
Alternatively, the [`rust-version` field](https://doc.rust-lang.org/cargo/reference/manifest.html#the-rust-version-field)
218+
in the `Cargo.toml` can be used.
219+
220+
```toml
221+
# Cargo.toml
222+
rust-version = "1.30"
223+
```
224+
217225
The MSRV can also be specified as an inner attribute, like below.
218226

219227
```rust

Diff for: src/tools/clippy/book/src/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
A collection of lints to catch common mistakes and improve your
77
[Rust](https://github.com/rust-lang/rust) code.
88

9-
[There are over 500 lints included in this crate!](https://rust-lang.github.io/rust-clippy/master/index.html)
9+
[There are over 550 lints included in this crate!](https://rust-lang.github.io/rust-clippy/master/index.html)
1010

1111
Lints are divided into categories, each with a default [lint
1212
level](https://doc.rust-lang.org/rustc/lints/levels.html). You can choose how

Diff for: src/tools/clippy/clippy_dev/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ edition = "2021"
55

66
[dependencies]
77
aho-corasick = "0.7"
8-
clap = "3.1"
8+
clap = "3.2"
99
indoc = "1.0"
1010
itertools = "0.10.1"
1111
opener = "0.5"

Diff for: src/tools/clippy/clippy_dev/src/main.rs

+18
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use clap::{Arg, ArgAction, ArgMatches, Command, PossibleValue};
66
use clippy_dev::{bless, fmt, lint, new_lint, serve, setup, update_lints};
77
use indoc::indoc;
8+
89
fn main() {
910
let matches = get_clap_config();
1011

@@ -85,6 +86,11 @@ fn main() {
8586
let uplift = matches.contains_id("uplift");
8687
update_lints::rename(old_name, new_name, uplift);
8788
},
89+
Some(("deprecate", matches)) => {
90+
let name = matches.get_one::<String>("name").unwrap();
91+
let reason = matches.get_one("reason");
92+
update_lints::deprecate(name, reason);
93+
},
8894
_ => {},
8995
}
9096
}
@@ -266,6 +272,18 @@ fn get_clap_config() -> ArgMatches {
266272
.long("uplift")
267273
.help("This lint will be uplifted into rustc"),
268274
]),
275+
Command::new("deprecate").about("Deprecates the given lint").args([
276+
Arg::new("name")
277+
.index(1)
278+
.required(true)
279+
.help("The name of the lint to deprecate"),
280+
Arg::new("reason")
281+
.long("reason")
282+
.short('r')
283+
.required(false)
284+
.takes_value(true)
285+
.help("The reason for deprecation"),
286+
]),
269287
])
270288
.get_matches()
271289
}

Diff for: src/tools/clippy/clippy_dev/src/new_lint.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ fn to_camel_case(name: &str) -> String {
138138
.collect()
139139
}
140140

141-
fn get_stabilization_version() -> String {
141+
pub(crate) fn get_stabilization_version() -> String {
142142
fn parse_manifest(contents: &str) -> Option<String> {
143143
let version = contents
144144
.lines()

0 commit comments

Comments
 (0)