-
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
MaybeUninit: add read_initialized, add examples #58660
Conversation
r? @aidanhs (rust_highfive has picked a reviewer for you, use r? to override) |
Also remove a no-longer accurate comments
b136922
to
48bba2c
Compare
48bba2c
to
aa4a9b0
Compare
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
I've been thinking maybe it should be called OTOH, |
Co-Authored-By: RalfJung <[email protected]>
I think I'm really happy about the |
I always thought of these as To me, |
Yeah, my current inclination is to instead rename |
Well, let's do the bikeshedding later and add this as |
r? @Centril |
// FIXME before stabilizing, explain how to initialize a struct field-by-field. | ||
#[allow(missing_debug_implementations)] | ||
#[unstable(feature = "maybe_uninit", issue = "53491")] | ||
// NOTE after stabilizing `MaybeUninit` proceed to deprecate `mem::{uninitialized,zeroed}` | ||
#[derive(Copy)] |
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.
Can you remind me... what was the reason we didn't do this before?
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 don't think there was one.
Co-Authored-By: RalfJung <[email protected]>
r=me with green CI :) |
@bors r=Centril |
📌 Commit cefe9b0 has been approved by |
🌲 The tree is currently closed for pull requests below priority 50, this pull request will be tested once the tree is reopened |
MaybeUninit: add read_initialized, add examples This adds a new `read_initialized` method, similar to suggestions by @Amanieu and @shepmaster. I also added examples to this and other methods.
MaybeUninit: add read_initialized, add examples This adds a new `read_initialized` method, similar to suggestions by @Amanieu and @shepmaster. I also added examples to this and other methods.
MaybeUninit: add read_initialized, add examples This adds a new `read_initialized` method, similar to suggestions by @Amanieu and @shepmaster. I also added examples to this and other methods.
Rollup of 13 pull requests Successful merges: - #58518 (Use early unwraps instead of bubbling up errors just to unwrap in the end) - #58626 (rustdoc: add option to calculate "documentation coverage") - #58629 (rust-lldb: fix crash when printing empty string) - #58660 (MaybeUninit: add read_initialized, add examples) - #58670 (fixes #52482) - #58676 (look for python2 symlinks before bootstrap python) - #58679 (Refactor passes and pass execution to be more parallel) - #58750 (Make `Unique::as_ptr`, `NonNull::dangling` and `NonNull::cast` const) - #58762 (Mention `unwind(aborts)` in diagnostics for `#[unwind]`) - #58924 (Add as_slice() to slice::IterMut and vec::Drain) - #58990 (Actually publish miri in the manifest) - #59018 (std: Delete a by-definition spuriously failing test) - #59045 (Expose new_sub_parser_from_file) Failed merges: r? @ghost
This adds a new
read_initialized
method, similar to suggestions by @Amanieu and @shepmaster. I also added examples to this and other methods.