Skip to content

Tracking Issue for const_intrinsic_copy #80697

@usbalbin

Description

@usbalbin
Contributor

Feature gate: #![feature(const_intrinsic_copy)]

This is a tracking issue for making the functions ptr::copy and ptr::copy_nonoverlapping as well as some related functions const fn.

Public API

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);
}

Steps / History

Activity

added
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFC
T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.
on Jan 4, 2021
added a commit that references this issue on Jan 5, 2021

Auto merge of rust-lang#80699 - usbalbin:const_copy_tracking_issue, r…

added
Libs-TrackedLibs issues that are tracked on the team's project board.
on Jan 6, 2021
usbalbin

usbalbin commented on Mar 4, 2021

@usbalbin
ContributorAuthor

@RalfJung with #81238 merged, is the concern about "bringing back debug assertions" resolved as - we won't bring them back?

RalfJung

RalfJung commented on Mar 5, 2021

@RalfJung
Member

Yeah I guess for now we won't bring them back.

RalfJung

RalfJung commented on Jun 14, 2021

@RalfJung
RalfJung

RalfJung commented on Jun 14, 2021

@RalfJung
joshtriplett

joshtriplett commented on Jan 26, 2022

@joshtriplett
Member

Seems reasonable, assuming that @rust-lang/wg-const-eval is fine with it.

@rfcbot merge
@rfcbot concern confirm-with-wg-const-eval

rfcbot

rfcbot commented on Jan 26, 2022

@rfcbot
Collaborator

Team member @joshtriplett has proposed to merge this. The next step is review by the rest of the tagged team members:

Concerns:

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

added
proposed-final-comment-periodProposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off.
disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.
on Jan 26, 2022

18 remaining items

RalfJung

RalfJung commented on Sep 4, 2024

@RalfJung
Member

@rust-lang/libs-api with #129195 being in FCP, I think we can move towards re-stabilizing these methods. Copying between raw pointers seems like basic functionality once mutable raw pointers are allowed, so would be nice to ship this all in the same release. Also, since these methods used to be stable, let's make them stable again as soon as we can. :)

Given that you have already approved this above, will this require another FCP or can we just go ahead and make a PR once #129195 lands?

dtolnay

dtolnay commented on Sep 4, 2024

@dtolnay
Member

Like you said, this is already approved from our end. Feel free to make a re-stabilization PR after #129195. We can ping the team again on the PR but that should be enough notice.

removed
I-libs-api-nominatedNominated for discussion during a libs-api team meeting.
on Sep 4, 2024
RalfJung

RalfJung commented on Sep 23, 2024

@RalfJung
Member

Stabilization PR is up: #130762

added 2 commits that reference this issue on Sep 24, 2024

Rollup merge of rust-lang#130762 - RalfJung:const_intrinsic_copy, r=d…

548f11a

Rollup merge of rust-lang#130762 - RalfJung:const_intrinsic_copy, r=d…

64aa4c6
added a commit that references this issue on Sep 24, 2024
tgross35

tgross35 commented on Sep 24, 2024

@tgross35
Contributor

For posterity: the constness of some NonNull methods were moved to this gate in #124498, but the tracking issue didn't get updated. They got const stabilized as part of #130762 (with libs-api signoff). Included:

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);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCLibs-TrackedLibs issues that are tracked on the team's project board.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @joshtriplett@RalfJung@m-ou-se@dtolnay@apiraino

      Issue actions

        Tracking Issue for const_intrinsic_copy · Issue #80697 · rust-lang/rust