Skip to content
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

Explicitly document the size guarantees that Option makes. #75454

Merged
merged 8 commits into from
Sep 26, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions library/core/src/option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@
//! * `#[repr(transparent)]` struct around one of the types in this list.
//!
//! For the above cases, it is guaranteed that one can [`mem::transmute`]
//! from all valid values of `T` to `Option<T>` but only from non-`None`
//! Option<T>` to `T`.
//! from all valid values of `T` to `Option<T>` but only from
//! `Option::Some(T)` to `T` (i.e. transmuting `None` to `<T>` is undefined
ltratt marked this conversation as resolved.
Show resolved Hide resolved
//! behaviour).
//!
//! # Examples
//!
Expand Down