-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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 for arith ops #114841
add track_caller for arith ops #114841
Conversation
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
⌛ Trying commit d766ba4dac43f02a637e5780b0f975298f90ee04 with merge cf94c6c525288cbe7b7291e6d0ecd8ddb9f28f0f... |
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (cf94c6c525288cbe7b7291e6d0ecd8ddb9f28f0f): comparison URL. Overall result: ❌ regressions - no action neededBenchmarking 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 Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis 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.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeResultsThis 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.
Bootstrap: 631.44s -> 633.211s (0.28%) |
This comment has been minimized.
This comment has been minimized.
think I can remove T-compiler from the review of this PR @rustbot label -T-compiler |
Looks like this is no longer just div and mod? Can we have the PR description/title updated? |
library/core/src/ops/arith.rs
Outdated
@@ -194,6 +195,7 @@ pub trait Sub<Rhs = Self> { | |||
/// assert_eq!(12 - 1, 11); | |||
/// ``` | |||
#[must_use = "this returns the result of the operation, without modifying the original"] | |||
#[track_caller] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, @bvanjoi, can you remind me why this is best on the trait here, rather than on the implementation that has the #[rustc_inherit_overflow_checks]
? (Like the one at line 212 below.)
It's not clear to me that we should force this on everyone's Sub::sub
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I recall, placing it here was simply a means to reduce some of the code
Like the one at line 212 below.
Thank you for your reminder. I agree that it forms a better approach.
Since this was updated since the last run, let's double-check perf here: |
This comment has been minimized.
This comment has been minimized.
fix: add track_caller attr for div and mod Fixes rust-lang#114814 `#[track_caller]` is works, r? `@scottmcm`
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (a18f635): comparison URL. Overall result: ❌ regressions - no action neededBenchmarking 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 Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis 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.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeResultsThis 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.
Bootstrap: 624.133s -> 624.61s (0.08%) |
add track_caller for arith ops Fixes rust-lang#114814 `#[track_caller]` is works, r? ``@scottmcm``
Since it looks like there hasn't been a change since one of the new tests in this failed in #114841 (comment) @bors r- |
Re-rolling as I took myself off the libcore rotation, |
I've added |
@bors r+ rollup=never |
☀️ Test successful - checks-actions |
1 similar comment
☀️ Test successful - checks-actions |
Finished benchmarking commit (b1e56de): comparison URL. Overall result: ❌✅ regressions and improvements - ACTION NEEDEDNext Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis 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.
CyclesResultsThis 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.
Binary sizeResultsThis 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.
Bootstrap: 672.968s -> 673.535s (0.08%) |
IMO, the perf loss is unfortunate but pretty minor, especially weighed against the diagnostic gain. |
Also it's mostly in rustdoc, and the one debug benchmark affected looks a bit noisy. |
@rustbot label: +perf-regression-triaged :3 |
Fixes #114814
#[track_caller]
is works, r? @scottmcm