| Age | Commit message (Collapse) | Author | Lines |
|
`manual_div_ceil` (#14263)
- The name of an MSRV alias should describe its functionality, and it is
not appropriate for it to be the same as the name of the lint that uses
it.
- Additionally, while `manual_div_ceil` allows setting MSRV, this is not
correctly reflected in the configuration information.
changelog: none
|
|
|
|
|
|
|
|
r? flip1995
changelog: none
|
|
`mem::replace(opt, Some(v))` can be replaced by `opt.replace(v)`.
Close #14195
changelog: [`mem_replace_option_with_some`]: new lint
|
|
`mem::replace(opt, Some(v))` can be replaced by `opt.replace(v)`.
|
|
By default, do not lint `.unwrap()` and `.expect(…)` in always const
contexts, as a failure would be detected at compile time anyway.
New options `allow_expect_in_consts` and `allow_unwrap_in_consts`,
defaulting to `true`, can be turned unset to still lint in always const
contexts.
|
|
|
|
`manual_flatten` should respect MSRV.
changelog: [`manual_flatten`]: add MSRV check
|
|
`manual_option_as_slice` takes MSRV into account, but this is not
mentioned in the lint documentation.
changelog: none
|
|
fixes #14127
changelog: [`lines_filter_map_ok`]: respect MSRV
|
|
|
|
|
|
changelog: none
|
|
[RFC](https://github.com/rust-lang/rfcs/blob/master/text/2476-clippy-uno.md#lint-audit-and-categories)
has more groups so add them
changelog: none
|
|
|
|
|
|
close #13856
changelog: [`manual_slice_fill`]: new lint
|
|
|
|
`rustc_middle` is a huge crate and it's always good to move stuff out of
it. There are lots of similar methods already on `Span`, so these two
functions, `in_external_macro` and `is_from_async_await`, fit right in.
The diff is big because `in_external_macro` is used a lot by clippy
lints.
|
|
|
|
clippy-subtree-update
|
|
|
|
|
|
|
|
|
|
|
|
detect usage of `once_cell::sync::Lazy` and `lazy_static!`,
recommending usage of `std::sync::LazyLock` instead
|
|
Using `Vec::extend(std::iter::repeat_n(item, N))` allows to use the more
natural number of elements to add `N`, as is probably done in the
original loop, instead of computing the difference between the existing
number of elements and the wanted one.
Before MSRV 1.82, the older suggestion to use `Vec::resize()` is still
issued.
Inspired by #6156 (which predates `repeat_n()`).
changelog: [`same_item_push`]: recommend using `Vec::extend()` to extend
a vector
|
|
Using `Vec::extend(std::iter::repeat_n(item, N))` allows to use the more
natural number of elements to add `N`, as is probably done in the original
loop, instead of computing the difference between the existing number of
elements and the wanted one.
Before MSRV 1.82, the older suggestion to use `Vec::resize()` is still
issued.
|
|
The Cargo feature is no longer experimental and is enabled by default in
our nightly compiler.
changelog: Clippy now uses Rust edition 2024
|
|
|
|
changelog: none
This PR fixes explaining the difference in usage between early and late
lint passes in the book.
|
|
Since we do release tag it makes more sense to refer to tags page then
empty releases page
changelog: none
|
|
Some of the links are wrong since lead to non existing docs so fix them
changelog: none
|
|
clippy-subtree-update
|
|
|
|
|
|
|
|
|
|
|
|
|
|
changelog: none
|
|
|
|
requirement configurable (#13737)
Fixes #11846.
This PR has three commits:
- The first commit adds an `initializer-suggestions` configuration to
control suggestion applicability when initializers are present. The
following are the options:
- "none": do not suggest
- "maybe-incorrect": suggest, but do not apply suggestions with `--fix`
- "machine-applicable": suggest and apply suggestions with `--fix`
- The second commit fixes suggestions to handle field attributes
(problem [noticed by
@samueltardieu](https://github.com/rust-lang/rust-clippy/pull/13737#discussion_r1859261645)).
- The third commit adds `initializer-suggestions = "machine-applicable"`
to Clippy's `clippy.toml` and applies the suggestions. (Nothing seems to
break.)
---
changelog: make `inconsistent_struct_constructor` "all fields are
shorthand" requirement configurable
|
|
Handle field attributes in suggestions
Fix adjacent code
Address review comments
https://github.com/rust-lang/rust-clippy/pull/13737#discussion_r1861352124
Address all review comments but one
This comment is not yet addressed: https://github.com/rust-lang/rust-clippy/pull/13737#discussion_r1874544907
`initializer_suggestions` -> `lint_inconsistent_struct_field_initializers`
|
|
clippy-subtree-update
|
|
|
|
Close #13842
changelog: [`indexing_slicing`]: add allow-indexing-slicing-in-tests
option to be able ignore at test
|