-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Comments
Make `intrinsics::write_bytes` const This is required to constify `MaybeUninit::zeroed` and `(*mut T)::write_bytes`. Tracking issue: rust-lang#86302
Make `intrinsics::write_bytes` const This is required to constify `MaybeUninit::zeroed` and `(*mut T)::write_bytes`. Tracking issue: rust-lang#86302
Make `intrinsics::write_bytes` const This is required to constify `MaybeUninit::zeroed` and `(*mut T)::write_bytes`. Tracking issue: rust-lang#86302
…i-obk Make `(*mut T)::write_bytes` `const` Tracking issue: rust-lang#86302
How does one initiate the FCP? Or are there any blockers? |
AFAICT, there are no blockers so this feature can probably be stabilized. |
How does stabilizing this help? You can't create mutable pointers in const on stable anyway... |
IOW, this is blocked on #57349 getting stabilized first. |
It seems you can with |
@rust-lang/libs-api with #129195 in FCP, I'd like to get the ball rolling for stabilizing this feature as well, so that it can be released together with const_mut_refs. After all, what good is a mutable raw pointer if you cannot So, can we get a t-libs-api FCP started for this? :) |
@rfcbot fcp merge
|
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. |
@Amanieu @BurntSushi @joshtriplett @m-ou-se this proposes to stabilize some very basic |
FYI, turns out there are three more functions under this feature gate -- impl <T> NonNull<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);
} |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. This will be merged soon. |
…-fn, r=RalfJung Stabilize const `ptr::write*` and `mem::replace` Since `const_mut_refs` and `const_refs_to_cell` have been stabilized, we may now also stabilize the ability to write to places during const evaluation inside our library API. So, we now propose the `const fn` version of `ptr::write` and its variants. This allows us to also stabilize `mem::replace` and `ptr::replace`. - const `mem::replace`: rust-lang#83164 (comment) - const `ptr::write{,_bytes,_unaligned}`: rust-lang#86302 (comment) Their implementation requires an additional internal stabilization of `const_intrinsic_forget`, which is required for `*::write*` and thus `*::replace`. Thus we const-stabilize the internal intrinsics `forget`, `write_bytes`, and `write_via_move`.
Rollup merge of rust-lang#130954 - workingjubilee:stabilize-const-mut-fn, r=RalfJung Stabilize const `ptr::write*` and `mem::replace` Since `const_mut_refs` and `const_refs_to_cell` have been stabilized, we may now also stabilize the ability to write to places during const evaluation inside our library API. So, we now propose the `const fn` version of `ptr::write` and its variants. This allows us to also stabilize `mem::replace` and `ptr::replace`. - const `mem::replace`: rust-lang#83164 (comment) - const `ptr::write{,_bytes,_unaligned}`: rust-lang#86302 (comment) Their implementation requires an additional internal stabilization of `const_intrinsic_forget`, which is required for `*::write*` and thus `*::replace`. Thus we const-stabilize the internal intrinsics `forget`, `write_bytes`, and `write_via_move`.
Feature gate:
#![feature(const_ptr_write)]
This is a tracking issue for making the functions
ptr::write
andptr::write_unaligned
, and the same methods on*mut T
,const fn
.Public API
Steps / History
core::intrinsics::write_bytes
akaptr::write_bytes
- Makeintrinsics::write_bytes
const #90081(*mut T)::write_bytes
- Make(*mut T)::write_bytes
const
#91824&mut T
in const contexts (const_mut_refs) #57349NonNull
methods stabilized,const
ness moved to this gate Stabilizenon_null_convenience
#124498Related
Unresolved Questions
The text was updated successfully, but these errors were encountered: