-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Split MaybeUninit::write into new feature gate and stabilize it #86344
Conversation
r? @scottmcm (rust-highfive has picked a reviewer for you, use r? to override) |
Original proposal to stabilize the feature: #63567 (comment) After that there have been suggestions to split off the write function to stabilize it in isolation. The const-ness of the function is not stabilized for now because |
This seems reasonable to me, but it'll need an FCP, so sending to a random libs member: r? @dtolnay |
No objections from my side, if T-libs agrees that this is useful. impl<T> MaybeUninit<T> {
pub fn write(&mut self, val: T) -> &mut T
} What makes this somewhat non-standard is the fact that |
Maybe it could be called |
Indeed there is no analog function called As for |
@rustbot label S-waiting-on-team |
Should "the destructor is not ran for the inner data" say run instead of ran at the top of the docs for write? |
@skippy10110 it seems you are right. "the destructor is not ran for the inner data" seems to be a present perfect passive construction, which means it needs to use the past participle form of run which is run. https://www.wallstreetenglish.com/blog/the-present-perfect-tense-and-the-passive-voice/ https://dictionary.cambridge.org/dictionary/english/run Good catch! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love the example! Thank you for digging that up. I suggested a few edits to make it a smidge clearer IMO. :-)
present perfect passive constructions need to use the past participle form, which for run is "run".
9640cb3
to
8e328be
Compare
FCP passed, so I think this is ready to land. :) However, I think there are some more examples that could use the new method. In the docs for |
r? @dtolnay |
Based on the example review by @BurntSushi |
📌 Commit 848a621 has been approved by |
Rollup of 11 pull requests Successful merges: - rust-lang#86344 (Split MaybeUninit::write into new feature gate and stabilize it) - rust-lang#86811 (Remove unstable `io::Cursor::remaining`) - rust-lang#86846 (stdio_locked: add tracking issue) - rust-lang#86887 (rustdoc: remove dead code in `clean`) - rust-lang#87007 (Fix rust-analyzer install when not available.) - rust-lang#87035 (Fix implementors display) - rust-lang#87065 (Fix ICE with unsized type in const pattern) - rust-lang#87070 (Simplify future incompatible reporting.) - rust-lang#87077 (:arrow_up: rust-analyzer) - rust-lang#87078 (Rustdoc: suggest removing disambiguator if linking to field) - rust-lang#87089 (CTFE engine: small cleanups) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
… r=LeSeulArtichaut DOC: remove unnecessary feature crate attribute from example code I'm not sure whether I fully understand the stabilization process (I most likely don't), but I think this attribute isn't necessary here, right? This was recently stabilized in rust-lang#86344.
… r=LeSeulArtichaut DOC: remove unnecessary feature crate attribute from example code I'm not sure whether I fully understand the stabilization process (I most likely don't), but I think this attribute isn't necessary here, right? This was recently stabilized in rust-lang#86344.
… r=LeSeulArtichaut DOC: remove unnecessary feature crate attribute from example code I'm not sure whether I fully understand the stabilization process (I most likely don't), but I think this attribute isn't necessary here, right? This was recently stabilized in rust-lang#86344.
This splits off the
MaybeUninit::write
function from themaybe_uninit_extra
feature gate into a newmaybe_uninit_write
feature gate and stabilizes it.Earlier work to improve the documentation of the write function: #86220
Tracking issue: #63567