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

Tracking Issue for const_replace #83164

Open
1 of 3 tasks
Tracked by #16
usbalbin opened this issue Mar 15, 2021 · 6 comments
Open
1 of 3 tasks
Tracked by #16

Tracking Issue for const_replace #83164

usbalbin opened this issue Mar 15, 2021 · 6 comments
Labels
C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@usbalbin
Copy link
Contributor

usbalbin commented Mar 15, 2021

Feature gate: #![feature(const_replace)]

This is a tracking issue for making the functions mem::replace and ptr::replace const fn.

Public API

mod mem {
    pub const fn replace<T>(dest: &mut T, src: T) -> T;
}

mod ptr {
    pub const unsafe fn replace<T>(dst: *mut T, mut src: T) -> T;
}

Steps / History

Unresolved Questions

  • None yet.
@usbalbin usbalbin added C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Mar 15, 2021
@RalfJung

This comment was marked as resolved.

@Zizico2
Copy link

Zizico2 commented Jan 1, 2023

status on this? is any help needed?

@RalfJung
Copy link
Member

RalfJung commented Sep 9, 2024

@rust-lang/libs-api I think this is ready to be stabilized, given that const_mut_refs is in FCP. :)

This is about const-stabilizing two already-stable functions:

mod mem {
    pub const fn replace<T>(dest: &mut T, src: T) -> T;
}

mod ptr {
    pub const unsafe fn replace<T>(dst: *mut T, mut src: T) -> T;
}

@RalfJung RalfJung added the I-libs-api-nominated Nominated for discussion during a libs-api team meeting. label Sep 9, 2024
@dtolnay
Copy link
Member

dtolnay commented Sep 9, 2024

@rfcbot fcp merge

@rfcbot
Copy link

rfcbot commented Sep 9, 2024

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

No concerns currently listed.

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.

@rfcbot rfcbot added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. labels Sep 9, 2024
@dtolnay dtolnay removed the I-libs-api-nominated Nominated for discussion during a libs-api team meeting. label Sep 9, 2024
@RalfJung
Copy link
Member

RalfJung commented Sep 21, 2024

@Amanieu @BurntSushi @joshtriplett @m-ou-se would be nice to get this (and some of the other &mut/*mut APIs) into the next release train so that const_mut_refs is not quite so bare-bones when it lands. :D Also, this particular feature blocks replace/take on Option so there's a bit of a dependency chain here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants