Skip to content

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

Open
ChrisDenton wants to merge 1 commit intorust-lang:mainfrom
ChrisDenton:borrowed-len
Open

slice::join: borrow only once during length calc#155858
ChrisDenton wants to merge 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


#[test]
fn test_join_issue_80335() {
fn test_join_inconsistent_borrow_shrink() {
Copy link
Copy Markdown
Member Author

@ChrisDenton ChrisDenton Apr 27, 2026

Choose a reason for hiding this comment

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

I also changed the names of these tests to more clearly show how they're related. Especially since putting issue numbers in test names isn't really something we like to do any more.

View changes since the review

This ensures the length calculation will always be self-consistent even if the real length changes when we actually come to use them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants