Skip to content

Commit

Permalink
Auto merge of #126398 - flip1995:clippy-subtree-update, r=Manishearth
Browse files Browse the repository at this point in the history
Clippy subtree update

r? `@Manishearth`

Updates `Cargo.lock` with Clippy version bump.
  • Loading branch information
bors committed Jun 13, 2024
2 parents b6e5e3f + 17d2856 commit f158600
Show file tree
Hide file tree
Showing 208 changed files with 3,103 additions and 1,672 deletions.
10 changes: 5 additions & 5 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70"

[[package]]
name = "clippy"
version = "0.1.80"
version = "0.1.81"
dependencies = [
"anstream",
"clippy_config",
Expand All @@ -655,7 +655,7 @@ dependencies = [

[[package]]
name = "clippy_config"
version = "0.1.80"
version = "0.1.81"
dependencies = [
"rustc-semver",
"serde",
Expand All @@ -678,7 +678,7 @@ dependencies = [

[[package]]
name = "clippy_lints"
version = "0.1.80"
version = "0.1.81"
dependencies = [
"arrayvec",
"cargo_metadata 0.18.1",
Expand All @@ -703,7 +703,7 @@ dependencies = [

[[package]]
name = "clippy_utils"
version = "0.1.80"
version = "0.1.81"
dependencies = [
"arrayvec",
"clippy_config",
Expand Down Expand Up @@ -1023,7 +1023,7 @@ dependencies = [

[[package]]
name = "declare_clippy_lint"
version = "0.1.80"
version = "0.1.81"
dependencies = [
"itertools 0.12.1",
"quote",
Expand Down
65 changes: 63 additions & 2 deletions src/tools/clippy/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,69 @@ document.

## Unreleased / Beta / In Rust Nightly

[93f0a9a9...master](https://github.com/rust-lang/rust-clippy/compare/93f0a9a9...master)
[ca3b3937...master](https://github.com/rust-lang/rust-clippy/compare/ca3b3937...master)

## Rust 1.79

Current stable, released 2024-06-13

[View all 102 merged pull requests](https://github.com/rust-lang/rust-clippy/pulls?q=merged%3A2024-03-08T11%3A13%3A58Z..2024-04-18T15%3A50%3A50Z+base%3Amaster)

### New Lints

* Added [`legacy_numeric_constants`] to `style`
[#12312](https://github.com/rust-lang/rust-clippy/pull/12312)
* Added [`missing_transmute_annotations`] to `suspicious`
[#12239](https://github.com/rust-lang/rust-clippy/pull/12239)
* Added [`integer_division_remainder_used`] to `restriction`
[#12451](https://github.com/rust-lang/rust-clippy/pull/12451)
* Added [`duplicated_attributes`] to `suspicious`
[#12378](https://github.com/rust-lang/rust-clippy/pull/12378)
* Added [`manual_unwrap_or_default`] to `suspicious`
[#12440](https://github.com/rust-lang/rust-clippy/pull/12440)
* Added [`zero_repeat_side_effects`] to `suspicious`
[#12449](https://github.com/rust-lang/rust-clippy/pull/12449)
* Added [`const_is_empty`] to `suspicious`
[#12310](https://github.com/rust-lang/rust-clippy/pull/12310)

### Moves and Deprecations

* Moved [`box_default`] to `style` (From `perf`)
[#12601](https://github.com/rust-lang/rust-clippy/pull/12601)
* Moved [`manual_clamp`] to `complexity` (From `nursery` now warn-by-default)
[#12543](https://github.com/rust-lang/rust-clippy/pull/12543)
* Moved [`readonly_write_lock`] to `perf` (From `nursery` now warn-by-default)
[#12479](https://github.com/rust-lang/rust-clippy/pull/12479)

### Enhancements

* [`module_name_repetitions`]: Added the [`allowed-prefixes`] configuration to allow common prefixes.
[#12573](https://github.com/rust-lang/rust-clippy/pull/12573)
* [`cast_sign_loss`], [`cast_possible_truncation`], [`cast_lossless`]: Are now allowed in macros
[#12631](https://github.com/rust-lang/rust-clippy/pull/12631)
* [`manual_clamp`]: Now only lints on constant min and max values
[#12543](https://github.com/rust-lang/rust-clippy/pull/12543)
* [`assigning_clones`]: Now considers the [`msrv`] configuration
[#12511](https://github.com/rust-lang/rust-clippy/pull/12511)
* [`needless_return`], [`useless_let_if_seq`], [`mut_mut`], [`read_zero_byte_vec`], [`unused_io_amount`],
[`unused_peekable`]: Now respects `#[allow]` attributes on the affected statement instead
[#12446](https://github.com/rust-lang/rust-clippy/pull/12446)

### False Positive Fixes

* [`cast_lossless`]: No longer lints when casting to `u128`
[#12496](https://github.com/rust-lang/rust-clippy/pull/12496)
* [`std_instead_of_core`] No longer lints on modules that are only in `std`
[#12447](https://github.com/rust-lang/rust-clippy/pull/12447)

### ICE Fixes

* [`needless_return`]: No longer crashes on non-ascii characters
[#12493](https://github.com/rust-lang/rust-clippy/pull/12493)

## Rust 1.78

Current stable, released 2024-05-02
Released 2024-05-02

[View all 112 merged pull requests](https://github.com/rust-lang/rust-clippy/pulls?q=merged%3A2024-01-26T05%3A46%3A23Z..2024-03-07T16%3A25%3A52Z+base%3Amaster)

Expand Down Expand Up @@ -5474,6 +5532,7 @@ Released 2018-09-13
[`manual_next_back`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_next_back
[`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_pattern_char_comparison`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_pattern_char_comparison
[`manual_range_contains`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains
[`manual_range_patterns`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_patterns
[`manual_rem_euclid`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_rem_euclid
Expand Down Expand Up @@ -5567,6 +5626,7 @@ Released 2018-09-13
[`needless_borrow`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
[`needless_borrowed_reference`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference
[`needless_borrows_for_generic_args`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
[`needless_character_iteration`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_character_iteration
[`needless_collect`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_collect
[`needless_continue`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_continue
[`needless_doctest_main`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_doctest_main
Expand All @@ -5576,6 +5636,7 @@ Released 2018-09-13
[`needless_late_init`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init
[`needless_lifetimes`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
[`needless_match`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_match
[`needless_maybe_sized`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_maybe_sized
[`needless_option_as_deref`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_option_as_deref
[`needless_option_take`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_option_take
[`needless_parens_on_range_literals`]: https://rust-lang.github.io/rust-clippy/master/index.html#needless_parens_on_range_literals
Expand Down
2 changes: 1 addition & 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.80"
version = "0.1.81"
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
4 changes: 2 additions & 2 deletions src/tools/clippy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ You can add options to your code to `allow`/`warn`/`deny` Clippy lints:

Note: `allow` means to suppress the lint for your code. With `warn` the lint
will only emit a warning, while with `deny` the lint will emit an error, when
triggering for your code. An error causes clippy to exit with an error code, so
triggering for your code. An error causes Clippy to exit with an error code, so
is useful in scripts like CI/CD.

If you do not want to include your lint levels in your code, you can globally
Expand Down Expand Up @@ -238,7 +238,7 @@ define the `CLIPPY_DISABLE_DOCS_LINKS` environment variable.
### Specifying the minimum supported Rust version

Projects that intend to support old versions of Rust can disable lints pertaining to newer features by
specifying the minimum supported Rust version (MSRV) in the clippy configuration file.
specifying the minimum supported Rust version (MSRV) in the Clippy configuration file.

```toml
msrv = "1.30.0"
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/book/src/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ For more details and options, refer to the Cargo documentation.
### Specifying the minimum supported Rust version

Projects that intend to support old versions of Rust can disable lints pertaining to newer features by specifying the
minimum supported Rust version (MSRV) in the clippy configuration file.
minimum supported Rust version (MSRV) in the Clippy configuration file.

```toml
msrv = "1.30.0"
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/book/src/development/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ More about [intellij] command usage and reasons.

## lintcheck

`cargo lintcheck` will build and run clippy on a fixed set of crates and
`cargo lintcheck` will build and run Clippy on a fixed set of crates and
generate a log of the results. You can `git diff` the updated log against its
previous version and see what impact your lint made on a small set of crates.
If you add a new lint, please audit the resulting warnings and make sure there
Expand Down
4 changes: 2 additions & 2 deletions src/tools/clippy/book/src/development/defining_lints.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,11 @@ declare_clippy_lint! {
///
/// ### Example
/// ```rust
/// // example code where clippy issues a warning
/// // example code where Clippy issues a warning
/// ```
/// Use instead:
/// ```rust
/// // example code which does not raise clippy warning
/// // example code which does not raise Clippy warning
/// ```
#[clippy::version = "1.70.0"] // <- In which version was this implemented, keep it up to date!
pub LINT_NAME, // <- The lint name IN_ALL_CAPS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ selection of possible matches is produced by the pattern syntax. In the second
stage, the named subpattern references can be used to do additional tests like
asserting that a node hasn't been created as part of a macro expansion.

## Implementing clippy lints using patterns
## Implementing Clippy lints using patterns

As a "real-world" example, I re-implemented the `collapsible_if` lint using
patterns. The code can be found
Expand Down Expand Up @@ -572,7 +572,7 @@ The pattern syntax and the *PatternTree* are independent of specific syntax tree
implementations (rust ast / hir, syn, ...). When looking at the different
pattern examples in the previous sections, it can be seen that the patterns
don't contain any information specific to a certain syntax tree implementation.
In contrast, clippy lints currently match against ast / hir syntax tree nodes
In contrast, Clippy lints currently match against ast / hir syntax tree nodes
and therefore directly depend on their implementation.

The connection between the *PatternTree* and specific syntax tree
Expand Down Expand Up @@ -690,7 +690,7 @@ change, only the `IsMatch` trait implementations need to be adapted and existing
lints can remain unchanged. This also means that if the `IsMatch` trait
implementations were integrated into the compiler, updating the `IsMatch`
implementations would be required for the compiler to compile successfully. This
could reduce the number of times clippy breaks because of changes in the
could reduce the number of times Clippy breaks because of changes in the
compiler. Another advantage of the pattern's independence is that converting an
`EarlyLintPass` lint into a `LatePassLint` wouldn't require rewriting the whole
pattern matching code. In fact, the pattern might work just fine without any
Expand Down Expand Up @@ -777,7 +777,7 @@ complexity to solve a relatively minor problem.

The issue of users not knowing about the *PatternTree* structure could be solved
by a tool that, given a rust program, generates a pattern that matches only this
program (similar to the clippy author lint).
program (similar to the Clippy author lint).

For some simple cases (like the first example above), it might be possible to
successfully mix Rust and pattern syntax. This space could be further explored
Expand All @@ -789,7 +789,7 @@ The pattern syntax is heavily inspired by regular expressions (repetitions,
alternatives, sequences, ...).

From what I've seen until now, other linters also implement lints that directly
work on syntax tree data structures, just like clippy does currently. I would
work on syntax tree data structures, just like Clippy does currently. I would
therefore consider the pattern syntax to be *new*, but please correct me if I'm
wrong.

Expand Down Expand Up @@ -982,5 +982,5 @@ pattern!{
}
```

In the future, clippy could use this system to also provide lints for custom
In the future, Clippy could use this system to also provide lints for custom
syntaxes like those found in macros.
2 changes: 1 addition & 1 deletion src/tools/clippy/clippy_config/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "clippy_config"
version = "0.1.80"
version = "0.1.81"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/clippy_dummy/PUBLISH.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
This is a dummy crate to publish to crates.io. It primarily exists to ensure
that folks trying to install clippy from crates.io get redirected to the
that folks trying to install Clippy from crates.io get redirected to the
`rustup` technique.

Before publishing, be sure to rename `clippy_dummy` to `clippy` in `Cargo.toml`,
Expand Down
4 changes: 2 additions & 2 deletions src/tools/clippy/clippy_dummy/crates-readme.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Installing clippy via crates.io is deprecated. Please use the following:
Installing Clippy via crates.io is deprecated. Please use the following:

```terminal
rustup component add clippy
```

on a Rust version 1.29 or later. You may need to run `rustup self update` if it complains about a missing clippy binary.
on a Rust version 1.29 or later. You may need to run `rustup self update` if it complains about a missing Clippy binary.

See [the homepage](https://github.com/rust-lang/rust-clippy/#clippy) for more information
2 changes: 1 addition & 1 deletion src/tools/clippy/clippy_lints/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "clippy_lints"
version = "0.1.80"
version = "0.1.81"
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
51 changes: 0 additions & 51 deletions src/tools/clippy/clippy_lints/src/attrs/maybe_misused_cfg.rs

This file was deleted.

Loading

0 comments on commit f158600

Please sign in to comment.