pull/102/head
Alexis Beingessner 6 years ago
parent 6ec81e17f6
commit a805a667ba

@ -169,16 +169,16 @@ Here is a table of important variances which the rest of this section will be de
to trying to explain:
| | | 'a | T | U |
|---|---------------|:---------:|:-----------------:|:---------:|
| * | &'a T | covariant | covariant | |
| * | &'a mut T | covariant | invariant | |
| * | Box<T> | | covariant | |
| | Vec<T> | | covariant | |
| * | UnsafeCell<T> | | invariant | |
| | Cell<T> | | invariant | |
| * | fn(T) -> U | | **contra**variant | covariant |
| | *const T | | covariant | |
| | *mut T | | invariant | |
|---|-----------------|:---------:|:-----------------:|:---------:|
| * | `&'a T ` | covariant | covariant | |
| * | `&'a mut T` | covariant | invariant | |
| * | `Box<T>` | | covariant | |
| | `Vec<T>` | | covariant | |
| * | `UnsafeCell<T>` | | invariant | |
| | `Cell<T>` | | invariant | |
| * | `fn(T) -> U` | | **contra**variant | covariant |
| | `*const T` | | covariant | |
| | `*mut T` | | invariant | |
The types with \*'s are the ones we will be focusing on, as they are in
some sense "fundamental". All the others can be understood by analogy to the others:

Loading…
Cancel
Save