Skip to content

Rollup of 2 pull requests#157340

Closed
jhpratt wants to merge 5 commits into
rust-lang:mainfrom
jhpratt:rollup-00wO1pA
Closed

Rollup of 2 pull requests#157340
jhpratt wants to merge 5 commits into
rust-lang:mainfrom
jhpratt:rollup-00wO1pA

Conversation

@jhpratt
Copy link
Copy Markdown
Member

@jhpratt jhpratt commented Jun 2, 2026

Successful merges:

r? @ghost

Create a similar rollup

JarlEvanson and others added 5 commits June 2, 2026 19:55
this removes the panic path when dividing by the frequency.
this also makes calls to Instant::now() faster.
…ChrisDenton

windows: Elide division-by-zero checks in Instant::now()

This PR teaches LLVM that the frequency of the performance counter is non null so it is able to remove division by zero checks.
This removes the panic path in `mul_div_u64` and should make calls to `Instant::now()` (very slightly) faster.

As seen in the assembly (see godbolt below), telling LLVM that the frequency is non zero suffices to get the optimization, but I don't know if it could be a great idea to also update the signature of `mul_div_u64`?

MSDN page for [QueryPerformanceFrequency](https://learn.microsoft.com/en-us/windows/win32/api/profileapi/nf-profileapi-queryperformancefrequency):
> On systems that run Windows XP or later, the function will always succeed when given valid parameters and will thus never return zero.

Godbolt: https://rust.godbolt.org/z/xr6x8MrPE
…lt, r=JonathanBrouwer

Enable `clippy::mem_replace_with_default`

Enables `clippy::mem_replace_with_default` and fixes the errors that occur as a result.

Closes rust-lang#157245.
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Jun 2, 2026
@rustbot rustbot added O-windows Operating system: Windows S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jun 2, 2026
@jhpratt
Copy link
Copy Markdown
Member Author

jhpratt commented Jun 2, 2026

@bors r+ rollup=never p=5

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Jun 2, 2026

📌 Commit 8217114 has been approved by jhpratt

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 2, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jun 2, 2026
Rollup of 2 pull requests

Successful merges:

 - #157328 (windows: Elide division-by-zero checks in Instant::now())
 - #157336 (Enable `clippy::mem_replace_with_default`)
@rust-bors rust-bors Bot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 2, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Jun 2, 2026

💔 Test for 49642bb failed: CI. Failed job:

@rust-log-analyzer
Copy link
Copy Markdown
Collaborator

A job failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@jhpratt
Copy link
Copy Markdown
Member Author

jhpratt commented Jun 2, 2026

@bors retry

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 2, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jun 2, 2026
Rollup of 2 pull requests

Successful merges:

 - #157328 (windows: Elide division-by-zero checks in Instant::now())
 - #157336 (Enable `clippy::mem_replace_with_default`)
@rust-bors rust-bors Bot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 2, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Jun 2, 2026

💔 Test for 18ccdea failed: CI. Failed job:

@jhpratt
Copy link
Copy Markdown
Member Author

jhpratt commented Jun 2, 2026

@bors treeclosed=5

failing to get docker images

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Jun 2, 2026

Tree closed for PRs with priority less than 5.

@jhpratt
Copy link
Copy Markdown
Member Author

jhpratt commented Jun 2, 2026

@bors p=4 retry

@rust-log-analyzer
Copy link
Copy Markdown
Collaborator

A job failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@jhpratt jhpratt closed this Jun 3, 2026
@rust-bors rust-bors Bot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jun 3, 2026
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 3, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Jun 3, 2026

This pull request was unapproved due to being closed.

@jhpratt
Copy link
Copy Markdown
Member Author

jhpratt commented Jun 3, 2026

The status page for GitHub shows it's operational again

@bors treeclosed-

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Jun 3, 2026

Tree is now open for merging.

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

Labels

O-windows Operating system: Windows rollup A PR which is a rollup S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants