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_ptr_write #86302

Open
5 of 8 tasks
usbalbin opened this issue Jun 14, 2021 · 5 comments
Open
5 of 8 tasks

Tracking Issue for const_ptr_write #86302

usbalbin opened this issue Jun 14, 2021 · 5 comments
Labels
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.

Comments

@usbalbin
Copy link
Contributor

usbalbin commented Jun 14, 2021

Feature gate: #![feature(const_ptr_write)]

This is a tracking issue for making the functions ptr::write and ptr::write_unaligned, and the same methods on *mut T, const fn.

Public API

mod ptr {
    pub const unsafe fn write_unaligned<T>(dst: *mut T, src: T);
    pub const unsafe fn write_unaligned<T>(dst: *mut T, src: T);
    pub const unsafe fn write_bytes<T>(dst: *mut T, val: u8, count: usize);
}

impl<T> *mut T {
    pub const unsafe fn write(self, val: T);
    pub const unsafe fn write_unaligned(self, val: T);
    pub const unsafe fn write_bytes(self, val: u8, count: usize);
}

Steps / History

Related

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 Jun 14, 2021
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Nov 23, 2021
Make `intrinsics::write_bytes` const

This is required to constify `MaybeUninit::zeroed` and `(*mut T)::write_bytes`.

Tracking issue: rust-lang#86302
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Dec 11, 2021
Make `intrinsics::write_bytes` const

This is required to constify `MaybeUninit::zeroed` and `(*mut T)::write_bytes`.

Tracking issue: rust-lang#86302
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Dec 11, 2021
Make `intrinsics::write_bytes` const

This is required to constify `MaybeUninit::zeroed` and `(*mut T)::write_bytes`.

Tracking issue: rust-lang#86302
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Dec 12, 2021
…i-obk

Make `(*mut T)::write_bytes` `const`

Tracking issue: rust-lang#86302
@lilasta
Copy link
Contributor

lilasta commented Dec 13, 2021

core::intrinsics::write_bytes and (*mut T)::write_bytes have been constified: #90081 #91824

@SUPERCILEX
Copy link
Contributor

How does one initiate the FCP? Or are there any blockers?

@c410-f3r
Copy link
Contributor

AFAICT, there are no blockers so this feature can probably be stabilized.

@RalfJung
Copy link
Member

RalfJung commented Nov 10, 2023

How does stabilizing this help? You can't create mutable pointers in const on stable anyway...

@RalfJung
Copy link
Member

IOW, this is blocked on #57349 getting stabilized first.

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. 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