about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTobias Bucher <tobiasbucher5991@gmail.com>2015-01-26 17:45:21 +0100
committerTobias Bucher <tobiasbucher5991@gmail.com>2015-01-26 17:45:21 +0100
commitcbcb191b970360e3b32a8be7d86d5c6ec2b8e7c9 (patch)
tree96dfa9e7555c6161c760e69327a25c6fbd7c3aa6
parentedc67817a312d2c7924ae333facb9294ff751008 (diff)
downloadrust-cbcb191b970360e3b32a8be7d86d5c6ec2b8e7c9.tar.gz
rust-cbcb191b970360e3b32a8be7d86d5c6ec2b8e7c9.zip
Remove comment about `UnsafeCell`s and `static`
It has actually been safe to put an `UnsafeCell` into a non-mutable `static`
since the `const` change.
-rw-r--r--src/libcore/cell.rs6
1 files changed, 0 insertions, 6 deletions
diff --git a/src/libcore/cell.rs b/src/libcore/cell.rs
index 202d860021e..62029a4ea01 100644
--- a/src/libcore/cell.rs
+++ b/src/libcore/cell.rs
@@ -592,12 +592,6 @@ impl<'b, T> DerefMut for RefMut<'b, T> {
 /// The `UnsafeCell<T>` type is the only legal way to obtain aliasable data that is considered
 /// mutable. In general, transmuting an `&T` type into an `&mut T` is considered undefined behavior.
 ///
-/// Although it is possible to put an `UnsafeCell<T>` into static item, it is not permitted to take
-/// the address of the static item if the item is not declared as mutable. This rule exists because
-/// immutable static items are stored in read-only memory, and thus any attempt to mutate their
-/// interior 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.
-///
 /// Types like `Cell<T>` and `RefCell<T>` use this type to wrap their internal data.
 ///
 /// `UnsafeCell<T>` doesn't opt-out from any marker traits, instead, types with an `UnsafeCell<T>`