Conversation
Sometimes it *is* initialized!
Contributor
|
r? @bluss (rust_highfive has picked a reviewer for you, use r? to override) |
dtolnay
approved these changes
Oct 21, 2018
dtolnay
approved these changes
Oct 21, 2018
dtolnay
approved these changes
Oct 21, 2018
scottmcm
reviewed
Oct 22, 2018
| /// It is your responsibility to make sure `T` gets dropped if it got initialized. | ||
| #[unstable(feature = "maybe_uninit", issue = "53491")] | ||
| pub const fn new(val: T) -> MaybeUninit<T> { | ||
| MaybeUninit { value: ManuallyDrop::new(val) } |
Member
There was a problem hiding this comment.
Should this be spelled From::from? (Additionally/instead/never, I don't know.)
Edit: Sorry for spam during the GitHub outage.
Contributor
There was a problem hiding this comment.
If we do this as From now, then it cannot be const fn for the time being (but hopefully in the future...).
Centril
reviewed
Oct 22, 2018
Contributor
|
Memo from T-lang to T-libs: Since the stabilization of See:
|
Contributor
|
@bors r+ rollup |
Collaborator
|
📌 Commit ac18635 has been approved by |
Mark-Simulacrum
added a commit
to Mark-Simulacrum/rust
that referenced
this pull request
Oct 27, 2018
Add MaybeUninit::new Sometimes it *is* initialized!
kennytm
added a commit
to kennytm/rust
that referenced
this pull request
Oct 28, 2018
Add MaybeUninit::new Sometimes it *is* initialized!
bors
added a commit
that referenced
this pull request
Oct 28, 2018
Rollup of 11 pull requests Successful merges: - #55148 (Implement FromStr for PathBuf) - #55185 (path suggestions in Rust 2018 should point out the change in semantics) - #55191 (Fix sub-variant doc display) - #55199 (Impl items have generics) - #55244 (Don't rerun MIR passes when inlining) - #55252 (Add MaybeUninit::new) - #55257 (Allow extern statics with an extern type) - #55389 (Remove unnecessary mut in iterator.find_map documentation example, R…) - #55406 (Update string.rs) - #55412 (Fix an ICE in the min_const_fn analysis) - #55421 (Add ManuallyDrop::take)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sometimes it is initialized!