about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-02-07 09:55:14 +0000
committerbors <bors@rust-lang.org>2015-02-07 09:55:14 +0000
commita08504bb35f5cb36b702750ba105063d1e2972ff (patch)
treeff494dcd75bfa14e6d4e56821d8fb31d1633eb79 /src/libcore
parente62fec36b97882b2e24bddae41ee025a75688bd7 (diff)
parent310ada06f2d632340845ccd4d7e68a1b54d2f28a (diff)
downloadrust-a08504bb35f5cb36b702750ba105063d1e2972ff.tar.gz
rust-a08504bb35f5cb36b702750ba105063d1e2972ff.zip
Auto merge of #21995 - leejunseok:fix_invariant_ex, r=steveklabnik
Should fix #20147

This is my second PR in the history of ever (I botched my first one #21828). Any tips would be appreciated!
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/marker.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/libcore/marker.rs b/src/libcore/marker.rs
index 2d14b31748e..bf9e6bccc71 100644
--- a/src/libcore/marker.rs
+++ b/src/libcore/marker.rs
@@ -311,16 +311,17 @@ impl<T: ?Sized> Clone for ContravariantType<T> {
 ///
 /// # Example
 ///
-/// The Cell type is an example which uses unsafe code to achieve
-/// "interior" mutability:
+/// The Cell type is an example of an `InvariantType` which uses unsafe
+/// code to achieve "interior" mutability:
 ///
 /// ```
 /// struct Cell<T> { value: T }
 /// ```
 ///
-/// The type system would infer that `value` is only read here and
-/// never written, but in fact `Cell` uses unsafe code to achieve
-/// interior mutability.
+/// The type system would infer that `value` is only read here
+/// and never written, but in fact `Cell` uses unsafe code to achieve
+/// interior mutability. In order to get correct behavior, the
+/// `InvariantType` marker must be applied.
 #[unstable(feature = "core",
            reason = "likely to change with new variance strategy")]
 #[lang="invariant_type"]