Skip to content

Commit 18d855b

Browse files
committed
Auto merge of #80623 - flip1995:clippyup, r=Manishearth
Update Clippy Biweekly Clippy update. This includes a Cargo.lock update for the recent Clippy version bump. r? `@Manishearth`
2 parents c7d6c3d + 5dd64b3 commit 18d855b

40 files changed

+650
-251
lines changed

Cargo.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ dependencies = [
568568

569569
[[package]]
570570
name = "clippy"
571-
version = "0.0.212"
571+
version = "0.1.51"
572572
dependencies = [
573573
"cargo_metadata 0.12.0",
574574
"clippy-mini-macro-test",
@@ -589,7 +589,7 @@ version = "0.2.0"
589589

590590
[[package]]
591591
name = "clippy_lints"
592-
version = "0.0.212"
592+
version = "0.1.51"
593593
dependencies = [
594594
"cargo_metadata 0.12.0",
595595
"if_chain",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
name: Bug Report (False Negative)
3+
about: Create a bug report about missing warnings from a lint
4+
labels: L-bug, L-false-negative
5+
---
6+
<!--
7+
Thank you for filing a bug report! 🐛 Please provide a short summary of the bug,
8+
along with any information you feel relevant to replicating the bug.
9+
-->
10+
Lint name:
11+
12+
13+
I tried this code:
14+
15+
```rust
16+
<code>
17+
```
18+
19+
I expected to see this happen: *explanation*
20+
21+
Instead, this happened: *explanation*
22+
23+
### Meta
24+
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+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
name: Bug Report (False Positive)
3+
about: Create a bug report about a wrongly emitted lint warning
4+
labels: L-bug, L-false-positive
5+
---
6+
<!--
7+
Thank you for filing a bug report! 🐛 Please provide a short summary of the bug,
8+
along with any information you feel relevant to replicating the bug.
9+
-->
10+
Lint name:
11+
12+
13+
I tried this code:
14+
15+
```rust
16+
<code>
17+
```
18+
19+
I expected to see this happen: *explanation*
20+
21+
Instead, this happened: *explanation*
22+
23+
### Meta
24+
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+
```

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

+3
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ jobs:
5050
- name: Build
5151
run: cargo build --features deny-warnings,internal-lints
5252

53+
- name: Test "--fix -Zunstable-options"
54+
run: cargo run --features deny-warnings,internal-lints --bin cargo-clippy -- clippy --fix -Zunstable-options
55+
5356
- name: Test
5457
run: cargo test --features deny-warnings,internal-lints
5558

src/tools/clippy/CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -1841,6 +1841,7 @@ Released 2018-09-13
18411841
[`forget_copy`]: https://rust-lang.github.io/rust-clippy/master/index.html#forget_copy
18421842
[`forget_ref`]: https://rust-lang.github.io/rust-clippy/master/index.html#forget_ref
18431843
[`from_iter_instead_of_collect`]: https://rust-lang.github.io/rust-clippy/master/index.html#from_iter_instead_of_collect
1844+
[`from_over_into`]: https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
18441845
[`future_not_send`]: https://rust-lang.github.io/rust-clippy/master/index.html#future_not_send
18451846
[`get_last_with_len`]: https://rust-lang.github.io/rust-clippy/master/index.html#get_last_with_len
18461847
[`get_unwrap`]: https://rust-lang.github.io/rust-clippy/master/index.html#get_unwrap

src/tools/clippy/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "clippy"
3-
version = "0.0.212"
3+
version = "0.1.51"
44
authors = [
55
"Manish Goregaokar <[email protected]>",
66
"Andre Bogus <[email protected]>",
@@ -29,7 +29,7 @@ path = "src/driver.rs"
2929

3030
[dependencies]
3131
# begin automatic update
32-
clippy_lints = { version = "0.0.212", path = "clippy_lints" }
32+
clippy_lints = { version = "0.1.50", path = "clippy_lints" }
3333
# end automatic update
3434
semver = "0.11"
3535
rustc_tools_util = { version = "0.2.0", path = "rustc_tools_util" }

src/tools/clippy/README.md

+10-33
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ A collection of lints to catch common mistakes and improve your [Rust](https://g
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.
1212

13-
Category | Description | Default level
14-
-- | -- | --
15-
`clippy::all` | all lints that are on by default (correctness, style, complexity, perf) | **warn/deny**
16-
`clippy::correctness` | code that is outright wrong or very useless | **deny**
17-
`clippy::style` | code that should be written in a more idiomatic way | **warn**
18-
`clippy::complexity` | code that does something simple but in a complex way | **warn**
19-
`clippy::perf` | code that can be written to run faster | **warn**
20-
`clippy::pedantic` | lints which are rather strict or might have false positives | allow
21-
`clippy::nursery` | new lints that are still under development | allow
22-
`clippy::cargo` | lints for the cargo manifest | allow
13+
| Category | Description | Default level |
14+
| --------------------- | ----------------------------------------------------------------------- | ------------- |
15+
| `clippy::all` | all lints that are on by default (correctness, style, complexity, perf) | **warn/deny** |
16+
| `clippy::correctness` | code that is outright wrong or very useless | **deny** |
17+
| `clippy::style` | code that should be written in a more idiomatic way | **warn** |
18+
| `clippy::complexity` | code that does something simple but in a complex way | **warn** |
19+
| `clippy::perf` | code that can be written to run faster | **warn** |
20+
| `clippy::pedantic` | lints which are rather strict or might have false positives | allow |
21+
| `clippy::nursery` | new lints that are still under development | allow |
22+
| `clippy::cargo` | lints for the cargo manifest | allow |
2323

2424
More to come, please [file an issue](https://github.com/rust-lang/rust-clippy/issues) if you have ideas!
2525

@@ -98,17 +98,6 @@ If you want to run Clippy **only** on the given crate, use the `--no-deps` optio
9898
cargo clippy -p example -- --no-deps
9999
```
100100

101-
### Running Clippy from the command line without installing it
102-
103-
To have cargo compile your crate with Clippy without Clippy installation
104-
in your code, you can use:
105-
106-
```terminal
107-
cargo run --bin cargo-clippy --manifest-path=path_to_clippys_Cargo.toml
108-
```
109-
110-
*Note:* Be sure that Clippy was compiled with the same version of rustc that cargo invokes here!
111-
112101
### Travis CI
113102

114103
You can add Clippy to Travis CI in the same way you use it locally:
@@ -130,18 +119,6 @@ script:
130119
# etc.
131120
```
132121

133-
If you are on nightly, It might happen that Clippy is not available for a certain nightly release.
134-
In this case you can try to conditionally install Clippy from the Git repo.
135-
136-
```yaml
137-
language: rust
138-
rust:
139-
- nightly
140-
before_script:
141-
- rustup component add clippy --toolchain=nightly || cargo install --git https://github.com/rust-lang/rust-clippy/ --force clippy
142-
# etc.
143-
```
144-
145122
Note that adding `-D warnings` will cause your build to fail if **any** warnings are found in your code.
146123
That includes warnings found by rustc (e.g. `dead_code`, etc.). If you want to avoid this and only cause
147124
an error for Clippy warnings, use `#![deny(clippy::all)]` in your code or `-D clippy::all` on the command

src/tools/clippy/clippy_dev/src/ra_setup.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use std::fs;
44
use std::fs::File;
55
use std::io::prelude::*;
6-
use std::path::PathBuf;
6+
use std::path::{Path, PathBuf};
77

88
// This module takes an absolute path to a rustc repo and alters the dependencies to point towards
99
// the respective rustc subcrates instead of using extern crate xyz.
@@ -44,7 +44,7 @@ pub fn run(rustc_path: Option<&str>) {
4444
}
4545

4646
fn inject_deps_into_manifest(
47-
rustc_source_dir: &PathBuf,
47+
rustc_source_dir: &Path,
4848
manifest_path: &str,
4949
cargo_toml: &str,
5050
lib_rs: &str,

src/tools/clippy/clippy_lints/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "clippy_lints"
33
# begin automatic update
4-
version = "0.0.212"
4+
version = "0.1.51"
55
# end automatic update
66
authors = [
77
"Manish Goregaokar <[email protected]>",

0 commit comments

Comments
 (0)