Skip to content

Optimize Msrv::meets calls#17338

Merged
llogiq merged 1 commit into
rust-lang:masterfrom
ArhanChaudhary:optimize-msrv
Jul 3, 2026
Merged

Optimize Msrv::meets calls#17338
llogiq merged 1 commit into
rust-lang:masterfrom
ArhanChaudhary:optimize-msrv

Conversation

@ArhanChaudhary

Copy link
Copy Markdown
Contributor

Calls to Msrv::meets are 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

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jul 3, 2026
@rustbot

rustbot commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

r? @llogiq

rustbot has assigned @llogiq.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: 8 candidates
  • 8 candidates expanded to 8 candidates
  • Random selection from Jarcho, dswij, llogiq, samueltardieu

@llogiq llogiq left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ok, though I'd be happier with some measurements. Anyway, let's merge.

View changes since this review

@llogiq
llogiq added this pull request to the merge queue Jul 3, 2026
Merged via the queue into rust-lang:master with commit 3ee4a90 Jul 3, 2026
11 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jul 3, 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)

@ada4a ada4a Jul 4, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you please revert this one? is_from_proc_macro is even more expensive that the msrv check

View changes since the review

@ArhanChaudhary

ArhanChaudhary commented Jul 4, 2026 via email

Copy link
Copy Markdown
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants