Skip to content

Clippy subtree update #123465

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

Merged
merged 135 commits into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
135 commits
Select commit Hold shift + click to select a range
c36d5e3
Add MatchKind member to the Match expr for pretty printing & fmt
RossSmyth Feb 17, 2024
cbbb0ae
fix: allow-one-hash-in-raw-strings option of needless_raw_string_hash…
krtab Jan 5, 2024
4cbe42e
RFC: Document Clippy's teams and team duties
xFrednet Mar 11, 2024
7976657
Add `missing_transmute_annotation` lint
GuillaumeGomez Feb 7, 2024
f9a9c4b
Note that type param is chosen by caller when suggesting return impl …
jieyouxu Mar 9, 2024
b34afba
Apply pretty review comments =^.^=
xFrednet Mar 18, 2024
3930f8b
fix infinite loop when peeling unwrap method calls
y21 Mar 18, 2024
54d1260
Rename `hir::Let` into `hir::LetExpr`
GuillaumeGomez Mar 20, 2024
1dbabc1
Bless test fallout (duplicate diagnostics)
compiler-errors Mar 20, 2024
9022122
Replace closures with `_` when suggesting fully qualified path for me…
estebank Mar 20, 2024
e8794ff
Auto merge of #121123 - compiler-errors:item-assumptions, r=oli-obk
bors Mar 21, 2024
fb1b198
Rollup merge of #122799 - estebank:issue-122569, r=fee1-dead
matthiaskrgr Mar 21, 2024
87b9352
Correct version for incompatible_msrv
Manishearth Mar 21, 2024
bc0965e
Implement macro-based deref!() syntax for deref patterns
compiler-errors Mar 20, 2024
15da6e7
Mention `size_hint()` effect in `flat_map_option` lint documentation.
kpreid Mar 21, 2024
0e62b18
Merge commit '9d6f41691ed9dbfaec2a2df2661c42451f2fe0d3' into clippy-s…
flip1995 Mar 21, 2024
0c392d9
new lint `legacy_numeric_constants`
Centri3 Jun 20, 2023
75390b9
Rename AstConv to HIR ty lowering
fmease Mar 15, 2024
b7026f8
Update (doc) comments
fmease Feb 11, 2024
7c9fe30
Do not warn on .map(_::clone) for Arc, Rc, and their weak variants
samueltardieu Mar 21, 2024
fc053c3
Auto merge of #12522 - rust-lang:Manishearth-patch-1, r=xFrednet
bors Mar 22, 2024
a580b4e
Rollup merge of #121619 - RossSmyth:pfix_match, r=petrochenkov
matthiaskrgr Mar 22, 2024
879899c
Auto merge of #122869 - matthiaskrgr:rollup-0navj4l, r=matthiaskrgr
bors Mar 22, 2024
403433f
Auto merge of #12526 - kpreid:patch-2, r=blyxyas
bors Mar 22, 2024
f2020c8
Auto merge of #12508 - y21:issue12506, r=llogiq
bors Mar 22, 2024
b392e47
Remove unused dep `tester`
Alexendoo Mar 22, 2024
b5e7394
Auto merge of #12533 - Alexendoo:remove-tester, r=flip1995
bors Mar 22, 2024
2ffd133
Add necessary parentheses to `manual_unwrap_or_default` lint output
samueltardieu Mar 22, 2024
52b2a5e
Auto merge of #12529 - samueltardieu:issue-12528, r=y21
bors Mar 22, 2024
0b81086
Eagerly convert some ctors to use their specialized ctors
compiler-errors Mar 21, 2024
c92b350
Programmatically convert some of the pat ctors
compiler-errors Mar 21, 2024
f9ad628
And the tools too
compiler-errors Mar 21, 2024
6b04fc2
Fix clippy
compiler-errors Mar 21, 2024
a24d12b
Enable unused_qualifications lint
Alexendoo Mar 18, 2024
44a5eda
Auto merge of #12507 - Alexendoo:unused-qualifications, r=dswij
bors Mar 22, 2024
1c37a23
Rollup merge of #122195 - jieyouxu:impl-return-note, r=fmease
matthiaskrgr Mar 22, 2024
8b14a36
Rollup merge of #122839 - compiler-errors:predicate-polarity, r=lcnr
matthiaskrgr Mar 22, 2024
bd9efd5
Rename `hir::Local` into `hir::LetStmt`
GuillaumeGomez Mar 20, 2024
43a61e9
Rename `hir::Node::Local` into `hir::Node::LetStmt`
GuillaumeGomez Mar 22, 2024
c7bb200
Auto merge of #12532 - samueltardieu:issue-12531, r=llogiq
bors Mar 22, 2024
2d499d8
Fix typo in exhaustive_items.rs
JMoogs Mar 22, 2024
4a8c949
Auto merge of #12534 - JMoogs:patch-1, r=y21
bors Mar 22, 2024
02e11b9
Auto merge of #122900 - matthiaskrgr:rollup-nls90mb, r=matthiaskrgr
bors Mar 22, 2024
6b12829
Move `is_parent_stmt` to `clippy_utils`
samueltardieu Mar 23, 2024
c137c78
`manual_assert`: do not add extra semicolon
samueltardieu Mar 23, 2024
e5ece90
Auto merge of #119552 - krtab:dead_code_priv_mod_pub_field, r=cjgillo…
bors Mar 23, 2024
e9f25b3
add test cases for #12435
J-ZhengLi Mar 14, 2024
db41621
Auto merge of #12486 - J-ZhengLi:issue12435, r=y21
bors Mar 23, 2024
02fc256
Add `should_call_clone_as_function()` utility function
samueltardieu Mar 22, 2024
fed2f28
Do not rewrite `.as_ref().map(Arc::clone)` and similar
samueltardieu Mar 22, 2024
12f7c17
Auto merge of #12535 - samueltardieu:issue-12528, r=y21
bors Mar 23, 2024
4d62301
rename MIR int2ptr casts to match library name
RalfJung Mar 23, 2024
21a6f0c
Rollup merge of #122780 - GuillaumeGomez:rename-hir-local, r=oli-obk
matthiaskrgr Mar 23, 2024
5919b26
move assert_unsafe_preconditions to its own file
RalfJung Mar 17, 2024
47265ad
Auto merge of #122629 - RalfJung:assert-unsafe-precondition, r=saethlin
bors Mar 23, 2024
8e04961
Add ui test for `missing_transmute_annotations`
GuillaumeGomez Feb 19, 2024
ffa1279
Correctly handle `transmute` as return value from `block` and `let va…
GuillaumeGomez Feb 25, 2024
ee25582
Do no emit `missing_transmute_annotations` lint if the `transmute` is…
GuillaumeGomez Mar 15, 2024
95c62ff
Auto merge of #12239 - GuillaumeGomez:missing_transmute_annotation, r…
bors Mar 24, 2024
0cf9d9c
restrict manual_clamp to const case, bring it out of nursery
Xaeroxe Mar 24, 2024
94fe2fa
Remove `unwrap` from `match_trait_method`
PartiallyUntyped Mar 24, 2024
733c7af
Rename `{enter,exit}_lint_attrs` to `check_attributes{,_post}`
Alexendoo Mar 24, 2024
f2e91ab
match syms, remove lint_reasons
pitaj Mar 24, 2024
2a62200
fix: suspicious_else_formatting false positive when else is included …
granddaifuku Mar 24, 2024
dafb7f6
Change applicability of `assigning_clones` to `Unspecified`
Kobzol Mar 25, 2024
b9da637
Refine the logic to accurately assess if 'else' resides within comments
granddaifuku Mar 25, 2024
e0b6f30
Remove unnecessary dot in the 'unconditional recursion' lint description
stanislav-tkach Mar 25, 2024
be27f68
Auto merge of #12557 - stanislav-tkach:unconditional-recursion-remove…
bors Mar 25, 2024
c3948d1
Auto merge of #12549 - granddaifuku:fix/suspicious_else_formatting-fa…
bors Mar 25, 2024
9e82ad8
[`let_and_return`]: avoid linting when `#[cfg]` attributes are present
y21 Mar 25, 2024
4ef57d3
Auto merge of #12558 - y21:issue9150, r=xFrednet
bors Mar 25, 2024
b1b7352
Auto merge of #12536 - samueltardieu:issue-12505, r=Manishearth
bors Mar 25, 2024
ca6a647
Auto merge of #12554 - Kobzol:assigning-clones-unspecified, r=blyxyas
bors Mar 25, 2024
9655231
Allow `filter_map_identity` when the closure is typed
PartiallyUntyped Mar 25, 2024
805ef35
Auto merge of #12540 - m-rph:12366, r=blyxyas
bors Mar 25, 2024
13ef845
Auto merge of #12481 - xFrednet:add-team-docs, r=flip1995
bors Mar 26, 2024
e3f3a4b
Don't emit `duplicated_attribute` lint on "complex" `cfg`s
GuillaumeGomez Mar 25, 2024
b8b9b27
Auto merge of #12555 - GuillaumeGomez:duplicated_attribute, r=blyxyas
bors Mar 26, 2024
aecdb92
short circuit logic better
Xaeroxe Mar 26, 2024
4d7d664
the power of if let chain compels you
Xaeroxe Mar 26, 2024
57627d2
Change `f16` and `f128` clippy stubs to be nonpanicking
tgross35 Mar 26, 2024
60937bf
:adjust applicability for typed identity closures in `filter_map_iden…
PartiallyUntyped Mar 26, 2024
a6a1f78
Inherited -> TypeckRootCtxt
compiler-errors Mar 26, 2024
4b10cb2
Rollup merge of #123103 - compiler-errors:inherited-is-a-weird-name, …
matthiaskrgr Mar 26, 2024
91f3fad
check for init expr when linting [`question_mark`]
J-ZhengLi Mar 27, 2024
c27f52d
allow [`manual_unwrap_or_default`] in const function
J-ZhengLi Mar 27, 2024
5b95e90
move `mixed_attributes_style` to the style category
y21 Mar 27, 2024
014230c
Auto merge of #12572 - y21:mixed_attributes_style_style, r=llogiq
bors Mar 27, 2024
11b28d4
Implement `mut ref`/`mut ref mut`
Jules-Bertholet Mar 24, 2024
124e68b
Auto merge of #12570 - J-ZhengLi:issue12569, r=Jarcho
bors Mar 28, 2024
0164645
`large_stack_frames`: print total size and largest component.
kpreid Mar 28, 2024
7aac504
Fix typo in comment
Mar 29, 2024
97ba291
Auto merge of #12582 - kpreid:stacksize, r=Manishearth
bors Mar 29, 2024
89588f4
Add limitations section, move check
Xaeroxe Mar 29, 2024
d928657
Auto merge of #12587 - shandongbinzhou:master, r=Jarcho
bors Mar 29, 2024
971e435
Auto merge of #12543 - Xaeroxe:manual-clamp-const, r=xFrednet,Guillau…
bors Mar 29, 2024
37be3e4
[`type_id_on_box`]: lint of `Any` subtraits
y21 Aug 18, 2023
5750e46
fix [`manual_unwrap_or_default`] suggestion ignoring side-effects
J-ZhengLi Mar 30, 2024
88d842e
Auto merge of #12579 - J-ZhengLi:issue12569, r=Alexendoo
bors Mar 30, 2024
e0e7ee1
Auto merge of #12563 - J-ZhengLi:issue11513, r=Alexendoo
bors Mar 30, 2024
cebf879
Auto merge of #12312 - pitaj:legacy_numeric_constants, r=xFrednet
bors Mar 30, 2024
36e4c20
lint on any `Box<dyn _>`, but provide a suggestion for subtypes of `d…
y21 Mar 30, 2024
f6c0063
split up tests into fixable and unfixable now and add annotations
y21 Mar 30, 2024
3787a0c
Auto merge of #11350 - y21:issue11349, r=xFrednet
bors Mar 30, 2024
797d50d
Auto merge of #12562 - m-rph:12501, r=y21
bors Mar 31, 2024
0f63fa8
Move box_default to style, do not suggest turbofishes
Alexendoo Mar 31, 2024
cb87a57
Auto merge of #12601 - Alexendoo:box-default-style, r=llogiq
bors Apr 1, 2024
17a61b2
Ignore `rustc-ice-` files
xFrednet Apr 1, 2024
eee4db9
Replace elided variable in `let_unit` with `()` when used
PartiallyUntyped Mar 31, 2024
bd4d456
accept Into<{Sub}DiagMessage> in span_lint functions
y21 Mar 23, 2024
91f514c
fix fallout from previous commit
y21 Mar 23, 2024
c2681f2
Auto merge of #12453 - y21:span_lint_into_diag, r=blyxyas
bors Apr 1, 2024
24d20b4
Set `RUSTC_ICE=0` in uitests and `cargo dev lint`
xFrednet Apr 1, 2024
41e814a
Auto merge of #12605 - xFrednet:00000-ignore-ice, r=y21
bors Apr 1, 2024
b456ed3
fix suggestion for [`len_zero`] with macros
J-ZhengLi Apr 1, 2024
2b30a59
Auto merge of #11996 - J-ZhengLi:issue11992, r=xFrednet,ARandomDev99
bors Apr 1, 2024
989f04d
pause review rotation for y21
y21 Apr 1, 2024
95c45be
Auto merge of #12603 - m-rph:12594, r=Manishearth
bors Apr 1, 2024
3b1b654
Auto merge of #12613 - y21:vacation, r=dswij
bors Apr 1, 2024
e575f05
avoid an ICE in `ptr_as_ptr` when getting the def_id of a local
y21 Apr 2, 2024
0478d26
FIX(12334): manual_swap auto fix
Apr 2, 2024
f9f854f
Auto merge of #12617 - y21:issue-12616, r=Alexendoo
bors Apr 2, 2024
e530b3d
Rollup merge of #122935 - RalfJung:with-exposed-provenance, r=Amanieu
jhpratt Apr 3, 2024
53e31dc
rename `expose_addr` to `expose_provenance`
joboet Apr 3, 2024
b6486fa
add missing links in development guide
franciscoBSalgueiro Apr 3, 2024
571118f
Do not suggest `assigning_clones` in `Clone` impl
Kobzol Apr 2, 2024
e80ca2f
Auto merge of #12615 - Kobzol:fix-recursive-clone-from, r=blyxyas
bors Apr 3, 2024
398a52a
Auto merge of #12340 - not-elm:fix/issue-12334, r=llogiq
bors Apr 4, 2024
5a9e9b0
Auto merge of #12628 - franciscoBSalgueiro:fix-book-links, r=flip1995
bors Apr 4, 2024
277303b
Merge remote-tracking branch 'upstream/master' into rustup
flip1995 Apr 4, 2024
bb023e9
Bump nightly version -> 2024-04-04
flip1995 Apr 4, 2024
9725c4a
Auto merge of #12632 - flip1995:rustup, r=flip1995
bors Apr 4, 2024
eedf15a
Merge commit '9725c4a162502a02c1c67fdca6b797fe09b2b73c' into clippy-s…
flip1995 Apr 4, 2024
a809a72
Update Cargo.lock
flip1995 Apr 4, 2024
5d66521
use `Lrc` instead of the aliased type `Arc` directly
y21 Apr 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
14 changes: 0 additions & 14 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,6 @@ dependencies = [
"syn 2.0.55",
"tempfile",
"termize",
"tester",
"tokio",
"toml 0.7.8",
"ui_test 0.22.2",
Expand Down Expand Up @@ -5508,19 +5507,6 @@ dependencies = [
"std",
]

[[package]]
name = "tester"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "89e8bf7e0eb2dd7b4228cc1b6821fc5114cd6841ae59f652a85488c016091e5f"
dependencies = [
"cfg-if",
"getopts",
"libc",
"num_cpus",
"term",
]

[[package]]
name = "thin-vec"
version = "0.2.13"
Expand Down
3 changes: 3 additions & 0 deletions src/tools/clippy/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Generated by ui-test
rustc-ice-*

# Used by CI to be able to push:
/.github/deploy_key
out
Expand Down
2 changes: 2 additions & 0 deletions src/tools/clippy/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5379,6 +5379,7 @@ Released 2018-09-13
[`large_stack_arrays`]: https://rust-lang.github.io/rust-clippy/master/index.html#large_stack_arrays
[`large_stack_frames`]: https://rust-lang.github.io/rust-clippy/master/index.html#large_stack_frames
[`large_types_passed_by_value`]: https://rust-lang.github.io/rust-clippy/master/index.html#large_types_passed_by_value
[`legacy_numeric_constants`]: https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
[`len_without_is_empty`]: https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty
[`len_zero`]: https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
[`let_and_return`]: https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
Expand Down Expand Up @@ -5481,6 +5482,7 @@ Released 2018-09-13
[`missing_safety_doc`]: https://rust-lang.github.io/rust-clippy/master/index.html#missing_safety_doc
[`missing_spin_loop`]: https://rust-lang.github.io/rust-clippy/master/index.html#missing_spin_loop
[`missing_trait_methods`]: https://rust-lang.github.io/rust-clippy/master/index.html#missing_trait_methods
[`missing_transmute_annotations`]: https://rust-lang.github.io/rust-clippy/master/index.html#missing_transmute_annotations
[`mistyped_literal_suffixes`]: https://rust-lang.github.io/rust-clippy/master/index.html#mistyped_literal_suffixes
[`mixed_attributes_style`]: https://rust-lang.github.io/rust-clippy/master/index.html#mixed_attributes_style
[`mixed_case_hex_literals`]: https://rust-lang.github.io/rust-clippy/master/index.html#mixed_case_hex_literals
Expand Down
1 change: 0 additions & 1 deletion src/tools/clippy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ anstream = "0.6.0"

[dev-dependencies]
ui_test = "0.22.2"
tester = "0.9"
regex = "1.5.5"
toml = "0.7.3"
walkdir = "2.3"
Expand Down
1 change: 1 addition & 0 deletions src/tools/clippy/book/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@
- [Proposals](development/proposals/README.md)
- [Roadmap 2021](development/proposals/roadmap-2021.md)
- [Syntax Tree Patterns](development/proposals/syntax-tree-patterns.md)
- [The Team](development/the_team.md)
9 changes: 4 additions & 5 deletions src/tools/clippy/book/src/development/defining_lints.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,8 @@ $ cargo dev new_lint --name=lint_name --pass=late --category=pedantic
There are two things to note here:

1. `--pass`: We set `--pass=late` in this command to do a late lint pass. The
alternative is an `early` lint pass. We will discuss this difference in a
later chapter.
<!-- FIXME: Link that "later chapter" when lint_passes.md is merged -->
alternative is an `early` lint pass. We will discuss this difference in the
[Lint Passes] chapter.
2. `--category`: If not provided, the `category` of this new lint will default
to `nursery`.

Expand Down Expand Up @@ -194,12 +193,12 @@ store.register_late_pass(|_| Box::new(foo_functions::FooFunctions));

As you might have guessed, where there's something late, there is something
early: in Clippy there is a `register_early_pass` method as well. More on early
vs. late passes in a later chapter.
<!-- FIXME: Link that "later chapter" when lint_passes.md is merged -->
vs. late passes in the [Lint Passes] chapter.

Without a call to one of `register_early_pass` or `register_late_pass`, the lint
pass in question will not be run.


[all_lints]: https://rust-lang.github.io/rust-clippy/master/
[lint_naming]: https://rust-lang.github.io/rfcs/0344-conventions-galore.html#lints
[Lint Passes]: lint_passes.md
2 changes: 1 addition & 1 deletion src/tools/clippy/book/src/development/lint_passes.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ questions already, but the parser is okay with it. This is what we
mean when we say `EarlyLintPass` deals with only syntax on the AST level.

Alternatively, think of the `foo_functions` lint we mentioned in
define new lints <!-- FIXME: add link --> chapter.
the [Define New Lints](defining_lints.md) chapter.

We want the `foo_functions` lint to detect functions with `foo` as their name.
Writing a lint that only checks for the name of a function means that we only
Expand Down
130 changes: 130 additions & 0 deletions src/tools/clippy/book/src/development/the_team.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# The team

Everyone who contributes to Clippy makes the project what it is. Collaboration
and discussions are the lifeblood of every open-source project. Clippy has a
very flat hierarchy. The teams mainly have additional access rights to the repo.

This document outlines the onboarding process, as well as duties, and access
rights for members of a group.

All regular events mentioned in this chapter are tracked in the [calendar repository].
The calendar file is also available for download: [clippy.ics]

## Everyone

Everyone, including you, is welcome to join discussions and contribute in other
ways, like PRs.

You also have some triage rights, using `@rustbot` to add labels and claim
issues. See [labeling with @rustbot].

A rule for everyone should be to keep a healthy work-life balance. Take a break
when you need one.

## Clippy-Contributors

This is a group of regular contributors to Clippy to help with triaging.

### Duties

This team exists to make contributing easier for regular members. It doesn't
carry any duties that need to be done. However, we want to encourage members of
this group to help with triaging, which can include:

1. **Labeling issues**

For the `good-first-issue` label, it can still be good to use `@rustbot` to
subscribe to the issue and help interested parties, if they post questions
in the comments.

2. **Closing duplicate or resolved issues**

When you manually close an issue, it's often a good idea, to add a short
comment explaining the reason.

3. **Ping people after two weeks of inactivity**

We try to keep issue assignments and PRs fairly up-to-date. After two weeks,
it can be good to send a friendly ping to the delaying party.

You might close a PR with the `I-inactive-closed` label if the author is
busy or wants to abandon it. If the reviewer is busy, the PR can be
reassigned to someone else.

Checkout: https://triage.rust-lang.org/triage/rust-lang/rust-clippy to
monitor PRs.

While not part of their duties, contributors are encouraged to review PRs
and help on Zulip. The team always appreciates help!

### Membership

If you have been contributing to Clippy for some time, we'll probably ask you if
you want to join this team. Members of this team are also welcome to suggest
people who they think would make a great addition to this group.

For this group, there is no direct onboarding process. You're welcome to just
continue what you've been doing. If you like, you can ask for someone to mentor
you, either in the Clippy stream on Zulip or privately via a PM.

If you have been inactive in Clippy for over three months, we'll probably move
you to the alumni group. You're always welcome to come back.

## The Clippy Team

[The Clippy team](https://www.rust-lang.org/governance/teams/dev-tools#Clippy%20team)
is responsible for maintaining Clippy.

### Duties

1. **Respond to PRs in a timely manner**

It's totally fine, if you don't have the time for reviews right now.
You can reassign the PR to a random member by commenting `r? clippy`.

2. **Take a break when you need one**

You are valuable! Clippy wouldn't be what it is without you. So take a break
early and recharge some energy when you need to.

3. **Be responsive on Zulip**

This means in a reasonable time frame, so responding within one or two days
is totally fine.

It's also good, if you answer threads on Zulip and take part in our Clippy
meetings, every two weeks. The meeting dates are tracked in the [calendar repository].


4. **Sync Clippy with the rust-lang/rust repo**

This is done every two weeks, usually by @flip1995.

5. **Update the changelog**

This needs to be done for every release, every six weeks. This is usually
done by @xFrednet.

### Membership

If you have been active for some time, we'll probably reach out and ask
if you want to help with reviews and eventually join the Clippy team.

During the onboarding process, you'll be assigned pull requests to review.
You'll also have an active team member as a mentor who'll stay in contact via
Zulip DMs to provide advice and feedback. If you have questions, you're always
welcome to ask, that is the best way to learn. Once you're done with the review,
you can ping your mentor for a full review and to r+ the PR in both of your names.

When your mentor is confident that you can handle reviews on your own, they'll
start an informal vote among the active team members to officially add you to
the team. This vote is usually accepted unanimously. Then you'll be added to
the team once you've confirmed that you're still interested in joining. The
onboarding phase typically takes a couple of weeks to a few months.

If you have been inactive in Clippy for over three months, we'll probably move
you to the alumni group. You're always welcome to come back.

[calendar repository]: https://github.com/rust-lang/calendar/blob/main/clippy.toml
[clippy.ics]: https://rust-lang.github.io/calendar/clippy.ics
[labeling with @rustbot]: https://forge.rust-lang.org/triagebot/labeling.html
1 change: 1 addition & 0 deletions src/tools/clippy/book/src/lint_configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,7 @@ The minimum rust version that the project supports. Defaults to the `rust-versio
* [`if_then_some_else_none`](https://rust-lang.github.io/rust-clippy/master/index.html#if_then_some_else_none)
* [`index_refutable_slice`](https://rust-lang.github.io/rust-clippy/master/index.html#index_refutable_slice)
* [`iter_kv_map`](https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map)
* [`legacy_numeric_constants`](https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants)
* [`manual_bits`](https://rust-lang.github.io/rust-clippy/master/index.html#manual_bits)
* [`manual_c_str_literals`](https://rust-lang.github.io/rust-clippy/master/index.html#manual_c_str_literals)
* [`manual_clamp`](https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp)
Expand Down
7 changes: 1 addition & 6 deletions src/tools/clippy/clippy_config/src/conf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ define_Conf! {
///
/// Suppress lints whenever the suggested change would cause breakage for other crates.
(avoid_breaking_exported_api: bool = true),
/// Lint: MANUAL_SPLIT_ONCE, MANUAL_STR_REPEAT, CLONED_INSTEAD_OF_COPIED, REDUNDANT_FIELD_NAMES, OPTION_MAP_UNWRAP_OR, REDUNDANT_STATIC_LIFETIMES, FILTER_MAP_NEXT, CHECKED_CONVERSIONS, MANUAL_RANGE_CONTAINS, USE_SELF, MEM_REPLACE_WITH_DEFAULT, MANUAL_NON_EXHAUSTIVE, OPTION_AS_REF_DEREF, MAP_UNWRAP_OR, MATCH_LIKE_MATCHES_MACRO, MANUAL_STRIP, MISSING_CONST_FOR_FN, UNNESTED_OR_PATTERNS, FROM_OVER_INTO, PTR_AS_PTR, IF_THEN_SOME_ELSE_NONE, APPROX_CONSTANT, DEPRECATED_CFG_ATTR, INDEX_REFUTABLE_SLICE, MAP_CLONE, BORROW_AS_PTR, MANUAL_BITS, ERR_EXPECT, CAST_ABS_TO_UNSIGNED, UNINLINED_FORMAT_ARGS, MANUAL_CLAMP, MANUAL_LET_ELSE, UNCHECKED_DURATION_SUBTRACTION, COLLAPSIBLE_STR_REPLACE, SEEK_FROM_CURRENT, SEEK_REWIND, UNNECESSARY_LAZY_EVALUATIONS, TRANSMUTE_PTR_TO_REF, ALMOST_COMPLETE_RANGE, NEEDLESS_BORROW, DERIVABLE_IMPLS, MANUAL_IS_ASCII_CHECK, MANUAL_REM_EUCLID, MANUAL_RETAIN, TYPE_REPETITION_IN_BOUNDS, TUPLE_ARRAY_CONVERSIONS, MANUAL_TRY_FOLD, MANUAL_HASH_ONE, ITER_KV_MAP, MANUAL_C_STR_LITERALS, ASSIGNING_CLONES.
/// Lint: MANUAL_SPLIT_ONCE, MANUAL_STR_REPEAT, CLONED_INSTEAD_OF_COPIED, REDUNDANT_FIELD_NAMES, OPTION_MAP_UNWRAP_OR, REDUNDANT_STATIC_LIFETIMES, FILTER_MAP_NEXT, CHECKED_CONVERSIONS, MANUAL_RANGE_CONTAINS, USE_SELF, MEM_REPLACE_WITH_DEFAULT, MANUAL_NON_EXHAUSTIVE, OPTION_AS_REF_DEREF, MAP_UNWRAP_OR, MATCH_LIKE_MATCHES_MACRO, MANUAL_STRIP, MISSING_CONST_FOR_FN, UNNESTED_OR_PATTERNS, FROM_OVER_INTO, PTR_AS_PTR, IF_THEN_SOME_ELSE_NONE, APPROX_CONSTANT, DEPRECATED_CFG_ATTR, INDEX_REFUTABLE_SLICE, MAP_CLONE, BORROW_AS_PTR, MANUAL_BITS, ERR_EXPECT, CAST_ABS_TO_UNSIGNED, UNINLINED_FORMAT_ARGS, MANUAL_CLAMP, MANUAL_LET_ELSE, UNCHECKED_DURATION_SUBTRACTION, COLLAPSIBLE_STR_REPLACE, SEEK_FROM_CURRENT, SEEK_REWIND, UNNECESSARY_LAZY_EVALUATIONS, TRANSMUTE_PTR_TO_REF, ALMOST_COMPLETE_RANGE, NEEDLESS_BORROW, DERIVABLE_IMPLS, MANUAL_IS_ASCII_CHECK, MANUAL_REM_EUCLID, MANUAL_RETAIN, TYPE_REPETITION_IN_BOUNDS, TUPLE_ARRAY_CONVERSIONS, MANUAL_TRY_FOLD, MANUAL_HASH_ONE, ITER_KV_MAP, MANUAL_C_STR_LITERALS, ASSIGNING_CLONES, LEGACY_NUMERIC_CONSTANTS.
///
/// The minimum rust version that the project supports. Defaults to the `rust-version` field in `Cargo.toml`
#[default_text = ""]
Expand Down Expand Up @@ -856,11 +856,6 @@ mod tests {
}
}

assert!(
names.remove("allow-one-hash-in-raw-strings"),
"remove this when #11481 is fixed"
);

assert!(
names.is_empty(),
"Configuration variable lacks test: {names:?}\nAdd a test to `tests/ui-toml`"
Expand Down
8 changes: 7 additions & 1 deletion src/tools/clippy/clippy_config/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
#![feature(rustc_private, let_chains)]
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
#![warn(rust_2018_idioms, unused_lifetimes)]
#![warn(
trivial_casts,
trivial_numeric_casts,
rust_2018_idioms,
unused_lifetimes,
unused_qualifications
)]
#![allow(
clippy::must_use_candidate,
clippy::missing_panics_doc,
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/clippy_config/src/msrvs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ msrv_aliases! {
1,47,0 { TAU, IS_ASCII_DIGIT_CONST, ARRAY_IMPL_ANY_LEN }
1,46,0 { CONST_IF_MATCH }
1,45,0 { STR_STRIP_PREFIX }
1,43,0 { LOG2_10, LOG10_2 }
1,43,0 { LOG2_10, LOG10_2, NUMERIC_ASSOCIATED_CONSTANTS }
1,42,0 { MATCHES_MACRO, SLICE_PATTERNS, PTR_SLICE_RAW_PARTS }
1,41,0 { RE_REBALANCING_COHERENCE, RESULT_MAP_OR_ELSE }
1,40,0 { MEM_TAKE, NON_EXHAUSTIVE, OPTION_AS_DEREF }
Expand Down
9 changes: 7 additions & 2 deletions src/tools/clippy/clippy_dev/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@
#![feature(let_chains)]
#![feature(rustc_private)]
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
// warn on lints, that are included in `rust-lang/rust`s bootstrap
#![warn(rust_2018_idioms, unused_lifetimes)]
#![warn(
trivial_casts,
trivial_numeric_casts,
rust_2018_idioms,
unused_lifetimes,
unused_qualifications
)]

// The `rustc_driver` crate seems to be required in order to use the `rust_lexer` crate.
#[allow(unused_extern_crates)]
Expand Down
4 changes: 4 additions & 0 deletions src/tools/clippy/clippy_dev/src/lint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ pub fn run<'a>(path: &str, args: impl Iterator<Item = &'a String>) {
.args(["--edition", "2021"])
.arg(path)
.args(args)
// Prevent rustc from creating `rustc-ice-*` files the console output is enough.
.env("RUSTC_ICE", "0")
.status(),
);
} else {
Expand All @@ -32,6 +34,8 @@ pub fn run<'a>(path: &str, args: impl Iterator<Item = &'a String>) {
let status = Command::new(cargo_clippy_path())
.arg("clippy")
.args(args)
// Prevent rustc from creating `rustc-ice-*` files the console output is enough.
.env("RUSTC_ICE", "0")
.current_dir(path)
.status();

Expand Down
4 changes: 2 additions & 2 deletions src/tools/clippy/clippy_dev/src/update_lints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,7 @@ fn replace_region_in_text<'a>(
}

fn try_rename_file(old_name: &Path, new_name: &Path) -> bool {
match fs::OpenOptions::new().create_new(true).write(true).open(new_name) {
match OpenOptions::new().create_new(true).write(true).open(new_name) {
Ok(file) => drop(file),
Err(e) if matches!(e.kind(), io::ErrorKind::AlreadyExists | io::ErrorKind::NotFound) => return false,
Err(e) => panic_file(e, new_name, "create"),
Expand All @@ -1016,7 +1016,7 @@ fn panic_file(error: io::Error, name: &Path, action: &str) -> ! {
}

fn rewrite_file(path: &Path, f: impl FnOnce(&str) -> Option<String>) {
let mut file = fs::OpenOptions::new()
let mut file = OpenOptions::new()
.write(true)
.read(true)
.open(path)
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/clippy_lints/src/approx_const.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ impl ApproxConstant {
cx,
APPROX_CONSTANT,
e.span,
&format!("approximate value of `{module}::consts::{}` found", &name),
format!("approximate value of `{module}::consts::{}` found", &name),
None,
"consider using the constant directly",
);
Expand Down
4 changes: 2 additions & 2 deletions src/tools/clippy/clippy_lints/src/asm_syntax.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ fn check_asm_syntax(
cx,
lint,
span,
&format!("{style} x86 assembly syntax used"),
format!("{style} x86 assembly syntax used"),
None,
&format!("use {} x86 assembly syntax", !style),
format!("use {} x86 assembly syntax", !style),
);
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/tools/clippy/clippy_lints/src/assertions_on_constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ impl<'tcx> LateLintPass<'tcx> for AssertionsOnConstants {
cx,
ASSERTIONS_ON_CONSTANTS,
macro_call.span,
&format!(
format!(
"`{}!(true)` will be optimized out by the compiler",
cx.tcx.item_name(macro_call.def_id)
),
Expand All @@ -74,9 +74,9 @@ impl<'tcx> LateLintPass<'tcx> for AssertionsOnConstants {
cx,
ASSERTIONS_ON_CONSTANTS,
macro_call.span,
&format!("`assert!(false{assert_arg})` should probably be replaced"),
format!("`assert!(false{assert_arg})` should probably be replaced"),
None,
&format!("use `panic!({panic_arg})` or `unreachable!({panic_arg})`"),
format!("use `panic!({panic_arg})` or `unreachable!({panic_arg})`"),
);
}
}
Expand Down
Loading
Loading