-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Improve libcore/cell.rs docs #21564
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
Improve libcore/cell.rs docs #21564
Conversation
r? @pcwalton (rust_highfive has picked a reviewer for you, use r? to override) |
16eeca3
to
edc6781
Compare
//! Values of the `Cell<T>` and `RefCell<T>` types may be mutated through shared references (i.e. | ||
//! the common `&T` type), whereas most Rust types can only be mutated through unique (`&mut T`) | ||
//! references. We say that `Cell<T>` and `RefCell<T>` provide 'interior mutability', in contrast | ||
//! with typical Rust types that exhibit 'inherited mutability'. |
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.
Can this hold off on reformatting docs? It's tough to see what's changed here and otherwise this is just churning docs.
@bors rollup |
/// can cause segfaults. Immutable static items containing `UnsafeCell<T>` | ||
/// instances are still useful as read-only initializers, however, so we do not | ||
/// forbid them altogether. | ||
/// Although it is possible to put an `UnsafeCell<T>` into static item, it is not permitted to take |
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.
@steveklabnik Is this still true as of today, after introducing const
? I think the static
semantics have changed.
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.
unsure
No description provided.