-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.
Milestone
Description
Feature gate: #![feature(const_swap)]
This is a tracking issue for making the functions mem::swap
and ptr::swap[_nonoverlapping]
and some other swap related functions const fn
.
Public API
mod ptr {
pub const unsafe fn swap<T>(x: *mut T, y: *mut T);
}
mod mem {
pub const fn swap<T>(x: &mut T, y: &mut T);
}
impl<T> [T] {
pub const fn swap(&mut self, a: usize, b: usize);
}
impl<T: ?Sized> *mut T {
pub const unsafe fn swap(self, with: *mut T);
}
impl <T> NonNull<T> {
pub const unsafe fn swap(self, with: NonNull<T>);
}
Steps / History
- Implementation (
mem
andptr
): Constifycopy
related functions #83091 - Implementation (
[T]
and*mut T )
Extend the const swap feature #90644 -
NonNull
methods stabilized,const
ness moved to this gate Stabilizenon_null_convenience
#124498 - Final commenting period (FCP)
- Stabilization PR
Unresolved Questions
- What do we do with the bytewise pointer swap situation?
joseluis and lukaslihotzkibjoernager
Metadata
Metadata
Assignees
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.