Detects manual implementations of the newly implemented
[`BinaryHeap::pop_if()`](https://github.com/rust-lang/rust/issues/151828)
in `manual_pop_if`.
I wasn't sure about how best to handle checking for the nightly feature.
Could we let people compiling with nightly know that the feature is
available even if they don't have it enabled?
changelog: [`manual_pop_if`]: detect manual implementations of
`BinaryHeap::pop_if()`
Couple of driver interface improvements
* Pass Session to `make_codegen_backend` callback. This simplifies some code in miri.
* Move env/file_depinfo from ParseSess to Session. There is no reason it has to be in ParseSess rather than Session.
* Rename hash_untracked_state to track_state to indicate that it isn't just used for hashing state, but also for adding env vars and files to be tracked through the dep info file.
When checking if a function is an identity function, try to use existing
functionalities.
Some cases are no longer covered, but I believe that's ok and there were
some bugs:
- No longer considering the identity a closure where the pattern
captures by reference, since that made [the suggestion break
compilation](https://play.rust-lang.org/?version=beta&mode=debug&edition=2024&gist=f3165f23dc5c46972ef4d53600273fd5)
- No longer going into other function's body to check if they're
isomorphic to the identity, discussed a bit [on Zulip]([#clippy > Going
into other function definitions
desirable?](https://rust-lang.zulipchat.com/#narrow/channel/257328-clippy/topic/Going.20into.20other.20function.20definitions.20desirable.3F/with/546402683)).
I understand this could not catch some cases, but I think it's something
that is out the scope of this lint. It also requires some ad hoc
mechanism in the implementation, doable but a bit hacky.
Fixesrust-lang/rust-clippy#15916
changelog: [`unnecessary_option_map_or_else`]: function definitions are
no longer traversed when checking if an expression is the identity
changelog: [`unnecessary_result_map_or_else`]: function definitions are
no longer traversed when checking if an expression is the identity
Closes: rust-lang/rust-clippy#16654
changelog: [`question_mark`]: fix suggestion-caused-error caused by
semicolon inference relying only on parent-node shape.
Move `Spanned`.
It's defined in `rustc_span::source_map` which doesn't make any sense because it has nothing to do with source maps. This commit moves it to the crate root, a more sensible spot for something this basic.
r? @JonathanBrouwer
It's defined in `rustc_span::source_map` which doesn't make any sense
because it has nothing to do with source maps. This commit moves it to
the crate root, a more sensible spot for something this basic.
fixesrust-lang/rust-clippy#16696
changelog: [`semicolon_inside_block`]: fix false positive in `try`
blocks where moving `;` inside changes the block's return type and
causes type errors.
This PR reduces the clippy lints page HTML size.
Currently, we need to hover the link to be able to click it:
<img width="276" height="59" alt="Screenshot From 2026-02-24 20-37-53"
src="https://github.com/user-attachments/assets/3c49d511-f6b5-47eb-9436-a2ece6082f78"
/>
With the first commit of this PR, the whole "case" becomes the link:
<img width="276" height="59" alt="image"
src="https://github.com/user-attachments/assets/094923fb-6725-4941-a680-015c53faad8e"
/>
That is the only visible change.
Here are the diff of size for each commit:
| step | size (in bytes) | diff with previous size (in %) |
|-|-|-|
| before this PR | 1.684.543 | |
| first commit | 1.666.635 | -1.1% |
| second commit | 1.643.619 | -1.4% |
So in total, going from 1.684.543 to 1.643.619, we have a 2.5% reduction
of size.
changelog: none
r? @Alexendoo
It is not necessary to materialize snippets into `String` objects just
to check if they contain comments for example.
changelog: none
r? @blyxyas
(for perf measurements)
The wrong `TypeckResults` was used in the fallback equality function
passed by the `match_same_arms` and `filter_map` lints. Previously,
those fallback functions had no way of using the proper `TypeckResults`.
Those (one per expression being compared) are now passed to the
registered fallback function.
Add a lint to detect when the recently added Vec::pop_if,
VecDeque::pop_front_if, and VecDeque::pop_back_if are manually
implemented.
changelog: add [`manual_pop_if`] lint
Based on rust-lang/rust-clippy#15978
This will prevent some pointless merge conflict when multiple people add
lints to the same lint pass (e.g. methods).
changelog: None
Fixrust-lang/rust-clippy#16155
Suppress the `-> !` suggestion when the loop is inside a conditional
where not all branches diverge. When every branch does diverge (e.g. `if
cond { loop {} } else { loop {} }`), the suggestion is still emitted.
changelog: [`infinite_loop`]: Fix wrong suggestion to add `-> !` when
the loop is inside a conditional branch
As asked in
https://github.com/rust-lang/rust-clippy/pull/16614#issuecomment-3998600387,
triagebot has been updated to able to add a comment to GitHub when
opening the nomination Zulip topic.
This PR therefore configures the nomination with the suggested text and
link to the Zulip topic.
cc @samueltardieu
r? @flip1995
---
changelog: none
FIxesrust-lang/rust-clippy#16482
changelog: [`doc_paragraphs_missing_punctuation`]: fix: No longer lints
for punctuated paragraphs with a trailing emoji.