-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Rewrite String::replace_range
#149447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewrite String::replace_range
#149447
Conversation
|
rustbot has assigned @Mark-Simulacrum. Use |
library/alloctests/tests/string.rs
Outdated
|
|
||
| #[test] | ||
| #[should_panic] | ||
| #[should_panic = "range start index 18446744073709551615 out of range for slice of length 3"] |
There was a problem hiding this comment.
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
|
r=me with comment fixed @bors try jobs=i686-gnu-* |
This comment has been minimized.
This comment has been minimized.
Rewrite `String::replace_range` try-job: i686-gnu-*
This comment has been minimized.
This comment has been minimized.
|
💔 Test for f4bd5be failed: CI. Failed jobs:
|
This simplifies the code, provides better panic messages, and avoids an integer overflow.
6ee39cc to
5f5286b
Compare
|
@bors r=Mark-Simulacrum |
|
@theemathas: 🔑 Insufficient privileges: Not in reviewers |
|
@rustbot ready |
|
@bors r+ |
…=Mark-Simulacrum Rewrite `String::replace_range` This simplifies the code, provides better panic messages, and avoids an integer overflow.
…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
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.
…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
This simplifies the code, provides better panic messages, and avoids an integer overflow.