Skip to content

slice: make swap delegate to swap_unchecked#159272

Open
Rachit2323 wants to merge 1 commit into
rust-lang:mainfrom
Rachit2323:fix-slice-swap-use-swap-unchecked
Open

slice: make swap delegate to swap_unchecked#159272
Rachit2323 wants to merge 1 commit into
rust-lang:mainfrom
Rachit2323:fix-slice-swap-use-swap-unchecked

Conversation

@Rachit2323

Copy link
Copy Markdown

It had duplicate unsafe code that already existed in swap_unchecked. So I just made swap call swap_unchecked instead of copying the same logic twice.

@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 Jul 14, 2026
@rustbot

rustbot commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the pull request, and welcome! The Rust Project is excited to review your changes, and you should hear from @jhpratt (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue
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 6 candidates

@jhpratt

jhpratt commented Jul 14, 2026

Copy link
Copy Markdown
Member

@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 Jul 14, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jul 14, 2026
… r=<try>

slice: make swap delegate to swap_unchecked
@rust-bors

rust-bors Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 6b04ae2 (6b04ae20d8274ceea30b043dd61bb68a70f02ef9)
Base parent: 55b6bd8 (55b6bd8ecbed23599e966a04508a8a13cbfe90b3)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (6b04ae2): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up.

@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

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

Max RSS (memory usage)

Results (primary -0.5%, secondary -4.6%)

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

mean range count
Regressions ❌
(primary)
2.7% [2.7%, 2.7%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-3.7% [-3.7%, -3.7%] 1
Improvements ✅
(secondary)
-4.6% [-4.6%, -4.6%] 1
All ❌✅ (primary) -0.5% [-3.7%, 2.7%] 2

Cycles

Results (primary 4.0%)

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

mean range count
Regressions ❌
(primary)
4.0% [2.7%, 5.3%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 4.0% [2.7%, 5.3%] 2

Binary size

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

Bootstrap: 489.277s -> 490.003s (0.15%)
Artifact size: 389.95 MiB -> 389.96 MiB (0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 14, 2026
@jhpratt

jhpratt commented Jul 14, 2026

Copy link
Copy Markdown
Member

@bors r+ rollup

@rust-bors

rust-bors Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 7d5c925 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 Jul 14, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jul 14, 2026
…-unchecked, r=jhpratt

slice: make swap delegate to swap_unchecked

It had duplicate unsafe code that already existed in swap_unchecked. So I just made swap call swap_unchecked instead of copying the same logic twice.
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jul 14, 2026
…-unchecked, r=jhpratt

slice: make swap delegate to swap_unchecked

It had duplicate unsafe code that already existed in swap_unchecked. So I just made swap call swap_unchecked instead of copying the same logic twice.
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jul 14, 2026
…-unchecked, r=jhpratt

slice: make swap delegate to swap_unchecked

It had duplicate unsafe code that already existed in swap_unchecked. So I just made swap call swap_unchecked instead of copying the same logic twice.
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jul 14, 2026
…-unchecked, r=jhpratt

slice: make swap delegate to swap_unchecked

It had duplicate unsafe code that already existed in swap_unchecked. So I just made swap call swap_unchecked instead of copying the same logic twice.
rust-bors Bot pushed a commit that referenced this pull request Jul 14, 2026
…uwer

Rollup of 22 pull requests

Successful merges:

 - #156047 (Fix trait method resolution on an adjusted never type)
 - #157824 (Comptime inherent impls)
 - #158235 (Store `DefId` instead of `EiiDecl` in `EiiImplResolution::Known`)
 - #158723 (Support EII on Windows MSVC)
 - #158993 (rerun in original typing mode if we meet any opaques in post analysis)
 - #159160 (Make `HasTokens` a sub-trait of `HasAttrs`.)
 - #159183 (Introduce InstanceKind::LlvmIntrinsic)
 - #159251 (Bump rustc-perf submodule)
 - #155013 (Suggest the `[const] Destruct` bound for type parameters in const functions when missing)
 - #159155 (unstable book: Document `diagnostic_on_unknown` feature)
 - #159235 (Add regression test for #95719)
 - #159243 (inline Once wait and wait_force)
 - #159255 (Replace shortened type with `_` instead of `...` as placeholder)
 - #159259 (Add regression test for #144033)
 - #159265 (bootstrap: skip intrinsic-test when rustfmt is unavailable)
 - #159269 (disable range-len-try-from.rs on s390x)
 - #159272 (slice: make swap delegate to swap_unchecked)
 - #159274 (bootstrap: Rename `std_crates_for_run_make` to `std_crates_for_make_run`)
 - #159275 (remove obsolete comment)
 - #159277 (Construct `tokens` for attrs made by `mk_attr_word` and other variants)
 - #159283 (Remove obsolete verbose flag from deref/ref suggestions)
 - #159290 (rustc-dev-guide subtree update)
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.

4 participants