Skip to content

Commit 518ce53

Browse files
committed
Rollup merge of 21663 - tbu-:pr_doc_cell_static_safety, r=alexcrichton
2 parents 0752c4a + cbcb191 commit 518ce53

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

src/libcore/cell.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -594,12 +594,6 @@ impl<'b, T> DerefMut for RefMut<'b, T> {
594594
/// The `UnsafeCell<T>` type is the only legal way to obtain aliasable data that is considered
595595
/// mutable. In general, transmuting an `&T` type into an `&mut T` is considered undefined behavior.
596596
///
597-
/// Although it is possible to put an `UnsafeCell<T>` into static item, it is not permitted to take
598-
/// the address of the static item if the item is not declared as mutable. This rule exists because
599-
/// immutable static items are stored in read-only memory, and thus any attempt to mutate their
600-
/// interior can cause segfaults. Immutable static items containing `UnsafeCell<T>` instances are
601-
/// still useful as read-only initializers, however, so we do not forbid them altogether.
602-
///
603597
/// Types like `Cell<T>` and `RefCell<T>` use this type to wrap their internal data.
604598
///
605599
/// `UnsafeCell<T>` doesn't opt-out from any marker traits, instead, types with an `UnsafeCell<T>`

0 commit comments

Comments
 (0)