diff options
| author | bors <bors@rust-lang.org> | 2015-02-07 09:55:14 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-02-07 09:55:14 +0000 |
| commit | a08504bb35f5cb36b702750ba105063d1e2972ff (patch) | |
| tree | ff494dcd75bfa14e6d4e56821d8fb31d1633eb79 /src/libcore | |
| parent | e62fec36b97882b2e24bddae41ee025a75688bd7 (diff) | |
| parent | 310ada06f2d632340845ccd4d7e68a1b54d2f28a (diff) | |
| download | rust-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.rs | 11 |
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"] |
