Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Clippy #98706

Merged
merged 174 commits into from
Jul 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
174 commits
Select commit Hold shift + click to select a range
430575b
add `manual_find` lint for function return case
ebobrow Apr 6, 2022
5a70d88
add vec.capacity() to slow_vec_initialization
DevAccentor Jun 5, 2022
6d6c63e
Lint single_match with Options, Results, and Cows
botahamec Jun 9, 2022
2967127
Refactored the candidate type checking
botahamec Jun 9, 2022
b46f1c4
Don't trigger if a binding is in the else pattern
botahamec Jun 10, 2022
b0c2030
Some refactoring
botahamec Jun 10, 2022
01c75e4
Added tests for Cow and Result
botahamec Jun 10, 2022
f3dc7ae
Fixed up the documentation for a couple functions
botahamec Jun 10, 2022
ded2bb5
Slight documentation change
botahamec Jun 10, 2022
9306e9a
Ignore bodies containing `todo!()` in `clippy::if_same_then_else`
May 18, 2022
7cb4cef
feat(fix): ignore todo! and unimplemented! in if_same_then_else
kyoto7250 Jun 16, 2022
922ff84
bless clippy tests
klensy Jun 15, 2022
4d88993
bless clippy ui tests
WaffleLapkin Jun 16, 2022
f8f9d01
Merge commit 'd7b5cbf065b88830ca519adcb73fad4c0d24b1c7' into clippyup
flip1995 Jun 16, 2022
f095f80
Move/rename `lazy::Sync{OnceCell,Lazy}` to `sync::{Once,Lazy}Lock`
WaffleLapkin Jun 16, 2022
a5b6d25
use get_diagnostic_name for checking macro_call
kyoto7250 Jun 17, 2022
72c73f8
remove the rest of unnecessary `to_string`
TaKO8Ki Jun 17, 2022
51e2d6a
Rollup merge of #97798 - WaffleLapkin:allow_for_suggestions_that_are_…
Dylan-DPC Jun 17, 2022
2cc798b
Rollup merge of #98191 - TaKO8Ki:remove-rest-of-unnecessary-to-string…
Dylan-DPC Jun 17, 2022
2bb8c45
feat(lint): add default_iter_empty
kyoto7250 Jun 12, 2022
697c75e
check only the end
kyoto7250 Jun 17, 2022
09c9301
Auto merge of #97892 - klensy:fix-spaces, r=oli-obk
bors Jun 17, 2022
e933bb6
Auto merge of #8989 - kyoto7250:default_iter_empty, r=Alexendoo
bors Jun 17, 2022
f411c18
check macro_backtrace only
kyoto7250 Jun 18, 2022
7a83809
check only first statement
kyoto7250 Jun 18, 2022
040d45e
check macro in eq_block
kyoto7250 Jun 18, 2022
4a02ae9
cargo dev fmt
kyoto7250 Jun 18, 2022
a9215d9
ignore item in thread_local!
kyoto7250 Jun 16, 2022
eeedf72
Use RefCell in needless_return tests
Alexendoo Jun 18, 2022
4737e9e
Rollup merge of #98165 - WaffleLapkin:once_things_renamings, r=m-ou-se
matthiaskrgr Jun 18, 2022
4e7ed42
Add description meta tag for lint list
unvalley Jun 19, 2022
9395c26
remove `span_lint_and_sugg_for_edges` from clippy utils
WaffleLapkin Jun 19, 2022
ee37029
remove last use of MAX_SUGGESTION_HIGHLIGHT_LINES
WaffleLapkin Jun 19, 2022
9d92af7
Auto merge of #9016 - Alexendoo:needless-return-test, r=giraffate
bors Jun 20, 2022
46d056e
check last statement
kyoto7250 Jun 20, 2022
39ffda0
check macro in HitEqInterExpr
kyoto7250 Jun 20, 2022
4a4b5cf
confirm using chain in collapsible_span_lint_calls
kyoto7250 Jun 20, 2022
195f2cb
Auto merge of #9023 - unvalley:add-meta-tag-for-lint-list, r=xFrednet
bors Jun 20, 2022
a0b107b
unused_async: lint async methods
Alexendoo Jun 20, 2022
97d4513
Auto merge of #9025 - Alexendoo:unused-async-method, r=dswij
bors Jun 20, 2022
93c6f9e
Auto merge of #9006 - kyoto7250:issue-8836-v2, r=Jarcho
bors Jun 20, 2022
6fc84d4
put parentheses around neg_multiply suggestion if needed
hellow554 Jun 20, 2022
2476100
Add details about significant drop in match scrutinees causing deadlocks
PrestonFrom Jun 10, 2022
dc7f227
`For` example should be used instead `while` in WHILE_LET_ON_ITERATOR
alex-semenyuk Jun 18, 2022
2bd1581
Add `dev deprecate`
Serial-ATA May 22, 2022
890fd0e
Remove `cargo_dev` dependency
Serial-ATA Jun 21, 2022
e5ebd3e
Implement manual_rem_euclid lint
Jun 21, 2022
6e1df47
Fix case where suggestion errored for infer type
Jun 21, 2022
ab645bb
enum_variant_names should ignore when all prefixes are _
kyoto7250 Jun 21, 2022
bc0bf06
Auto merge of #9017 - alex-semenyuk:while_let_on_iterator_doc_fix, r=…
bors Jun 22, 2022
f9fea17
Auto merge of #9030 - Serial-ATA:remove-clippy-dev-dep, r=flip1995
bors Jun 22, 2022
b969326
Example for VEC_RESIZE_TO_ZERO
alex-semenyuk Jun 22, 2022
75ed0c9
Prefer `.ok()?` over `.unwrap()`
Jun 22, 2022
93e41d3
Fix case where rem was considered commutative
Jun 22, 2022
c8df6d6
Prefer if let chain over macro
Jun 22, 2022
90f8277
Fix case for function params
Jun 22, 2022
61e1870
Add MSRV check for const rem_euclid
Jun 22, 2022
0447cc7
Simplify with let else
Jun 22, 2022
3d366fc
Auto merge of #9026 - hellow554:neg_multiply_precedence, r=xFrednet
bors Jun 22, 2022
6985e65
Auto merge of #9028 - kyoto7250:issue_8798, r=xFrednet
bors Jun 22, 2022
2cc5211
Auto merge of #9034 - alex-semenyuk:example_vec_resize_to_zero, r=gir…
bors Jun 22, 2022
87eded6
Fix `extra_unused_lifetimes` false positive
smoelius Jun 21, 2022
1f707db
Update messages for clarity when linting
PrestonFrom Jun 23, 2022
4182803
Check for `--force-warn` in Clippy's driver run condition
xFrednet Jun 23, 2022
92704b4
Split constant check functions and simplify
Jun 23, 2022
ebf77f6
Fix ICE when deprecating lints in directories
Serial-ATA Jun 23, 2022
df26c3f
Add external macro guard and test middle MSRV
Jun 23, 2022
f718984
Auto merge of #8953 - DevAccentor:slow_vector_initialization, r=Manis…
bors Jun 23, 2022
3f47cd1
Auto merge of #9036 - xFrednet:0000-force-warn-in-driver, r=dswij
bors Jun 24, 2022
1d1ae10
Auto merge of #9037 - smoelius:fix-extra-unused-lifetimes-fp, r=dswij
bors Jun 24, 2022
a8f6824
Add test for `extra_unused_lifetimes` FP on derive
dswij Jun 24, 2022
e17864e
Auto merge of #9031 - evantypanski:manual_rem_euclid, r=Jarcho
bors Jun 24, 2022
aec465c
Add test for [`default_deprecation_reason`]
Serial-ATA Jun 24, 2022
93ebd0e
Auto merge of #9015 - kyoto7250:issue_8493, r=Jarcho
bors Jun 25, 2022
7cdaabc
Suggest `pointer::cast` when possible in `transmute_ptr_to_ref`
Jarcho Jun 4, 2022
e7c55a4
Fix `#[expect]` for `clippy::ptr_arg`
xFrednet Jun 25, 2022
811d73a
Test `#[expect]` for `redundant_clone`
xFrednet Jun 25, 2022
a3c7101
Fix `#[expect]` for `clippy::logic_bug`
xFrednet Jun 25, 2022
b6ee6bb
Fix `#[expect]` for `clippy::nonminimal_bool`
xFrednet Jun 25, 2022
b297698
Fix `#[expect]` for `clippy::boxed_local`
xFrednet Jun 25, 2022
54ad99b
Fix `#[expect]` for `clippy::implicit_return`
xFrednet Jun 25, 2022
bdc6ece
Fix `#[expect]` for `clippy::needless_return`
xFrednet Jun 25, 2022
79fc271
Fix `#[expect]` for `unnecessary_unwrap`, `panicking_unwrap`
xFrednet Jun 25, 2022
ae4900c
Fix `#[expect]` for `clippy::macro_use_imports`
xFrednet Jun 25, 2022
525f5ee
Update `useless_attribute` docs and allow `macro_use_imports`
xFrednet Jun 25, 2022
6427ba4
Fix `#[expect]` for `clippy::manual_non_exhaustive`
xFrednet Jun 25, 2022
4d41a97
Add note to `is_lint_allowed` about lint emission
xFrednet Jun 25, 2022
3a31ef7
Give clippy some Dogfood to make it happy =^.^=
xFrednet Jun 25, 2022
8789f4e
Auto merge of #8985 - botahamec:single-match-option, r=llogiq
bors Jun 25, 2022
bf317a8
treat argument as a slice.
kyoto7250 Jun 26, 2022
d827b83
use all instead of join
kyoto7250 Jun 26, 2022
4065702
STRING_ADD example
alex-semenyuk Jun 26, 2022
1691914
STRING_ADD example
alex-semenyuk Jun 26, 2022
11bf291
update node.js version
kyoto7250 Jun 26, 2022
ab58276
Auto merge of #9055 - kyoto7250:update_nodejs_in_github_action, r=Man…
bors Jun 26, 2022
9b15062
Auto merge of #9032 - kyoto7250:issue_9018, r=llogiq
bors Jun 26, 2022
5f2b8e6
feat(new lint): new lint `use_retain`
kyoto7250 Jun 7, 2022
b20b8f1
Update clippy_lints/src/use_retain.rs
kyoto7250 Jun 9, 2022
e3afc72
remove needless return
kyoto7250 Jun 9, 2022
3953c53
change lint type from style to perf
kyoto7250 Jun 9, 2022
fd629c0
check method
kyoto7250 Jun 9, 2022
1421211
rewrite without if_chain macro
kyoto7250 Jun 9, 2022
4decfde
check msrv
kyoto7250 Jun 10, 2022
dd3d0fd
rename use_retain => manual_retain
kyoto7250 Jun 10, 2022
3a9c0ef
fix for git rebase
kyoto7250 Jun 18, 2022
676af45
cargo dev update_lints
kyoto7250 Jun 26, 2022
88da5f2
Auto merge of #8939 - Jarcho:transmute_ptr_to_ref_lt, r=giraffate
bors Jun 27, 2022
57e7e1d
Auto merge of #8871 - Serial-ATA:cargo-dev-deprecate, r=giraffate
bors Jun 27, 2022
6b762ee
Auto merge of #9054 - alex-semenyuk:string_add_example, r=giraffate
bors Jun 27, 2022
65f700f
Fix `let_undescore_lock` false-positive when binding without locking
tsoutsman Jun 13, 2022
889b361
Auto merge of #8990 - tsoutsman:master, r=llogiq
bors Jun 27, 2022
eaa03ea
Auto merge of #8972 - kyoto7250:use_retain, r=llogiq
bors Jun 27, 2022
c6a2221
Fix example `SELF_ASSIGNMENT`
alex-semenyuk Jun 25, 2022
2315f76
Actually check lifetimes in `trivially_copy_pass_by_ref`
Jarcho Apr 6, 2022
c10101c
Don't lint `trivially_copy_pass_by_ref` when unsafe pointers are used
Jarcho Apr 6, 2022
fdd0e72
Auto merge of #8649 - ebobrow:imperative_find, r=flip1995
bors Jun 27, 2022
d855395
Auto merge of #9045 - alex-semenyuk:self_assignment_example, r=llogiq
bors Jun 27, 2022
3cfd1e5
Make messages more accurate, check lint enabled
PrestonFrom Jun 28, 2022
7bc4096
Run cargo dev fmt
PrestonFrom Jun 28, 2022
81737bf
try reading rust-version from Cargo.toml
hellow554 May 2, 2022
83511d1
update README.md to reflect rust-version in cargo.toml
hellow554 May 10, 2022
6384765
parse `Cargo.toml` file in ui-cargo tests
hellow554 Jun 27, 2022
f0a1cd5
add uitests for cargo rust-version field
hellow554 May 10, 2022
373bb57
Auto merge of #8639 - Jarcho:trivially_copy_pass_by_ref_5953, r=dswij
bors Jun 28, 2022
b776fb8
Auto merge of #8774 - hellow554:cargo-rust-version, r=flip1995
bors Jun 28, 2022
d11618e
Update `boxed_local` expect attribute location
xFrednet Jun 28, 2022
c107c97
Better support projection types when finding the signature for an exp…
Jarcho Jan 25, 2022
8a74d33
Add `explicit_auto_deref` lint
Jarcho Jan 27, 2022
ee532c0
Don't lint `explicit_auto_deref` on reborrows
Jarcho Jan 27, 2022
a187d64
Merge different parent walking loops in `dereference.rs`
Jarcho Jan 28, 2022
20ea262
Lint field accesses in `explicit_auto_deref`
Jarcho Jan 28, 2022
442a68c
Only check parent node once in `dereference.rs`
Jarcho Jan 28, 2022
65bc6cb
Lint `explicit_auto_deref` without a leading borrow
Jarcho Jan 28, 2022
0204b95
Lint `explicit_auto_deref` immediately after `needless_borrow`
Jarcho Jan 29, 2022
0b4ba73
Refactor `dereference.rs`
Jarcho Jan 29, 2022
6d21b79
Fix `needless_borrow` suggestion when calling a trait method taking `…
Jarcho Jan 30, 2022
9788107
Handle future precedence issues in `explicit_auto_deref` + cleanup
Jarcho Jan 31, 2022
15df228
Code cleanup
Jarcho Feb 7, 2022
85c1f74
Add `explicit_auto_deref` test for variadic function
Jarcho Jun 13, 2022
dd78ce7
Add `Operators` lint pass
Jarcho May 31, 2022
448b6f4
Move `Arithmetic` into `Operators` lint pass
Jarcho Jun 1, 2022
751131b
Move `AssignOps` into `Operators` lint pass
Jarcho Jun 1, 2022
68a7fd2
Move `BitMask` into `Operators` lint pass
Jarcho Jun 1, 2022
4ac3626
Move `DoubleComparison` into `Operators` lint pass
Jarcho Jun 1, 2022
732d716
Move `DurationSubsec` into `Operators` lint pass
Jarcho Jun 1, 2022
0adb3c0
Move `EqOp` into `Operators` lint pass
Jarcho Jun 1, 2022
3de70a4
Move `ErasingOp` into `Operators` lint pass
Jarcho Jun 1, 2022
56f50d3
Move `FloatEqualityWithoutAbs` into `Operators` lint pass
Jarcho Jun 1, 2022
83de67c
Move `IdentityOp` into `Operators` lint pass
Jarcho Jun 1, 2022
a8df16a
Move `IntegerDivision` into `Operators` lint pass
Jarcho Jun 1, 2022
c0b0ee5
Move some lints from `Misc` to `Operators`
Jarcho Jun 1, 2022
71c2daa
Move `ModuloArithmetic` into `Operators` lint pass
Jarcho Jun 1, 2022
fc5eac5
Move `NeedlessBitwiseBool` into `Operators` lint pass
Jarcho Jun 1, 2022
92891a0
Move `PtrEq` into `Operators` lin pass
Jarcho Jun 1, 2022
5e2a2d3
Fix dogfood
Jarcho Jun 14, 2022
ffbba85
Move `SelfAssignment` into `Operators` lint pass
Jarcho Jun 1, 2022
23c6765
Auto merge of #8921 - Jarcho:merge_passes, r=llogiq
bors Jun 28, 2022
a4130e1
Auto merge of #8355 - Jarcho:explicit_auto_deref_2, r=flip1995
bors Jun 28, 2022
4995b4e
Auto merge of #9046 - xFrednet:rust-97660-expection-something-somethi…
bors Jun 28, 2022
90227c1
Auto merge of #8981 - PrestonFrom:more_details_for_significant_drop_l…
bors Jun 29, 2022
70f1d0d
Auto merge of #9043 - dswij:9037-test, r=Manishearth
bors Jun 29, 2022
58434ae
Extract util functions from `redundant_pattern_match`
Jarcho Apr 8, 2022
adbc849
Don't lint `while_let_loop` when drop order would change
Jarcho Apr 8, 2022
5d75a9b
fix
tamaroning Jun 30, 2022
88591ba
Auto merge of #8666 - Jarcho:while_let_loop_7913, r=dswij
bors Jun 30, 2022
5d9e1b6
Update large_const_arrays.rs
tamaroning Jun 30, 2022
ff3964a
Auto merge of #9068 - tamaroning:fix-typo-2022-6-30, r=giraffate,xFre…
bors Jun 30, 2022
f26cf11
Merge remote-tracking branch 'upstream/master' into rustup
flip1995 Jun 30, 2022
bf9b39a
Fix dogfood
flip1995 Jun 30, 2022
d9b2e21
Bump nightly version -> 2022-06-30
flip1995 Jun 30, 2022
9de1f9f
Bump Clippy version -> 0.1.64
flip1995 Jun 30, 2022
0cb0f76
Auto merge of #9069 - flip1995:rustup, r=flip1995
bors Jun 30, 2022
721d53a
Merge commit '0cb0f7636851f9fcc57085cf80197a2ef6db098f' into clippyup
flip1995 Jun 30, 2022
5fead7a
Update Cargo.lock
flip1995 Jun 30, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ dependencies = [

[[package]]
name = "clippy"
version = "0.1.63"
version = "0.1.64"
dependencies = [
"clippy_lints",
"clippy_utils",
Expand All @@ -661,6 +661,7 @@ dependencies = [
"termize",
"tester",
"tokio",
"toml",
]

[[package]]
Expand All @@ -679,10 +680,9 @@ dependencies = [

[[package]]
name = "clippy_lints"
version = "0.1.63"
version = "0.1.64"
dependencies = [
"cargo_metadata",
"clippy_dev",
"clippy_utils",
"if_chain",
"itertools",
Expand All @@ -702,7 +702,7 @@ dependencies = [

[[package]]
name = "clippy_utils"
version = "0.1.63"
version = "0.1.64"
dependencies = [
"arrayvec",
"if_chain",
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/.github/workflows/remark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v1.4.4
with:
node-version: '12.x'
node-version: '14.x'

- name: Install remark
run: npm install remark-cli remark-lint remark-lint-maximum-line-length remark-preset-lint-recommended remark-gfm
Expand Down
5 changes: 5 additions & 0 deletions src/tools/clippy/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3348,6 +3348,7 @@ Released 2018-09-13
[`debug_assert_with_mut_call`]: https://rust-lang.github.io/rust-clippy/master/index.html#debug_assert_with_mut_call
[`decimal_literal_representation`]: https://rust-lang.github.io/rust-clippy/master/index.html#decimal_literal_representation
[`declare_interior_mutable_const`]: https://rust-lang.github.io/rust-clippy/master/index.html#declare_interior_mutable_const
[`default_instead_of_iter_empty`]: https://rust-lang.github.io/rust-clippy/master/index.html#default_instead_of_iter_empty
[`default_numeric_fallback`]: https://rust-lang.github.io/rust-clippy/master/index.html#default_numeric_fallback
[`default_trait_access`]: https://rust-lang.github.io/rust-clippy/master/index.html#default_trait_access
[`default_union_representation`]: https://rust-lang.github.io/rust-clippy/master/index.html#default_union_representation
Expand Down Expand Up @@ -3399,6 +3400,7 @@ Released 2018-09-13
[`expect_fun_call`]: https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call
[`expect_used`]: https://rust-lang.github.io/rust-clippy/master/index.html#expect_used
[`expl_impl_clone_on_copy`]: https://rust-lang.github.io/rust-clippy/master/index.html#expl_impl_clone_on_copy
[`explicit_auto_deref`]: https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref
[`explicit_counter_loop`]: https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop
[`explicit_deref_methods`]: https://rust-lang.github.io/rust-clippy/master/index.html#explicit_deref_methods
[`explicit_into_iter_loop`]: https://rust-lang.github.io/rust-clippy/master/index.html#explicit_into_iter_loop
Expand Down Expand Up @@ -3519,13 +3521,16 @@ Released 2018-09-13
[`manual_async_fn`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_async_fn
[`manual_bits`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_bits
[`manual_filter_map`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_filter_map
[`manual_find`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_find
[`manual_find_map`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_find_map
[`manual_flatten`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten
[`manual_map`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_map
[`manual_memcpy`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_memcpy
[`manual_non_exhaustive`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_non_exhaustive
[`manual_ok_or`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_ok_or
[`manual_range_contains`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains
[`manual_rem_euclid`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_rem_euclid
[`manual_retain`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_retain
[`manual_saturating_arithmetic`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_saturating_arithmetic
[`manual_split_once`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_split_once
[`manual_str_repeat`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_str_repeat
Expand Down
3 changes: 2 additions & 1 deletion src/tools/clippy/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "clippy"
version = "0.1.63"
version = "0.1.64"
description = "A bunch of helpful lints to avoid common pitfalls in Rust"
repository = "https://github.com/rust-lang/rust-clippy"
readme = "README.md"
Expand Down Expand Up @@ -31,6 +31,7 @@ termize = "0.1"
compiletest_rs = { version = "0.8", features = ["tmp"] }
tester = "0.9"
regex = "1.5"
toml = "0.5"
# This is used by the `collect-metadata` alias.
filetime = "0.2"

Expand Down
10 changes: 9 additions & 1 deletion src/tools/clippy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

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

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

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

Alternatively, the [`rust-version` field](https://doc.rust-lang.org/cargo/reference/manifest.html#the-rust-version-field)
in the `Cargo.toml` can be used.

```toml
# Cargo.toml
rust-version = "1.30"
```

The MSRV can also be specified as an inner attribute, like below.

```rust
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/book/src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
A collection of lints to catch common mistakes and improve your
[Rust](https://github.com/rust-lang/rust) code.

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

Lints are divided into categories, each with a default [lint
level](https://doc.rust-lang.org/rustc/lints/levels.html). You can choose how
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/clippy_dev/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2021"

[dependencies]
aho-corasick = "0.7"
clap = "3.1"
clap = "3.2"
indoc = "1.0"
itertools = "0.10.1"
opener = "0.5"
Expand Down
18 changes: 18 additions & 0 deletions src/tools/clippy/clippy_dev/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use clap::{Arg, ArgAction, ArgMatches, Command, PossibleValue};
use clippy_dev::{bless, fmt, lint, new_lint, serve, setup, update_lints};
use indoc::indoc;

fn main() {
let matches = get_clap_config();

Expand Down Expand Up @@ -85,6 +86,11 @@ fn main() {
let uplift = matches.contains_id("uplift");
update_lints::rename(old_name, new_name, uplift);
},
Some(("deprecate", matches)) => {
let name = matches.get_one::<String>("name").unwrap();
let reason = matches.get_one("reason");
update_lints::deprecate(name, reason);
},
_ => {},
}
}
Expand Down Expand Up @@ -266,6 +272,18 @@ fn get_clap_config() -> ArgMatches {
.long("uplift")
.help("This lint will be uplifted into rustc"),
]),
Command::new("deprecate").about("Deprecates the given lint").args([
Arg::new("name")
.index(1)
.required(true)
.help("The name of the lint to deprecate"),
Arg::new("reason")
.long("reason")
.short('r')
.required(false)
.takes_value(true)
.help("The reason for deprecation"),
]),
])
.get_matches()
}
2 changes: 1 addition & 1 deletion src/tools/clippy/clippy_dev/src/new_lint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ fn to_camel_case(name: &str) -> String {
.collect()
}

fn get_stabilization_version() -> String {
pub(crate) fn get_stabilization_version() -> String {
fn parse_manifest(contents: &str) -> Option<String> {
let version = contents
.lines()
Expand Down
Loading