Skip to content

stabilize const_intrinsic_copy - #130762

Merged
bors merged 1 commit into
rust-lang:masterfrom
RalfJung:const_intrinsic_copy
Sep 24, 2024
Merged

bors merged 1 commit into
rust-lang:masterfrom
RalfJung:const_intrinsic_copy

Conversation

@RalfJung

Copy link
Copy Markdown
Member

Fixes #80697

This stabilizes

mod ptr {
    pub const unsafe fn copy_nonoverlapping<T>(src: *const T, dst: *mut T, count: usize);
    pub const unsafe fn copy<T>(src: *const T, dst: *mut T, count: usize);
}

impl *const T {
    pub const unsafe fn copy_to(self, dest: *mut T, count: usize);
    pub const unsafe fn copy_to_nonoverlapping(self, dest: *mut T, count: usize);
}

impl *mut T {
    pub const unsafe fn copy_to(self, dest: *mut T, count: usize);
    pub const unsafe fn copy_to_nonoverlapping(self, dest: *mut T, count: usize);

    pub const unsafe fn copy_from(self, src: *const T, count: usize);
    pub const unsafe fn copy_from_nonoverlapping(self, src: *const T, count: usize);
}

impl <T> NonNull<T> {
    pub const unsafe fn copy_to(self, dest: NonNull<T>, count: usize);
    pub const unsafe fn copy_to_nonoverlapping(self, dest: NonNull<T>, count: usize);

    pub const unsafe fn copy_from(self, src: NonNull<T>, count: usize);
    pub const unsafe fn copy_from_nonoverlapping(self, src: NonNull<T>, count: usize);
}

In particular, this reverts #117905, which reverted #97276.

The NonNull methods are not listed in the tracking issue, they were added to this feature gate in #124498. The existing FCP does not cover them. They are however entirely identical to the *mut methods and already stable outside const. @rust-lang/libs-api please let me know if FCP will be required for the NonNull methods.

@ghost ghost self-assigned this Sep 23, 2024

ghost commented Sep 23, 2024

Copy link
Copy Markdown

r? @workingjubilee

rustbot has assigned @workingjubilee.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@ghost ghost 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 Sep 23, 2024

ghost commented Sep 23, 2024

Copy link
Copy Markdown

Portable SIMD is developed in its own repository. If possible, consider making this change to rust-lang/portable-simd instead.

cc @calebzulawski, @programmerjake

@ghost ghost mentioned this pull request Sep 23, 2024
7 tasks

This comment has been minimized.

@ghost
ghost force-pushed the const_intrinsic_copy branch from 2744116 to 2787179 Compare September 23, 2024 20:12
@ghost ghost assigned ghost and unassigned ghost Sep 23, 2024

ghost left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you!

ghost commented Sep 23, 2024

Copy link
Copy Markdown
Member

@bors r+

ghost commented Sep 23, 2024

Copy link
Copy Markdown

📌 Commit 2787179 has been approved by dtolnay

It is now in the queue for this repository.

@ghost ghost 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 Sep 23, 2024
@ghost ghost added the relnotes Marks issues that should be documented in the release notes of the next release. label Sep 24, 2024
@ghost
ghost merged commit 64aa4c6 into rust-lang:master Sep 24, 2024
@ghost ghost added this to the 1.83.0 milestone Sep 24, 2024
@ghost
ghost deleted the const_intrinsic_copy branch September 25, 2024 06:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

relnotes Marks issues that should be documented in the release notes of the next release. 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.

Tracking Issue for const_intrinsic_copy

6 participants