Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add #[track_caller] to Duration Div impl #137207

Merged

Conversation

petertodd
Copy link
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
Copy link
Collaborator

rustbot commented Feb 18, 2025

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
Copy link
Member

jhpratt commented Feb 18, 2025

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

@jhpratt
Copy link
Member

jhpratt commented Feb 19, 2025

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 added a commit to rust-lang-ci/rust that referenced this pull request Feb 19, 2025
…uration-div, r=<try>

Add #[track_caller] to Duration Div impl

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.
@bors
Copy link
Contributor

bors commented Feb 19, 2025

⌛ Trying commit 4e4cb10 with merge c9c3813...

@bors
Copy link
Contributor

bors commented Feb 19, 2025

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

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
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
Copy link
Member

jhpratt commented Feb 19, 2025

@bors r+

@bors
Copy link
Contributor

bors commented Feb 19, 2025

📌 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
Member

@bors rollup=maybe

bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 22, 2025
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#136458 (Do not deduplicate list of associated types provided by dyn principal)
 - rust-lang#136474 ([`compiletest`-related cleanups 3/7] Make the distinction between sources root vs test suite sources root in compiletest less confusing)
 - rust-lang#136592 (Make sure we don't overrun the stack in canonicalizer)
 - rust-lang#136787 (Remove `lifetime_capture_rules_2024` feature)
 - rust-lang#137207 (Add #[track_caller] to Duration Div impl)
 - rust-lang#137245 (Tweak E0277 when predicate comes indirectly from ?)
 - rust-lang#137257 (Ignore fake borrows for packed field check)
 - rust-lang#137399 (fix ICE in layout computation with unnormalizable const)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 5400270 into rust-lang:master Feb 22, 2025
7 checks passed
@rustbot rustbot added this to the 1.87.0 milestone Feb 22, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Feb 22, 2025
Rollup merge of rust-lang#137207 - petertodd:2025-add-track-caller-to-duration-div, r=jhpratt

Add #[track_caller] to Duration Div impl

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.
@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