Skip to content

Add #[track_caller] to Duration Div impl#137207

Merged
bors merged 1 commit into
rust-lang:masterfrom
petertodd:2025-add-track-caller-to-duration-div
Feb 22, 2025
Merged

Add #[track_caller] to Duration Div impl#137207
bors merged 1 commit into
rust-lang:masterfrom
petertodd:2025-add-track-caller-to-duration-div

Conversation

@petertodd

Copy link
Copy Markdown
Contributor

Previously the location of the divide-by-zero error condition would be attributed to the code in the rust standard library, eg:

thread 'main' panicked at /home/user/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/time.rs:1172:31:
divide by zero error when dividing duration by scalar

With #[track_caller] the error is correctly attributed to the callee.

Previously the location of the divide-by-zero error condition would be
attributed to the code in the rust standard library, eg:

	thread 'main' panicked at /home/user/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/time.rs:1172:31:
	divide by zero error when dividing duration by scalar

With #[track_caller] the error is correctly attributed to the callee.
@rustbot

rustbot commented Feb 18, 2025

Copy link
Copy Markdown
Collaborator

r? @jhpratt

rustbot has assigned @jhpratt.
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

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Feb 18, 2025
@jhpratt

jhpratt commented Feb 18, 2025

Copy link
Copy Markdown
Member

I'm checking to see if this needs team approval, but personally I have no issue with this.

@jhpratt

jhpratt commented Feb 19, 2025

Copy link
Copy Markdown
Member

No FCP necessary, but a perf run was suggested.

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 19, 2025
@bors

bors commented Feb 19, 2025

Copy link
Copy Markdown
Collaborator

⌛ Trying commit 4e4cb10 with merge c9c3813...

@bors

bors commented Feb 19, 2025

Copy link
Copy Markdown
Collaborator

☀️ Try build successful - checks-actions
Build commit: c9c3813 (c9c3813527b3fe47aeb88baa3d8f90a6c17cf284)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (c9c3813): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results (primary 0.2%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
1.6% [1.6%, 1.6%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.2% [-1.2%, -1.2%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.2% [-1.2%, 1.6%] 2

Cycles

Results (primary -1.3%, secondary -9.1%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.3% [-2.1%, -0.5%] 2
Improvements ✅
(secondary)
-9.1% [-9.1%, -9.1%] 1
All ❌✅ (primary) -1.3% [-2.1%, -0.5%] 2

Binary size

Results (secondary 0.0%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.0% [0.0%, 0.0%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Bootstrap: 775.604s -> 772.241s (-0.43%)
Artifact size: 360.33 MiB -> 360.31 MiB (-0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 19, 2025
@jhpratt

jhpratt commented Feb 19, 2025

Copy link
Copy Markdown
Member

@bors r+

@bors

bors commented Feb 19, 2025

Copy link
Copy Markdown
Collaborator

📌 Commit 4e4cb10 has been approved by jhpratt

It is now in the queue for this repository.

@bors bors 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 Feb 19, 2025
@compiler-errors

Copy link
Copy Markdown
Contributor

@bors rollup=maybe

@bors bors merged commit 5400270 into rust-lang:master Feb 22, 2025
@rustbot rustbot added this to the 1.87.0 milestone Feb 22, 2025
@petertodd petertodd deleted the 2025-add-track-caller-to-duration-div branch February 22, 2025 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

6 participants