Skip to content

Commit 89f3e76

Browse files
committed
chore: merge changes from upstream
2 parents 7fd6b8f + 213003b commit 89f3e76

File tree

1,476 files changed

+19225
-23890
lines changed

Some content is hidden

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

1,476 files changed

+19225
-23890
lines changed

.github/workflows/clippy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ env:
2525
CARGO_TARGET_DIR: '${{ github.workspace }}/target'
2626
NO_FMT_TEST: 1
2727
CARGO_INCREMENTAL: 0
28+
CARGO_UNSTABLE_SPARSE_REGISTRY: true
2829

2930
jobs:
3031
base:

.github/workflows/clippy_bors.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ env:
1111
CARGO_TARGET_DIR: '${{ github.workspace }}/target'
1212
NO_FMT_TEST: 1
1313
CARGO_INCREMENTAL: 0
14+
CARGO_UNSTABLE_SPARSE_REGISTRY: true
1415

1516
defaults:
1617
run:

.github/workflows/clippy_dev.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ on:
1515

1616
env:
1717
RUST_BACKTRACE: 1
18+
CARGO_INCREMENTAL: 0
19+
CARGO_UNSTABLE_SPARSE_REGISTRY: true
1820

1921
jobs:
2022
clippy_dev:

CHANGELOG.md

Lines changed: 162 additions & 3 deletions
Large diffs are not rendered by default.

CODE_OF_CONDUCT.md

Lines changed: 1 addition & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,3 @@
11
# The Rust Code of Conduct
22

3-
A version of this document [can be found online](https://www.rust-lang.org/conduct.html).
4-
5-
## Conduct
6-
7-
**Contact**: [rust-mods@rust-lang.org](mailto:rust-mods@rust-lang.org)
8-
9-
* We are committed to providing a friendly, safe and welcoming environment for all, regardless of level of experience,
10-
gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age,
11-
religion, nationality, or other similar characteristic.
12-
* On IRC, please avoid using overtly sexual nicknames or other nicknames that might detract from a friendly, safe and
13-
welcoming environment for all.
14-
* Please be kind and courteous. There's no need to be mean or rude.
15-
* Respect that people have differences of opinion and that every design or implementation choice carries a trade-off and
16-
numerous costs. There is seldom a right answer.
17-
* Please keep unstructured critique to a minimum. If you have solid ideas you want to experiment with, make a fork and
18-
see how it works.
19-
* We will exclude you from interaction if you insult, demean or harass anyone. That is not welcome behavior. We
20-
interpret the term "harassment" as including the definition in the <a href="http://citizencodeofconduct.org/">Citizen
21-
Code of Conduct</a>; if you have any lack of clarity about what might be included in that concept, please read their
22-
definition. In particular, we don't tolerate behavior that excludes people in socially marginalized groups.
23-
* Private harassment is also unacceptable. No matter who you are, if you feel you have been or are being harassed or
24-
made uncomfortable by a community member, please contact one of the channel ops or any of the [Rust moderation
25-
team][mod_team] immediately. Whether you're a regular contributor or a newcomer, we care about making this community a
26-
safe place for you and we've got your back.
27-
* Likewise any spamming, trolling, flaming, baiting or other attention-stealing behavior is not welcome.
28-
29-
## Moderation
30-
31-
32-
These are the policies for upholding our community's standards of conduct. If you feel that a thread needs moderation,
33-
please contact the [Rust moderation team][mod_team].
34-
35-
1. Remarks that violate the Rust standards of conduct, including hateful, hurtful, oppressive, or exclusionary remarks,
36-
are not allowed. (Cursing is allowed, but never targeting another user, and never in a hateful manner.)
37-
2. Remarks that moderators find inappropriate, whether listed in the code of conduct or not, are also not allowed.
38-
3. Moderators will first respond to such remarks with a warning.
39-
4. If the warning is unheeded, the user will be "kicked," i.e., kicked out of the communication channel to cool off.
40-
5. If the user comes back and continues to make trouble, they will be banned, i.e., indefinitely excluded.
41-
6. Moderators may choose at their discretion to un-ban the user if it was a first offense and they offer the offended
42-
party a genuine apology.
43-
7. If a moderator bans someone and you think it was unjustified, please take it up with that moderator, or with a
44-
different moderator, **in private**. Complaints about bans in-channel are not allowed.
45-
8. Moderators are held to a higher standard than other community members. If a moderator creates an inappropriate
46-
situation, they should expect less leeway than others.
47-
48-
In the Rust community we strive to go the extra step to look out for each other. Don't just aim to be technically
49-
unimpeachable, try to be your best self. In particular, avoid flirting with offensive or sensitive issues, particularly
50-
if they're off-topic; this all too often leads to unnecessary fights, hurt feelings, and damaged trust; worse, it can
51-
drive people away from the community entirely.
52-
53-
And if someone takes issue with something you said or did, resist the urge to be defensive. Just stop doing what it was
54-
they complained about and apologize. Even if you feel you were misinterpreted or unfairly accused, chances are good
55-
there was something you could've communicated better — remember that it's your responsibility to make your fellow
56-
Rustaceans comfortable. Everyone wants to get along and we are all here first and foremost because we want to talk about
57-
cool technology. You will find that people will be eager to assume good intent and forgive as long as you earn their
58-
trust.
59-
60-
The enforcement policies listed above apply to all official Rust venues; including official IRC channels (#rust,
61-
#rust-internals, #rust-tools, #rust-libs, #rustc, #rust-beginners, #rust-docs, #rust-community, #rust-lang, and #cargo);
62-
GitHub repositories under rust-lang, rust-lang-nursery, and rust-lang-deprecated; and all forums under rust-lang.org
63-
(users.rust-lang.org, internals.rust-lang.org). For other projects adopting the Rust Code of Conduct, please contact the
64-
maintainers of those projects for enforcement. If you wish to use this code of conduct for your own project, consider
65-
explicitly mentioning your moderation policy or making a copy with your own moderation policy so as to avoid confusion.
66-
67-
*Adapted from the [Node.js Policy on Trolling](http://blog.izs.me/post/30036893703/policy-on-trolling) as well as the
68-
[Contributor Covenant v1.3.0](https://www.contributor-covenant.org/version/1/3/0/).*
69-
70-
[mod_team]: https://www.rust-lang.org/team.html#Moderation-team
3+
The Code of Conduct for this repository [can be found online](https://www.rust-lang.org/conduct.html).

CONTRIBUTING.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,14 @@ All contributors are expected to follow the [Rust Code of Conduct].
2323
- [Issue and PR triage](#issue-and-pr-triage)
2424
- [Bors and Homu](#bors-and-homu)
2525
- [Contributions](#contributions)
26+
- [License](#license)
2627

2728
[Zulip]: https://rust-lang.zulipchat.com/#narrow/stream/clippy
2829
[Rust Code of Conduct]: https://www.rust-lang.org/policies/code-of-conduct
2930

3031
## The Clippy book
3132

32-
If you're new to Clippy and don't know where to start the [Clippy book] includes
33+
If you're new to Clippy and don't know where to start, the [Clippy book] includes
3334
a [developer guide] and is a good place to start your journey.
3435

3536
[Clippy book]: https://doc.rust-lang.org/nightly/clippy/index.html
@@ -245,6 +246,38 @@ Contributions to Clippy should be made in the form of GitHub pull requests. Each
245246
be reviewed by a core contributor (someone with permission to land patches) and either landed in the
246247
main tree or given feedback for changes that would be required.
247248

249+
All PRs should include a `changelog` entry with a short comment explaining the change. The rule of thumb is basically,
250+
"what do you believe is important from an outsider's perspective?" Often, PRs are only related to a single property of a
251+
lint, and then it's good to mention that one. Otherwise, it's better to include too much detail than too little.
252+
253+
Clippy's [changelog] is created from these comments. Every release, someone gets all commits from bors with a
254+
`changelog: XYZ` entry and combines them into the changelog. This is a manual process.
255+
256+
Examples:
257+
- New lint
258+
```
259+
changelog: new lint: [`missing_trait_methods`]
260+
```
261+
- False positive fix
262+
```
263+
changelog: Fix [`unused_peekable`] false positive when peeked in a closure or called as `f(&mut peekable)`
264+
```
265+
- Purely internal change
266+
```
267+
changelog: none
268+
```
269+
270+
Note this it is fine for a PR to include multiple `changelog` entries, e.g.:
271+
```
272+
changelog: Something 1
273+
changelog: Something 2
274+
changelog: Something 3
275+
```
276+
277+
[changelog]: CHANGELOG.md
278+
279+
## License
280+
248281
All code in this repository is under the [Apache-2.0] or the [MIT] license.
249282

250283
<!-- adapted from https://github.com/servo/servo/blob/master/CONTRIBUTING.md -->

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ path = "src/driver.rs"
2323
[dependencies]
2424
clippy_lints = { path = "clippy_lints" }
2525
semver = "1.0"
26-
rustc_tools_util = { path = "rustc_tools_util" }
26+
rustc_tools_util = "0.2.1"
2727
tempfile = { version = "3.2", optional = true }
2828
termize = "0.1"
2929

@@ -56,7 +56,7 @@ tokio = { version = "1", features = ["io-util"] }
5656
rustc-semver = "1.1"
5757

5858
[build-dependencies]
59-
rustc_tools_util = { version = "0.2", path = "rustc_tools_util" }
59+
rustc_tools_util = "0.2.1"
6060

6161
[features]
6262
deny-warnings = ["clippy_lints/deny-warnings"]

README.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Clippy
22

3-
[![Clippy Test](https://github.com/rust-lang/rust-clippy/workflows/Clippy%20Test/badge.svg?branch=auto&event=push)](https://github.com/rust-lang/rust-clippy/actions?query=workflow%3A%22Clippy+Test%22+event%3Apush+branch%3Aauto)
3+
[![Clippy Test](https://github.com/rust-lang/rust-clippy/workflows/Clippy%20Test%20(bors)/badge.svg?branch=auto&event=push)](https://github.com/rust-lang/rust-clippy/actions?query=workflow%3A%22Clippy+Test+(bors)%22+event%3Apush+branch%3Aauto)
44
[![License: MIT OR Apache-2.0](https://img.shields.io/crates/l/clippy.svg)](#license)
55

66
A collection of lints to catch common mistakes and improve your [Rust](https://github.com/rust-lang/rust) code.
@@ -204,12 +204,6 @@ lints can be configured and the meaning of the variables.
204204
>
205205
> `clippy.toml` or `.clippy.toml` cannot be used to allow/deny lints.
206206
207-
> **Note**
208-
>
209-
> Configuration changes will not apply for code that has already been compiled and cached under `./target/`;
210-
> for example, adding a new string to `doc-valid-idents` may still result in Clippy flagging that string. To be sure
211-
> that any configuration changes are applied, you may want to run `cargo clean` and re-compile your crate from scratch.
212-
213207
To deactivate the “for further information visit *lint-link*” message you can
214208
define the `CLIPPY_DISABLE_DOCS_LINKS` environment variable.
215209

book/src/development/adding_lints.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,8 +478,27 @@ impl<'tcx> LateLintPass<'tcx> for ManualStrip {
478478
```
479479

480480
Once the `msrv` is added to the lint, a relevant test case should be added to
481-
`tests/ui/min_rust_version_attr.rs` which verifies that the lint isn't emitted
482-
if the project's MSRV is lower.
481+
the lint's test file, `tests/ui/manual_strip.rs` in this example. It should
482+
have a case for the version below the MSRV and one with the same contents but
483+
for the MSRV version itself.
484+
485+
```rust
486+
#![feature(custom_inner_attributes)]
487+
488+
...
489+
490+
fn msrv_1_44() {
491+
#![clippy::msrv = "1.44"]
492+
493+
/* something that would trigger the lint */
494+
}
495+
496+
fn msrv_1_45() {
497+
#![clippy::msrv = "1.45"]
498+
499+
/* something that would trigger the lint */
500+
}
501+
```
483502

484503
As a last step, the lint should be added to the lint documentation. This is done
485504
in `clippy_lints/src/utils/conf.rs`:

book/src/development/basics.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ the reference file with:
6969
cargo dev bless
7070
```
7171

72-
For example, this is necessary, if you fix a typo in an error message of a lint
72+
For example, this is necessary if you fix a typo in an error message of a lint,
7373
or if you modify a test file to add a test case.
7474

7575
> _Note:_ This command may update more files than you intended. In that case
@@ -101,8 +101,9 @@ cargo dev setup intellij
101101
cargo dev dogfood
102102
```
103103

104-
More about intellij command usage and reasons
105-
[here](https://github.com/rust-lang/rust-clippy/blob/master/CONTRIBUTING.md#intellij-rust)
104+
More about [intellij] command usage and reasons.
105+
106+
[intellij]: https://github.com/rust-lang/rust-clippy/blob/master/CONTRIBUTING.md#intellij-rust
106107

107108
## lintcheck
108109

0 commit comments

Comments
 (0)