-
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
Add missing examples for MaybeUninit #77228
Conversation
0a0cb38
to
3cfd498
Compare
ping @Dylan-DPC |
r? @pickfire |
library/core/src/mem/maybe_uninit.rs
Outdated
/// ``` | ||
/// use std::mem::MaybeUninit; | ||
/// | ||
/// let v = MaybeUninit::new(vec![42]); |
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.
/// let v = MaybeUninit::new(vec![42]); | |
/// let v: MaybeUninit<Vec<u8>> = MaybeUninit::new(vec![42]); |
Add a type for clarification.
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.
Other than the mentioned change looks good to me.
/// | ||
/// let v = MaybeUninit::new(vec![42]); | ||
/// ``` | ||
/// | ||
/// [`assume_init`]: MaybeUninit::assume_init |
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 feel like removing these links.
library/core/src/mem/maybe_uninit.rs
Outdated
/// | ||
/// let v: MaybeUninit<String> = MaybeUninit::uninit(); | ||
/// ``` | ||
/// | ||
/// [type]: union.MaybeUninit.html |
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.
/// [type]: union.MaybeUninit.html | |
/// [type]: MaybeUninit |
I think this should work?
3cfd498
to
b1ce619
Compare
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.
Looks good to me.
Let's merge then, thanks for the review! @bors: r=pickfire rollup |
📌 Commit b1ce619 has been approved by |
Rollup of 13 pull requests Successful merges: - rust-lang#76388 (Add a note about the panic behavior of math operations on time objects) - rust-lang#76855 (Revamp rustdoc docs about documentation using `cfg`) - rust-lang#76995 (Reduce boilerplate with the matches! macro) - rust-lang#77228 (Add missing examples for MaybeUninit) - rust-lang#77528 (Avoid unchecked casts in net parser) - rust-lang#77534 (Disallow overriding forbid in same scope) - rust-lang#77555 (Allow anyone to set regression labels) - rust-lang#77558 (Rename bootstrap/defaults/{config.toml.PROFILE => config.PROFILE.toml}) - rust-lang#77559 (Fix rustdoc warnings about invalid Rust syntax) - rust-lang#77560 (Fix LitKind's byte buffer to use refcounted slice) - rust-lang#77573 (Hint doc use convert::identity relative link) - rust-lang#77587 (Fix span for unicode escape suggestion.) - rust-lang#77591 (Record `expansion_that_defined` into crate metadata) Failed merges: r? `@ghost`
r? @Dylan-DPC