-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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_maybe_uninit_assume_init #86722
Comments
@RalfJung @oli-obk there should be no issues stabilizing this, correct? I'm going through some things that can be stabilized as I was planning to stabilize |
we haven't stabilized transmute yet, all that is blocked on me finishing rust-lang/nomicon#221, then we can start the stabilization wave for unsafe const stuff |
Was that not #85769? |
🤦 I am completely lost at the moment on what is stabilized and what is not... I really need to update the skill tree... Yea, those are trivial to replicate in bad ways on stable then... so we should stabilize them |
It looks like a number of methods rely on dereferencing a raw pointer or reading one, all of which we don't want at compile-time for the time being due to some uncertainty, correct? If this is permissible, just say so and I can include them. The one method that can clearly be stabilized without issue is |
We should stabilize raw pointer deref, otherwise ppl will start transmuting raw pointers to references and dereferencing those |
Just sent Ralf a PM on Zulip asking him to check this out. I recall him having an objection to something of the sort when stabilizing const transmutes — I believe we initially wanted a lint. |
Yeah there was the idea of having a lint against ptr-to-int transmutes. My only concern with raw pointers is how and where to document that type-punning loads (i.e., raw-ptr-based transmutes) of pointers to integers are considered UB during CTFE. |
So raw pointer deref could be stabilized, correct? Dereferencing raw pointers is |
Where would you put that documentation though? And would anyone actually read it?^^ But, yeah, just from an implementation perspective I can't think of any reason how raw ptr deref could screw us now that we have stabilized transmutes and union field accesses. |
I removed bit of my comment that because I realized it was orthogonal to this issue. Sounds good though 👍 |
Is there anything blocking stabilization of |
It's in FCP right now! |
Oh, didn't realize the FCP is going on in #90896. |
We have the option of const-stabilizing |
@rfcbot fcp merge
This FCP proposes const-stabilizing Further, it proposes moving the const-stability of |
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. |
🔔 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. |
@workingjubilee is there a reason this is not part of your big const stabilization PR? |
@RalfJung No reason, I think! Slipped through the cracks because I am merely mortal. |
Oh, I think I missed this because I looked for features, when stabilizing things, with actual issue numbers in the code... this thing had never gotten its correct issue number assigned in the code. |
Oh lol this had Thanks for making a PR! |
…hat-got-away, r=scottmcm library: Const-stabilize `MaybeUninit::assume_init_mut` FCP completed in rust-lang#86722 (comment) Also moves const-ness of an unstable fn under the `maybe_uninit_slice` gate, Cc rust-lang#63569
…hat-got-away, r=scottmcm library: Const-stabilize `MaybeUninit::assume_init_mut` FCP completed in rust-lang#86722 (comment) Also moves const-ness of an unstable fn under the `maybe_uninit_slice` gate, Cc rust-lang#63569
Rollup merge of rust-lang#131274 - workingjubilee:stabilize-the-one-that-got-away, r=scottmcm library: Const-stabilize `MaybeUninit::assume_init_mut` FCP completed in rust-lang#86722 (comment) Also moves const-ness of an unstable fn under the `maybe_uninit_slice` gate, Cc rust-lang#63569
…way, r=scottmcm library: Const-stabilize `MaybeUninit::assume_init_mut` FCP completed in rust-lang/rust#86722 (comment) Also moves const-ness of an unstable fn under the `maybe_uninit_slice` gate, Cc rust-lang/rust#63569
…nit_write, r=RalfJung,dtolnay Stabilize `const_maybe_uninit_write` Mark the following API const stable: ```rust impl<T> MaybeUninit<T> { pub const fn write(&mut self, val: T) -> &mut T; } ``` This depends on `const_mut_refs` and [`const_maybe_uninit_assume_init`](rust-lang#86722), both of which have recently been stabilized. Closes: <rust-lang#63567>
Rollup merge of rust-lang#131713 - tgross35:stabilize-const_maybe_uninit_write, r=RalfJung,dtolnay Stabilize `const_maybe_uninit_write` Mark the following API const stable: ```rust impl<T> MaybeUninit<T> { pub const fn write(&mut self, val: T) -> &mut T; } ``` This depends on `const_mut_refs` and [`const_maybe_uninit_assume_init`](rust-lang#86722), both of which have recently been stabilized. Closes: <rust-lang#63567>
Feature gate:
#![feature(const_maybe_uninit_assume_init)]
This is a tracking issue for turning the methods
assume_init
,assume_init_ref
,assume_init_mut
,slice_assume_init_ref
,slice_assume_init_mut
ofMaybeUninit
intoconst fn
s. Note that the implementation of the latter two slice related methods are currently behindmaybe_uninit_slice
#63569, while the constness is behindconst_maybe_uninit_assume_init
.Public API
Steps / History
MaybeUninit
behavior as const #90896 (assume_init
andassume_init_ref
)Unresolved Questions
The text was updated successfully, but these errors were encountered: