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

Extend the const swap feature #90644

Merged
merged 1 commit into from
Nov 12, 2021
Merged

Extend the const swap feature #90644

merged 1 commit into from
Nov 12, 2021

Conversation

est31
Copy link
Member

@est31 est31 commented Nov 6, 2021

Adds the const_swap feature gate to three more swap functions. cc tracking issue #83163

impl<T> [T] {
    pub const fn swap(&mut self, a: usize, b: usize);
    pub const unsafe fn swap_unchecked(&mut self, a: usize, b: usize);
}
impl<T: ?Sized> *mut T {
    pub const unsafe fn swap(self, with: *mut T);
}

@rust-highfive
Copy link
Collaborator

r? @Mark-Simulacrum

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 6, 2021
@est31 est31 mentioned this pull request Nov 6, 2021
5 tasks
@Mark-Simulacrum
Copy link
Member

Can we squash commits? r=me once that's done

@Mark-Simulacrum Mark-Simulacrum added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 9, 2021
This makes the inherent method ptr::swap unstably
const, as well as slice::swap{,_unchecked}.
@apiraino apiraino added the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Nov 11, 2021
@est31
Copy link
Member Author

est31 commented Nov 12, 2021

@Mark-Simulacrum I've squashed them. so re-r? @Mark-Simulacrum

@Mark-Simulacrum
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Nov 12, 2021

📌 Commit eeaa2f1 has been approved by Mark-Simulacrum

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 12, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 12, 2021
…askrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#90589 (rustc_llvm: update PassWrapper for recent LLVM)
 - rust-lang#90644 (Extend the const swap feature)
 - rust-lang#90704 (Unix ExitStatus comments and a tiny docs fix)
 - rust-lang#90761 (Shorten Span of unused macro lints)
 - rust-lang#90795 (Add more comments to explain the code to generate the search index)
 - rust-lang#90798 (Document `unreachable!` custom panic message)
 - rust-lang#90826 (rustc_feature: Convert `BuiltinAttribute` from tuple to a struct)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 70532c4 into rust-lang:master Nov 12, 2021
@rustbot rustbot added this to the 1.58.0 milestone Nov 12, 2021
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