Optimize Msrv::meets calls#17338
Merged
Merged
Conversation
Collaborator
|
r? @llogiq rustbot has assigned @llogiq. Use Why was this reviewer chosen?The reviewer was selected based on:
|
llogiq
approved these changes
Jul 3, 2026
ada4a
reviewed
Jul 4, 2026
Comment on lines
-44
to
+45
| && msrv.meets(cx, msrvs::POINTER_CAST) | ||
| && !is_from_proc_macro(cx, expr) | ||
| && msrv.meets(cx, msrvs::POINTER_CAST) |
Contributor
There was a problem hiding this comment.
could you please revert this one? is_from_proc_macro is even more expensive that the msrv check
Contributor
Author
|
Right, you did say this. My apologies; will follow up with another PR.
…On Sat, Jul 4, 2026 at 1:28 AM Ada Alakbarova ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In clippy_lints/src/casts/ptr_as_ptr.rs
<#17338 (comment)>
:
> - && msrv.meets(cx, msrvs::POINTER_CAST)
&& !is_from_proc_macro(cx, expr)
+ && msrv.meets(cx, msrvs::POINTER_CAST)
could you please revert this one? is_from_proc_macro is even more
expensive that the msrv check
—
Reply to this email directly, view it on GitHub
<#17338?email_source=notifications&email_token=ANWZDRU5DQWD2PBNV3BXRBL5DC52FA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTINRSHEYTQMZXGUZKM4TFMFZW63VMON2GC5DFL5RWQYLOM5S2KZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#pullrequestreview-4629183752>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANWZDRXN6QCFK4FVJSYZ25L5DC52FAVCNFSNUABEKJSXA33TNF2G64TZHMZDMOBVGA2DIMZ3JFZXG5LFHM2DOOJZGUYTMNRUGWQXMAQ>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Calls to
Msrv::meetsare expensive, so I defer various calls to this function across the codebase to later in control flow. I do not have a sense for performance, so I only picked obvious/trivial applications of this optimization.changelog: none