-
Notifications
You must be signed in to change notification settings - Fork 13.3k
vastly expand on the mem::uninitialized docs #27488
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
r? @brson (rust_highfive has picked a reviewer for you, use r? to override) |
c7f41fe
to
e060ef6
Compare
/// allocation: | ||
/// | ||
/// ``` | ||
/// let data = vec![Vec::new(); 1000]; |
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.
this doesn't compile since the element type can't be inferred.
oh, I just noticed travis also found that...
Comments adressed. |
Thanks, I like the explicit code example. We need to hammer in the panic safety issue since it's easy to produce panic unsafe code without ever running into the crashing / UB cases in practice. @bors r+ |
📌 Commit 5e6973d has been approved by |
/// ``` | ||
/// | ||
/// Hopefully this example emphasizes to you exactly how delicate |
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.
The beginning of this sentence sounds a lot like an attempt to appeal to one’s conscience/morality. Dropping the “Hopefully” and “to you” would make this sound much more professional IMO.
This example emphasizes exactly how delicate and dangerous this function is.
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.
Sure.
@nagisa this is already being built in the queue -- either of us can submit an amendment if it doesn't bounce. |
Sure. Sorry I didn’t come around this earlier. |
No worries! Empty queues make things frustrating sometimes. 😓 |
Inspired by #27484