-
Couldn't load subscription status.
- Fork 13.9k
Zero-initialize vec![None; n] for Option<&T>, Option<&mut T> and Option<Box<T>>
#64893
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
Conversation
…d `Option<Box<T>>`
|
r? @sfackler (rust_highfive has picked a reviewer for you, use r? to override) |
|
|
||
| // `Option<&T>`, `Option<&mut T>` and `Option<Box<T>>` are guaranteed to represent `None` as null. | ||
| // For fat pointers, the bytes that would be the pointer metadata in the `Some` variant | ||
| // are padding in the `None` variant, so ignoring them and zero-initializing instead is ok. |
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.
CC #64891
|
r? @RalfJung |
|
r? @sfackler |
|
@bors r+ |
|
📌 Commit 6c01c0e has been approved by |
…ckler Zero-initialize `vec![None; n]` for `Option<&T>`, `Option<&mut T>` and `Option<Box<T>>`
…ckler Zero-initialize `vec![None; n]` for `Option<&T>`, `Option<&mut T>` and `Option<Box<T>>`
Rollup of 9 pull requests Successful merges: - #64377 (Add long error explanation for E0493) - #64786 (Use https for curl when building for linux) - #64828 (Graphviz debug output for generic dataflow analysis) - #64838 (Add long error explanation for E0550) - #64891 (Fix `vec![x; n]` with null raw fat pointer zeroing the pointer metadata) - #64893 (Zero-initialize `vec![None; n]` for `Option<&T>`, `Option<&mut T>` and `Option<Box<T>>`) - #64911 (Fixed a misleading documentation issue #64844) - #64921 (Add test for issue-64662) - #64923 (Add missing links for mem::needs_drop) Failed merges: - #64918 (Add long error explanation for E0551) r? @ghost
No description provided.