| Age | Commit message (Collapse) | Author | Lines |
|
|
|
Using `lifetime.ident.name` in suggestions will not output the raw
modifier. For example, `'r#struct` will be rendered as `'struct` which
would be incorrect.
Fix #13899
changelog: [`needless_arbitrary_self_type`]: use the raw lifetime name
in suggestions
|
|
Proper parentheses need to be added to some expressions in receiver
position.
Fix #13902
changelog: [`redundant_pattern_matching`]: use proper parentheses when
suggesting replacing `matches!(…, None)` by `.is_none()`
|
|
|
|
Using `lifetime.ident.name` in suggestions will not output the raw
modifier. For example, `'r#struct` will be rendered as `'struct` which
would be incorrect.
|
|
|
|
Removing `.map(identity)` may result in invalid code if the receiver of
`map()` is an immutable binding, and the result of `map()` is used as
the receiver of a method call expecting a mutable reference.
|
|
|
|
Also, simplify boolean shortcut expression, and ensure that
applicability is properly applied, as it was ignored and
`MachineApplicable` was always used.
changelog: [`borrow_as_ptr`]: do not remove required parentheses in
autofix suggestion
Close #13882
|
|
This PR just makes sure that we exit the function before getting an ICE
and adds a regression test. Related to #12979. We would need to keep
researching the issue, but as the ICEing code isn't that complicated,
getting a hotfix into nightly is urgent.
changelog:[`borrow_interior_mutable_const`] Fix ICE #12979
|
|
Also, simplify boolean expression, and ensure that proper applicability
is used.
|
|
|
|
Fixes #13862
`missing_headers::check` is sometimes called from outside of a body
(specifically, from `check_attributes`, where the LateContext's ParamEnv
is not yet properly initialized for that item). Using that empty
ParamEnv for trait solving things from within the body can then lead to
various ICEs, like the linked issue where we have a const generic
parameter `DMA_INST` without a `ConstArgHasType` bound in the ParamEnv
so the const parameter has no type, which is normally not supposed to
happen.
We have the item's DefId so we can just get its ParamEnv/TypingEnv from
there, and using that one for trait solving should be safe.
changelog: none
|
|
Examples fixes for regex
changelog: none
|
|
Close #13837
changelog: [`trailing_empty_array`]: do not trigger on tests
|
|
Convert the ICE reported in #12979 into a false negative.
We prefer a false negative to a ICE (because the ICE could
still affect the user even when not activating the lint).
|
|
`continue`, recursively
fixes: #4077
|
|
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
|
|
been resolved (#13873)
The "known problems" pointed out in the `match_same_arms` lint seem to
have already been resolved.
changelog: none
|
|
fix #13843
The `manual_div_ceil` lint makes incorrect suggestion when type suffixes
need to be made explicit in the suggested code.
changelog: [`manual_div_ceil`]: suggested code now includes appropriate
type suffixes where necessary
|
|
|
|
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
|
|
|
|
fix #13411
The `if_not_else` lint can be fixed automatically, but the issue above
reports that there is no implementation to do so. Therefore, this PR
implements it.
----
changelog: [`if_not_else`]: make suggestions for modified code
|
|
|
|
|
|
This should address #13099 for the let_unit test.
changelog: [let_unit]: Updated let_unit to use multipart_suggestions
where appropriate
|
|
|
|
|
|
`missing_errors_doc`
|
|
Close #13842
changelog: [`indexing_slicing`]: add allow-indexing-slicing-in-tests
option to be able ignore at test
|
|
|
|
cleanup region handling: add `LateParamRegionKind`
The second commit is to enable a split between `BoundRegionKind` and `LateParamRegionKind`, by avoiding `BoundRegionKind` where it isn't necessary.
The third comment then adds `LateParamRegionKind` to avoid having the same late-param region for separate bound regions. This fixes #124021.
r? `@compiler-errors`
|
|
|
|
|
|
Overhaul token cursors
Some nice cleanups here.
r? `````@davidtwco`````
|
|
This will address https://github.com/rust-lang/rust-clippy/issues/13099
for the unnecessary_iter_cloned test.
changelog: [unnecessary_iter_cloned]: unnecessary_iter_cloned
manual_assert to use multipart_suggestions where appropriate
|
|
Because `TokenStreamIter` is a much better name for a `TokenStream`
iterator. Also rename the `TokenStream::trees` method as
`TokenStream::iter`, and some local variables.
|
|
It's only ever used with a lookahead of 0, so this commit removes the
lookahead and renames it `peek`.
|
|
Fixes #13764
changelog: [`useless_attribute`]: do not trigger on attributes with
unknown namespace
|
|
|
|
(#13826)
fix #12653
changelog: [`filter_map_identity`]: don't lint for creating an iterator
from an empty array
|
|
|
|
|
|
Fixes https://github.com/rust-lang/rust-clippy/issues/13838.
r? @klensy
changelog: Correctly handle string indices in
`literal_string_with_formatting_arg`
|
|
|
|
fix #11524
In a `no_std` environment, we can use `core::cmp::Reverse` instead of
`std::cmp::Reverse`.
----
changelog: [`unnecessary_sort_by`]: correct suggestion in `no_std`
|
|
|
|
changelog: [`result_unit_err`]: do not suggest using `Error` in `no_std`
mode before Rust 1.81
Fix #9767
|