Skip to content

Commit

Permalink
Merge commit '928e72dd10749875cbd412f74bfbfd7765dbcd8a' into clippyup
Browse files Browse the repository at this point in the history
  • Loading branch information
flip1995 committed Feb 25, 2021
1 parent 4334f57 commit f64149d
Show file tree
Hide file tree
Showing 113 changed files with 6,454 additions and 3,273 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: Bug Report
about: Create a bug report for Clippy
labels: L-bug
labels: C-bug
---
<!--
Thank you for filing a bug report! 🐛 Please provide a short summary of the bug,
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/false_negative.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: Bug Report (False Negative)
about: Create a bug report about missing warnings from a lint
labels: L-bug, L-false-negative
labels: C-bug, I-false-negative
---
<!--
Thank you for filing a bug report! 🐛 Please provide a short summary of the bug,
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/false_positive.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: Bug Report (False Positive)
about: Create a bug report about a wrongly emitted lint warning
labels: L-bug, L-false-positive
labels: C-bug, I-false-positive
---
<!--
Thank you for filing a bug report! 🐛 Please provide a short summary of the bug,
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/ice.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: Internal Compiler Error
about: Create a report for an internal compiler error in Clippy.
labels: L-bug, L-crash
labels: C-bug, I-ICE
---
<!--
Thank you for finding an Internal Compiler Error! 🧊 If possible, try to provide
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/new_lint.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: New lint suggestion
about: Suggest a new Clippy lint.
labels: L-lint
labels: A-lint
---

### What it does
Expand Down
12 changes: 2 additions & 10 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,8 @@ jobs:
- name: Test "--fix -Zunstable-options"
run: cargo run --features deny-warnings,internal-lints --bin cargo-clippy -- clippy --fix -Zunstable-options

- name: Test
run: cargo test --features deny-warnings,internal-lints

- name: Test clippy_lints
run: cargo test --features deny-warnings,internal-lints
working-directory: clippy_lints

- name: Test rustc_tools_util
run: cargo test --features deny-warnings
working-directory: rustc_tools_util
- name: Test Workspace
run: cargo test --all --features deny-warnings,internal-lints

- name: Test clippy_dev
run: cargo test --features deny-warnings
Expand Down
12 changes: 2 additions & 10 deletions .github/workflows/clippy_bors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,8 @@ jobs:
- name: Build
run: cargo build --features deny-warnings,internal-lints

- name: Test
run: cargo test --features deny-warnings,internal-lints

- name: Test clippy_lints
run: cargo test --features deny-warnings,internal-lints
working-directory: clippy_lints

- name: Test rustc_tools_util
run: cargo test --features deny-warnings
working-directory: rustc_tools_util
- name: Test Workspace
run: cargo test --all --features deny-warnings,internal-lints

- name: Test clippy_dev
run: cargo test --features deny-warnings
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ out
*Cargo.lock
/target
/clippy_lints/target
/clippy_utils/target
/clippy_workspace_tests/target
/clippy_dev/target
/rustc_tools_util/target
Expand Down
129 changes: 125 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,128 @@ document.

## Unreleased / In Rust Nightly

[4911ab1...master](https://github.com/rust-lang/rust-clippy/compare/4911ab1...master)
[3e41797...master](https://github.com/rust-lang/rust-clippy/compare/3e41797...master)

## Rust 1.51

Current beta, release 2021-03-25

[4911ab1...3e41797](https://github.com/rust-lang/rust-clippy/compare/4911ab1...3e41797)

### New Lints

* [`upper_case_acronyms`]
[#6475](https://github.com/rust-lang/rust-clippy/pull/6475)
* [`from_over_into`] [#6476](https://github.com/rust-lang/rust-clippy/pull/6476)
* [`case_sensitive_file_extension_comparisons`]
[#6500](https://github.com/rust-lang/rust-clippy/pull/6500)
* [`needless_question_mark`]
[#6507](https://github.com/rust-lang/rust-clippy/pull/6507)
* [`missing_panics_doc`]
[#6523](https://github.com/rust-lang/rust-clippy/pull/6523)
* [`redundant_slicing`]
[#6528](https://github.com/rust-lang/rust-clippy/pull/6528)
* [`vec_init_then_push`]
[#6538](https://github.com/rust-lang/rust-clippy/pull/6538)
* [`ptr_as_ptr`] [#6542](https://github.com/rust-lang/rust-clippy/pull/6542)
* [`collapsible_else_if`] (split out from `collapsible_if`)
[#6544](https://github.com/rust-lang/rust-clippy/pull/6544)
* [`inspect_for_each`] [#6577](https://github.com/rust-lang/rust-clippy/pull/6577)
* [`manual_filter_map`]
[#6591](https://github.com/rust-lang/rust-clippy/pull/6591)
* [`exhaustive_enums`]
[#6617](https://github.com/rust-lang/rust-clippy/pull/6617)
* [`exhaustive_structs`]
[#6617](https://github.com/rust-lang/rust-clippy/pull/6617)

### Moves and Deprecations

* Replace [`find_map`] with [`manual_find_map`]
[#6591](https://github.com/rust-lang/rust-clippy/pull/6591)
* [`unknown_clippy_lints`] Now integrated in the `unknown_lints` rustc lint
[#6653](https://github.com/rust-lang/rust-clippy/pull/6653)

### Enhancements

* [`ptr_arg`] Now also suggests to use `&Path` instead of `&PathBuf`
[#6506](https://github.com/rust-lang/rust-clippy/pull/6506)
* [`cast_ptr_alignment`] Also lint when the `pointer::cast` method is used
[#6557](https://github.com/rust-lang/rust-clippy/pull/6557)
* [`collapsible_match`] Now also deals with `&` and `*` operators in the `match`
scrutinee [#6619](https://github.com/rust-lang/rust-clippy/pull/6619)

### False Positive Fixes

* [`similar_names`] Ignore underscore prefixed names
[#6403](https://github.com/rust-lang/rust-clippy/pull/6403)
* [`print_literal`] and [`write_literal`] No longer lint numeric literals
[#6408](https://github.com/rust-lang/rust-clippy/pull/6408)
* [`large_enum_variant`] No longer lints in external macros
[#6485](https://github.com/rust-lang/rust-clippy/pull/6485)
* [`empty_enum`] Only lint if `never_type` feature is enabled
[#6513](https://github.com/rust-lang/rust-clippy/pull/6513)
* [`field_reassign_with_default`] No longer lints in macros
[#6553](https://github.com/rust-lang/rust-clippy/pull/6553)
* [`size_of_in_element_count`] No longer lints when dividing by element size
[#6578](https://github.com/rust-lang/rust-clippy/pull/6578)
* [`needless_return`] No longer lints in macros
[#6586](https://github.com/rust-lang/rust-clippy/pull/6586)
* [`match_overlapping_arm`] No longer lint when first arm is completely included
in second arm [#6603](https://github.com/rust-lang/rust-clippy/pull/6603)
* [`doc_markdown`] Add `WebGL` to the default configuration as an allowed
identifier [#6605](https://github.com/rust-lang/rust-clippy/pull/6605)

### Suggestion Fixes/Improvements

* [`field_reassign_with_default`] Don't expand macro in lint suggestion
[#6531](https://github.com/rust-lang/rust-clippy/pull/6531)
* [`match_like_matches_macro`] Strip references in suggestion
[#6532](https://github.com/rust-lang/rust-clippy/pull/6532)
* [`single_match`] Suggest `if` over `if let` when possible
[#6574](https://github.com/rust-lang/rust-clippy/pull/6574)
* [`ref_in_deref`] Use parentheses correctly in suggestion
[#6609](https://github.com/rust-lang/rust-clippy/pull/6609)
* [`stable_sort_primitive`] Clarify error message
[#6611](https://github.com/rust-lang/rust-clippy/pull/6611)

### ICE Fixes

* [`zero_sized_map_values`]
[#6582](https://github.com/rust-lang/rust-clippy/pull/6582)

### Documentation Improvements

* Improve search performance on the Clippy website and make it possible to
directly search for lints on the GitHub issue tracker
[#6483](https://github.com/rust-lang/rust-clippy/pull/6483)
* Clean up `README.md` by removing outdated paragraph
[#6488](https://github.com/rust-lang/rust-clippy/pull/6488)
* [`await_holding_refcell_ref`] and [`await_holding_lock`]
[#6585](https://github.com/rust-lang/rust-clippy/pull/6585)
* [`as_conversions`] [#6608](https://github.com/rust-lang/rust-clippy/pull/6608)

### Others

* Clippy now has a [Roadmap] for 2021. If you like to get involved in a bigger
project, take a look at the [Roadmap project page]. All issues listed there
are actively mentored
[#6462](https://github.com/rust-lang/rust-clippy/pull/6462)
* The Clippy version number now corresponds to the Rust version number
[#6526](https://github.com/rust-lang/rust-clippy/pull/6526)
* Fix oversight which caused Clippy to lint deps in some environments, where
`CLIPPY_TESTS=true` was set somewhere
[#6575](https://github.com/rust-lang/rust-clippy/pull/6575)
* Add `cargo dev-lintcheck` tool to the Clippy Dev Tool
[#6469](https://github.com/rust-lang/rust-clippy/pull/6469)

[Roadmap]: https://github.com/rust-lang/rust-clippy/blob/master/doc/roadmap-2021.md
[Roadmap project page]: https://github.com/rust-lang/rust-clippy/projects/3

## Rust 1.50

Current beta, release 2021-02-11
Current stable, released 2021-02-11

[b20d4c1...4911ab1](https://github.com/rust-lang/rust-clippy/compare/b20d4c1...4911ab1)
[b20d4c1...4bd77a1](https://github.com/rust-lang/rust-clippy/compare/b20d4c1...4bd77a1)

### New Lints

Expand Down Expand Up @@ -90,6 +205,8 @@ Current beta, release 2021-02-11
* [`declare_interior_mutable_const`] and [`borrow_interior_mutable_const`]:
Both now ignore enums with frozen variants
[#6110](https://github.com/rust-lang/rust-clippy/pull/6110)
* [`field_reassign_with_default`] No longer lint for private fields
[#6537](https://github.com/rust-lang/rust-clippy/pull/6537)


### Suggestion Fixes/Improvements
Expand Down Expand Up @@ -137,7 +254,7 @@ Current beta, release 2021-02-11

## Rust 1.49

Current stable, released 2020-12-31
Released 2020-12-31

[e636b88...b20d4c1](https://github.com/rust-lang/rust-clippy/compare/e636b88...b20d4c1)

Expand Down Expand Up @@ -1910,6 +2027,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_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
[`deprecated_cfg_attr`]: https://rust-lang.github.io/rust-clippy/master/index.html#deprecated_cfg_attr
[`deprecated_semver`]: https://rust-lang.github.io/rust-clippy/master/index.html#deprecated_semver
Expand Down Expand Up @@ -1975,6 +2093,7 @@ Released 2018-09-13
[`forget_ref`]: https://rust-lang.github.io/rust-clippy/master/index.html#forget_ref
[`from_iter_instead_of_collect`]: https://rust-lang.github.io/rust-clippy/master/index.html#from_iter_instead_of_collect
[`from_over_into`]: https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
[`from_str_radix_10`]: https://rust-lang.github.io/rust-clippy/master/index.html#from_str_radix_10
[`future_not_send`]: https://rust-lang.github.io/rust-clippy/master/index.html#future_not_send
[`get_last_with_len`]: https://rust-lang.github.io/rust-clippy/master/index.html#get_last_with_len
[`get_unwrap`]: https://rust-lang.github.io/rust-clippy/master/index.html#get_unwrap
Expand All @@ -1990,6 +2109,7 @@ Released 2018-09-13
[`implicit_saturating_sub`]: https://rust-lang.github.io/rust-clippy/master/index.html#implicit_saturating_sub
[`imprecise_flops`]: https://rust-lang.github.io/rust-clippy/master/index.html#imprecise_flops
[`inconsistent_digit_grouping`]: https://rust-lang.github.io/rust-clippy/master/index.html#inconsistent_digit_grouping
[`inconsistent_struct_constructor`]: https://rust-lang.github.io/rust-clippy/master/index.html#inconsistent_struct_constructor
[`indexing_slicing`]: https://rust-lang.github.io/rust-clippy/master/index.html#indexing_slicing
[`ineffective_bit_mask`]: https://rust-lang.github.io/rust-clippy/master/index.html#ineffective_bit_mask
[`inefficient_to_string`]: https://rust-lang.github.io/rust-clippy/master/index.html#inefficient_to_string
Expand Down Expand Up @@ -2042,6 +2162,7 @@ Released 2018-09-13
[`manual_filter_map`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_filter_map
[`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
Expand Down
7 changes: 5 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ build = "build.rs"
edition = "2018"
publish = false

[workspace]
exclude = ["clippy_dev", "mini-macro", "target/lintcheck/crates"]

[[bin]]
name = "cargo-clippy"
test = false
Expand All @@ -37,8 +40,8 @@ tempfile = { version = "3.1.0", optional = true }

[dev-dependencies]
cargo_metadata = "0.12"
compiletest_rs = { version = "0.5.0", features = ["tmp"] }
tester = "0.7"
compiletest_rs = { version = "0.6.0", features = ["tmp"] }
tester = "0.9"
clippy-mini-macro-test = { version = "0.2", path = "mini-macro" }
serde = { version = "1.0", features = ["derive"] }
derive-new = "0.5"
Expand Down
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,23 @@ If you want to run Clippy **only** on the given crate, use the `--no-deps` optio
cargo clippy -p example -- --no-deps
```

### As a rustc replacement (`clippy-driver`)

Clippy can also be used in projects that do not use cargo. To do so, you will need to replace
your `rustc` compilation commands with `clippy-driver`. For example, if your project runs:

```terminal
rustc --edition 2018 -Cpanic=abort foo.rs
```

Then, to enable Clippy, you will need to call:

```terminal
clippy-driver --edition 2018 -Cpanic=abort foo.rs
```

Note that `rustc` will still run, i.e. it will still emit the output files it normally does.

### Travis CI

You can add Clippy to Travis CI in the same way you use it locally:
Expand Down
3 changes: 2 additions & 1 deletion clippy_dev/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ shell-escape = "0.1"
tar = { version = "0.4.30", optional = true }
toml = { version = "0.5", optional = true }
ureq = { version = "2.0.0-rc3", optional = true }
rayon = { version = "1.5.0", optional = true }
walkdir = "2"

[features]
lintcheck = ["flate2", "serde_json", "tar", "toml", "ureq", "serde", "fs_extra"]
lintcheck = ["flate2", "serde_json", "tar", "toml", "ureq", "serde", "fs_extra", "rayon"]
deny-warnings = []
Loading

0 comments on commit f64149d

Please sign in to comment.