Skip to content

Add #[track_caller] to signed integer div/rem methods - #161607

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
kiana1kaslana:track-caller-signed-div
Sep 6, 2026
Merged

Add #[track_caller] to signed integer div/rem methods#161607
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
kiana1kaslana:track-caller-signed-div

Conversation

@kiana1kaslana

@kiana1kaslana kiana1kaslana commented Aug 23, 2026

Copy link
Copy Markdown

Fixes #139672

The unsigned div/rem methods got #[track_caller] in 724fe8f but
the signed side was missed. This adds it to the 8 signed methods
listed in the issue, including overflowing_div_euclid which the
issue missed but wrapping_div_euclid delegates to.

No test added, matching the unsigned side. cg_gcc doesn't
propagate track_caller through inlined div/rem yet so a runtime
check would fail on the gcc-core-tests CI job.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 23, 2026
@rustbot rustbot added the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Aug 23, 2026
@rustbot

rustbot commented Aug 23, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the pull request, and welcome! The Rust Project has assigned @Mark-Simulacrum (or someone else) to review your changes, you should hear from them (or someone else) within the next two weeks.

Please see the contribution instructions and our LLM policy for more information.

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: libs
  • libs expanded to 12 candidates
  • Random selection from JohnTitor, Mark-Simulacrum, clarfonthey, nia-e

@rustbot

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@kiana1kaslana
kiana1kaslana force-pushed the track-caller-signed-div branch from 589cdb5 to bfdeee0 Compare August 23, 2026 15:56
@rust-log-analyzer

This comment has been minimized.

The unsigned counterparts got the attribute in #724fe8f, but the
signed side was missed, so panics like `0i32.wrapping_div(0)` point
at the library source instead of the caller.

Also covers overflowing_div_euclid, which the issue missed but
wrapping_div_euclid delegates to, so it would still report the wrong
location without it.
@kiana1kaslana
kiana1kaslana force-pushed the track-caller-signed-div branch from bfdeee0 to e4204a1 Compare August 24, 2026 03:00
@Mark-Simulacrum

Copy link
Copy Markdown
Member

#724fe8f

Did you mean something else here? Looks like something tried to use a hex color code instead of an issue/PR number?

@Mark-Simulacrum

Copy link
Copy Markdown
Member

r=me with that fixed

@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 31, 2026
@kiana1kaslana kiana1kaslana reopened this Aug 31, 2026
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 31, 2026
@kiana1kaslana

Copy link
Copy Markdown
Author

that was a commit short hash for the previous track_caller
addition, not an issue ref. Switched to backticks.

@Mark-Simulacrum

Copy link
Copy Markdown
Member

@bors r+

@rust-bors

rust-bors Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

📌 Commit e4204a1 has been approved by Mark-Simulacrum

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 Sep 5, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Sep 5, 2026
…-Simulacrum

Add #[track_caller] to signed integer div/rem methods

Fixes #139672

The unsigned div/rem methods got #[track_caller] in 724fe8f but
the signed side was missed. This adds it to the 8 signed methods
listed in the issue, including overflowing_div_euclid which the
issue missed but wrapping_div_euclid delegates to.

No test added, matching the unsigned side. cg_gcc doesn't
propagate track_caller through inlined div/rem yet so a runtime
check would fail on the gcc-core-tests CI job.
@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 Sep 6, 2026
@rust-bors

rust-bors Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

💔 Test for 6675d95 failed: CI. Failed job:

@kiana1kaslana

Copy link
Copy Markdown
Author

@bors retry

@rust-bors

rust-bors Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

@kiana1kaslana: 🔑 Insufficient privileges: not in review users

@kiana1kaslana

Copy link
Copy Markdown
Author

@Mark-Simulacrum the i686-msvc-2 job failed with "The hosted runner lost communication with the server", and a few other jobs were cancelled at the same time. I don't have bors privileges, so could you @bors retry when you have a moment? The code itself shouldn't be related — it's just a #[track_caller] addition on signed div/rem methods.

@rust-bors

rust-bors Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

@kiana1kaslana: 🔑 Insufficient privileges: not in review users

@JonathanBrouwer

Copy link
Copy Markdown
Member

@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 Sep 6, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 6, 2026
…uwer

Rollup of 4 pull requests

Successful merges:

 - #162032 (remove more trivial regions in evaluate_added_goals_and_make_canonical_response)
 - #161607 (Add #[track_caller] to signed integer div/rem methods)
 - #162339 (Revert "bootstrap: Enable rustdoc mergeable CCI for std and internal docs #161716")
 - #162158 (Revise documentation of `NumBuffer` and `format_into()`.)
@rust-bors
rust-bors Bot merged commit 34606c6 into rust-lang:main Sep 6, 2026
26 of 27 checks passed
@rustbot rustbot added this to the 1.100.0 milestone Sep 6, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 6, 2026
Rollup merge of #161607 - kiana1kaslana:track-caller-signed-div, r=Mark-Simulacrum

Add #[track_caller] to signed integer div/rem methods

Fixes #139672

The unsigned div/rem methods got #[track_caller] in 724fe8f but
the signed side was missed. This adds it to the 8 signed methods
listed in the issue, including overflowing_div_euclid which the
issue missed but wrapping_div_euclid delegates to.

No test added, matching the unsigned side. cg_gcc doesn't
propagate track_caller through inlined div/rem yet so a runtime
check would fail on the gcc-core-tests CI job.
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.

Division/remainder functions for primitives inconsistenly apply #[track_caller]

5 participants