Skip to content

Implement feature integer_casts#157402

Merged
rust-bors[bot] merged 4 commits into
rust-lang:mainfrom
orlp:int-cast
Jun 8, 2026
Merged

Implement feature integer_casts#157402
rust-bors[bot] merged 4 commits into
rust-lang:mainfrom
orlp:int-cast

Conversation

@orlp

@orlp orlp commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

View all comments

Tracking issue: #157388

@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 Jun 3, 2026
@rustbot

rustbot commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

r? @Mark-Simulacrum

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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: libs
  • libs expanded to 8 candidates
  • Random selection from Mark-Simulacrum, jhpratt

@rustbot

This comment has been minimized.

@jhpratt jhpratt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread library/core/src/convert/num.rs Outdated
Comment thread library/core/src/convert/num.rs Outdated
Comment thread library/core/src/convert/num.rs Outdated
Comment thread library/core/src/num/int_macros.rs Outdated
@rustbot rustbot assigned jhpratt and unassigned Mark-Simulacrum Jun 7, 2026
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 7, 2026
@rustbot

rustbot commented Jun 7, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@rustbot rustbot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jun 7, 2026
@orlp

orlp commented Jun 7, 2026

Copy link
Copy Markdown
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 7, 2026
@jhpratt

jhpratt commented Jun 7, 2026

Copy link
Copy Markdown
Member

That wording works for me.

@bors r+ rollup

@rust-bors

rust-bors Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 9d5fa40 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 7, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jun 7, 2026
Implement feature `integer_casts`

Tracking issue: rust-lang#157388
jhpratt added a commit to jhpratt/rust that referenced this pull request Jun 7, 2026
Implement feature `integer_casts`

Tracking issue: rust-lang#157388
@rust-bors rust-bors Bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 7, 2026
@rust-bors

This comment has been minimized.

@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 8, 2026
@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)

@jieyouxu

jieyouxu commented Jun 8, 2026

Copy link
Copy Markdown
Member

@bors p=101
@bors retry

@rust-bors

This comment was marked as outdated.

@rust-bors

rust-bors Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

⌛ Testing commit d79b87b with merge 47e54da...

Workflow: https://github.com/rust-lang/rust/actions/runs/27116431268

rust-bors Bot pushed a commit that referenced this pull request Jun 8, 2026
Implement feature `integer_casts`



Tracking issue: #157388
@jhpratt

jhpratt commented Jun 8, 2026

Copy link
Copy Markdown
Member

@bors treeclosed-

@bors yield

Yielding so that the rollup=nevers get a chance to run before things get busier with the start of business hours in Europe. An n=4 rollup doesn't make much sense when there's 3 nevers waiting.

@rust-bors

rust-bors Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Tree is now open for merging.

@rust-bors

rust-bors Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Auto build was cancelled. Cancelled workflows:

The next pull request likely to be tested is #157402.

@rust-bors

rust-bors Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

⌛ Testing commit d79b87b with merge e6f8fdb...

Workflow: https://github.com/rust-lang/rust/actions/runs/27116808211

rust-bors Bot pushed a commit that referenced this pull request Jun 8, 2026
Implement feature `integer_casts`



Tracking issue: #157388
@jhpratt

jhpratt commented Jun 8, 2026

Copy link
Copy Markdown
Member

@bors p=0

@bors yield

@rust-bors

rust-bors Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Auto build was cancelled. Cancelled workflows:

The next pull request likely to be tested is #155607.

rust-bors Bot pushed a commit that referenced this pull request Jun 8, 2026
…uwer

Rollup of 9 pull requests

Successful merges:

 - #157599 (`rust-analyzer` subtree update)
 - #157298 (Use alternate means of detecting enums in `is_udt`)
 - #155338 (Staticlib hide internal symbols)
 - #157402 (Implement feature `integer_casts`)
 - #157452 (Fix WASI links)
 - #157535 (Rename `errors.rs` file to `diagnostics.rs` (2/N))
 - #157585 (Rename `errors.rs` file to `diagnostics.rs` (3/N))
 - #157588 (Use `mul nuw nsw` in `intrinsics::copy`)
 - #157592 (Suggest comma multiple)
@rust-bors rust-bors Bot merged commit 150c383 into rust-lang:main Jun 8, 2026
2 of 13 checks passed
@rustbot rustbot added this to the 1.98.0 milestone Jun 8, 2026
rust-timer added a commit that referenced this pull request Jun 8, 2026
Rollup merge of #157402 - orlp:int-cast, r=jhpratt

Implement feature `integer_casts`

Tracking issue: #157388
@Mark-Simulacrum

Copy link
Copy Markdown
Member

@rust-timer build d65ab4d

cc #157600 (comment)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (d65ab4d): comparison URL.

Overall result: ❌✅ regressions and improvements - please read:

Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf.

Next, please: If you can, justify the regressions found in this try perf run in writing along with @rustbot label: +perf-regression-triaged. If not, fix the regressions and do another perf run. Neutral or positive results will clear the label automatically.

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

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.6% [0.2%, 1.6%] 16
Regressions ❌
(secondary)
1.1% [0.3%, 1.8%] 24
Improvements ✅
(primary)
-0.3% [-0.5%, -0.3%] 4
Improvements ✅
(secondary)
-0.4% [-1.0%, -0.2%] 7
All ❌✅ (primary) 0.4% [-0.5%, 1.6%] 20

Max RSS (memory usage)

Results (primary 1.3%, secondary 3.6%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
1.3% [1.0%, 1.5%] 5
Regressions ❌
(secondary)
3.6% [3.6%, 3.6%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.3% [1.0%, 1.5%] 5

Cycles

Results (secondary -2.8%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.8% [1.8%, 1.8%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.5% [-6.1%, -2.3%] 7
All ❌✅ (primary) - - 0

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 516.268s -> 516.499s (0.04%)
Artifact size: 400.81 MiB -> 400.82 MiB (0.00%)

@rustbot rustbot added the perf-regression Performance regression. label Jun 9, 2026
@JonathanBrouwer

JonathanBrouwer commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Caused the perf regression in #157600
Is there anything we can do about this?

@jhpratt

jhpratt commented Jun 9, 2026

Copy link
Copy Markdown
Member

I'm unsure how it could cause such a significant change in the first place, to be honest.

@orlp

orlp commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

@jhpratt @JonathanBrouwer I think it's fairly obvious. All the regressions are for creating docs. This PR adds ~288 trait implementations to the standard library that end up being documented/processed.

If the trait ends up being perma-unstable I can see us #[doc(hidden)] them, but if the goal is to eventually stabilize them as well (so you can write e.g. u8::checked_cast_from), I don't think there's much we can do.

@JonathanBrouwer

JonathanBrouwer commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Does adding trait impls to the stdlib also make downstream crates slower to document? I guess that makes sense to some degree but still interesting

@orlp

orlp commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

Yes, but also not by much. Adding 288 new impls is quite a lot and only resulted in 0.3-1% slowdowns, with 1.5% being an exception on hello world. The latter crate naturally is the fastest to document in the first place, meaning any fixed overhead shows up more.

It's not my decision but I don't think further action is required at this time.

@JonathanBrouwer

Copy link
Copy Markdown
Contributor

I agree, but I'll cc the rustdoc team so they at least know about it

Cc @rust-lang/rustdoc

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

Labels

perf-regression Performance regression. 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.

8 participants