Skip to content

slice::join: borrow only once during length calc#155858

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
ChrisDenton:borrowed-len
Apr 28, 2026
Merged

slice::join: borrow only once during length calc#155858
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
ChrisDenton:borrowed-len

Conversation

@ChrisDenton
Copy link
Copy Markdown
Member

@ChrisDenton ChrisDenton commented Apr 27, 2026

This ensures the length calculation will always be self-consistent even if the real length changes when we actually come to use them.

This is a follow up to #155708

@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 Apr 27, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 27, 2026

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

Why was this reviewer chosen?

The reviewer was selected based on:

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

Comment thread library/alloctests/tests/str.rs
This ensures the length calculation will always be self-consistent even if the real length changes when we actually come to use them.
@jhpratt
Copy link
Copy Markdown
Member

jhpratt commented Apr 28, 2026

@bors r+

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 28, 2026

📌 Commit b7424ba 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 Apr 28, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Apr 28, 2026
`slice::join`: borrow only once during length calc

This ensures the length calculation will always be self-consistent even if the real length changes when we actually come to use them.

This is a follow up to rust-lang#155708
jhpratt added a commit to jhpratt/rust that referenced this pull request Apr 28, 2026
`slice::join`: borrow only once during length calc

This ensures the length calculation will always be self-consistent even if the real length changes when we actually come to use them.

This is a follow up to rust-lang#155708
rust-bors Bot pushed a commit that referenced this pull request Apr 28, 2026
Rollup of 9 pull requests

Successful merges:

 - #155381 (Fix a bug in `ChunkedBitSet::subtract`)
 - #155847 (Don't reload length in String::push)
 - #155858 (`slice::join`: borrow only once during length calc)
 - #155879 (enable pipe tests in Miri)
 - #155905 (Update LLVM to 22.1.4 (again))
 - #155247 ([AIX] update linker default to bcdtors)
 - #155812 ([codex] tests: mark migrated UI tests as check-pass)
 - #155854 (Rename the diagnostic item for `std::sync::mpsc::Receiver`)
 - #155882 (Add regression test for #101363)
@rust-bors rust-bors Bot merged commit 06fa547 into rust-lang:main Apr 28, 2026
11 checks passed
@rustbot rustbot added this to the 1.97.0 milestone Apr 28, 2026
rust-timer added a commit that referenced this pull request Apr 28, 2026
Rollup merge of #155858 - ChrisDenton:borrowed-len, r=jhpratt

`slice::join`: borrow only once during length calc

This ensures the length calculation will always be self-consistent even if the real length changes when we actually come to use them.

This is a follow up to #155708
@JonathanBrouwer
Copy link
Copy Markdown
Contributor

@bors r-
This is already merged but still in the queue?

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 28, 2026

📋 Only unclosed PRs can be unapproved.

@ChrisDenton ChrisDenton deleted the borrowed-len branch April 29, 2026 01:56
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