Skip to content

Conversation

@theemathas
Copy link
Contributor

This simplifies the code, provides better panic messages, and avoids an integer overflow.

@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 Nov 29, 2025
@rustbot
Copy link
Collaborator

rustbot commented Nov 29, 2025

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


#[test]
#[should_panic]
#[should_panic = "range start index 18446744073709551615 out of range for slice of length 3"]
Copy link

Choose a reason for hiding this comment

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

Not sure if these tests are gated, but generally usize::MAX depends on the pointer width of the platform, so we shouldn't hard code it

@Mark-Simulacrum
Copy link
Member

r=me with comment fixed

@bors try jobs=i686-gnu-*

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Dec 8, 2025
Rewrite `String::replace_range`

try-job: i686-gnu-*
@rust-log-analyzer

This comment has been minimized.

@rust-bors
Copy link
Contributor

rust-bors bot commented Dec 8, 2025

💔 Test for f4bd5be failed: CI. Failed jobs:

This simplifies the code, provides better panic messages,
and avoids an integer overflow.
@theemathas theemathas force-pushed the string-replace_range branch from 6ee39cc to 5f5286b Compare December 8, 2025 10:44
@theemathas
Copy link
Contributor Author

@bors r=Mark-Simulacrum

@bors
Copy link
Collaborator

bors commented Dec 8, 2025

@theemathas: 🔑 Insufficient privileges: Not in reviewers

@theemathas
Copy link
Contributor Author

@rustbot ready

@Mark-Simulacrum
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Dec 28, 2025

📌 Commit 5f5286b has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@bors bors 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 Dec 28, 2025
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Dec 28, 2025
…=Mark-Simulacrum

Rewrite `String::replace_range`

This simplifies the code, provides better panic messages, and avoids an integer overflow.
bors added a commit that referenced this pull request Dec 28, 2025
…uwer

Rollup of 5 pull requests

Successful merges:

 - #147499 (Implement round-ties-to-even for Duration Debug for consistency with f64)
 - #149447 (Rewrite `String::replace_range`)
 - #149469 (Leverage &mut in OnceLock when possible)
 - #149921 (Add new source component that includes GPL-licensed source)
 - #150460 (fix ManuallyDrop::into_inner aliasing (Miri) issues)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 3c7ffa5 into rust-lang:main Dec 28, 2025
11 checks passed
@rustbot rustbot added this to the 1.94.0 milestone Dec 28, 2025
rust-timer added a commit that referenced this pull request Dec 28, 2025
Rollup merge of #149447 - theemathas:string-replace_range, r=Mark-Simulacrum

Rewrite `String::replace_range`

This simplifies the code, provides better panic messages, and avoids an integer overflow.
@theemathas theemathas deleted the string-replace_range branch December 28, 2025 23:14
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Dec 29, 2025
…uwer

Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#147499 (Implement round-ties-to-even for Duration Debug for consistency with f64)
 - rust-lang/rust#149447 (Rewrite `String::replace_range`)
 - rust-lang/rust#149469 (Leverage &mut in OnceLock when possible)
 - rust-lang/rust#149921 (Add new source component that includes GPL-licensed source)
 - rust-lang/rust#150460 (fix ManuallyDrop::into_inner aliasing (Miri) issues)

r? `@ghost`
`@rustbot` modify labels: rollup
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.

6 participants