Skip to content

Commit cbcb191

Browse files
committed
Remove comment about UnsafeCells and static
It has actually been safe to put an `UnsafeCell` into a non-mutable `static` since the `const` change.
1 parent edc6781 commit cbcb191

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
@@ -592,12 +592,6 @@ impl<'b, T> DerefMut for RefMut<'b, T> {
592592
/// The `UnsafeCell<T>` type is the only legal way to obtain aliasable data that is considered
593593
/// mutable. In general, transmuting an `&T` type into an `&mut T` is considered undefined behavior.
594594
///
595-
/// Although it is possible to put an `UnsafeCell<T>` into static item, it is not permitted to take
596-
/// the address of the static item if the item is not declared as mutable. This rule exists because
597-
/// immutable static items are stored in read-only memory, and thus any attempt to mutate their
598-
/// interior can cause segfaults. Immutable static items containing `UnsafeCell<T>` instances are
599-
/// still useful as read-only initializers, however, so we do not forbid them altogether.
600-
///
601595
/// Types like `Cell<T>` and `RefCell<T>` use this type to wrap their internal data.
602596
///
603597
/// `UnsafeCell<T>` doesn't opt-out from any marker traits, instead, types with an `UnsafeCell<T>`

0 commit comments

Comments
 (0)