-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Stabilize split_at_checked
#124678
Merged
bors
merged 1 commit into
rust-lang:master
from
UserIsntAvailable:feat/stabilize-split-at-checked
May 4, 2024
Merged
Stabilize split_at_checked
#124678
bors
merged 1 commit into
rust-lang:master
from
UserIsntAvailable:feat/stabilize-split-at-checked
May 4, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
May 3, 2024
tgross35
approved these changes
May 3, 2024
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.
I had a PR in the works and came up with the same thing, you beat me to it :)
This PR makes the following API stable:
impl<T> [T] {
// Stabilized as const
pub const fn split_at_checked(&self, mid: usize) -> Option<(&[T], &[T])>;
// Const stability moved to `const_slice_split_at_mut`
pub const fn split_at_mut_checked(&mut self, mid: usize) -> Option<(&mut [T], &mut [T])>;
}
impl str {
pub fn split_at_checked(&self, mid: usize) -> Option<(&str, &str)>;
pub fn split_at_mut_checked(&mut self, mid: usize) -> Option<(&mut str, &mut str)>;
}
Reusing the feature flag for @bors r+ |
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
May 4, 2024
compiler-errors
added a commit
to compiler-errors/rust
that referenced
this pull request
May 4, 2024
…plit-at-checked, r=jhpratt Stabilize `split_at_checked` Closes rust-lang#119128 For the const version of `slice::split_at_mut_checked`, I'm reusing the `const_slice_split_at_mut` feature flag (rust-lang#101804). I don't if it okay to reuse tracking issues or if it preferred to create new ones...
This was referenced May 4, 2024
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
May 4, 2024
…mpiler-errors Rollup of 8 pull requests Successful merges: - rust-lang#124418 (Use a proof tree visitor to refine the `Obligation` for error reporting in new solver) - rust-lang#124480 (Change `SIGPIPE` ui from `#[unix_sigpipe = "..."]` to `-Zon-broken-pipe=...`) - rust-lang#124648 (Trim crate graph) - rust-lang#124656 (release notes 1.78: add link to interior-mut breaking change) - rust-lang#124658 (Migrate `run-make/doctests-keep-binaries` to new rmake.rs format) - rust-lang#124678 (Stabilize `split_at_checked`) - rust-lang#124681 (zkvm: fix run_tests) - rust-lang#124687 (Make `Bounds.clauses` private) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
May 4, 2024
Rollup merge of rust-lang#124678 - UserIsntAvailable:feat/stabilize-split-at-checked, r=jhpratt Stabilize `split_at_checked` Closes rust-lang#119128 For the const version of `slice::split_at_mut_checked`, I'm reusing the `const_slice_split_at_mut` feature flag (rust-lang#101804). I don't if it okay to reuse tracking issues or if it preferred to create new ones...
6 tasks
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #119128
For the const version of
slice::split_at_mut_checked
, I'm reusing theconst_slice_split_at_mut
feature flag (#101804). I don't if it okay to reuse tracking issues or if it preferred to create new ones...