Skip to content
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 const slice::split_at #108273

Merged
merged 1 commit into from
May 15, 2023

Conversation

tspiteri
Copy link
Contributor

@tspiteri tspiteri commented Feb 20, 2023

This stabilizes the use of the following method in const context:

impl<T> [T] {
    pub const fn split_at(&self, mid: usize) -> (&[T], &[T]);
}

cc tracking issue #101158

@rustbot
Copy link
Collaborator

rustbot commented Feb 20, 2023

r? @m-ou-se

(rustbot has picked a reviewer for you, use r? to override)

@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 Feb 20, 2023
@rustbot
Copy link
Collaborator

rustbot commented Feb 20, 2023

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

This stabilizes the use of the following method in const context:

    impl<T> [T] {
        pub const fn split_at(&self, mid: usize) -> (&[T], &[T]);
    }
@tspiteri tspiteri force-pushed the const_slice_split_at_not_mut branch from 70a5ade to b46b05d Compare February 20, 2023 16:06
@tspiteri
Copy link
Contributor Author

tspiteri commented Feb 20, 2023

As an example use case, this stabilization would allow me to remove a function that has to use unsafe code to achieve the same thing, which is required for the parsing of literals in const context in the fixed crate.

@JohnTitor JohnTitor added the needs-fcp This change is insta-stable, so needs a completed FCP to proceed. label Mar 10, 2023
@fee1-dead
Copy link
Member

@rustbot label +T-libs-api -T-libs

@rustbot rustbot added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. and removed T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Mar 23, 2023
@m-ou-se m-ou-se added S-waiting-on-fcp Status: PR is in FCP and is awaiting for FCP to complete. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 1, 2023
@dtolnay dtolnay added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-fcp Status: PR is in FCP and is awaiting for FCP to complete. labels May 14, 2023
@dtolnay dtolnay assigned dtolnay and unassigned m-ou-se May 14, 2023
Copy link
Member

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

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

Completed FCP in #101158.

@dtolnay
Copy link
Member

dtolnay commented May 14, 2023

@bors r+

@bors
Copy link
Collaborator

bors commented May 14, 2023

📌 Commit b46b05d has been approved by dtolnay

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 May 14, 2023
@bors
Copy link
Collaborator

bors commented May 15, 2023

⌛ Testing commit b46b05d with merge 0bcfd2d...

@bors
Copy link
Collaborator

bors commented May 15, 2023

☀️ Test successful - checks-actions
Approved by: dtolnay
Pushing 0bcfd2d to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 15, 2023
@bors bors merged commit 0bcfd2d into rust-lang:master May 15, 2023
@rustbot rustbot added this to the 1.71.0 milestone May 15, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (0bcfd2d): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.0% [-2.0%, -2.0%] 1
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.2% [2.5%, 3.8%] 2
Improvements ✅
(primary)
-4.5% [-5.0%, -4.1%] 3
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -4.5% [-5.0%, -4.1%] 3

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 643.398s -> 640.795s (-0.40%)

@tspiteri tspiteri deleted the const_slice_split_at_not_mut branch May 23, 2023 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. needs-fcp This change is insta-stable, so needs a completed FCP to proceed. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants