File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -64,13 +64,13 @@ For instance `Vec` is a type constructor that takes a `T` and returns a
64
64
` Vec<T> ` . ` & ` and ` &mut ` are type constructors that take two inputs: a
65
65
lifetime, and a type to point to.
66
66
67
- A type constructor's * variance* is how the subtyping of its inputs affects the
67
+ A type constructor F 's * variance* is how the subtyping of its inputs affects the
68
68
subtyping of its outputs. There are three kinds of variance in Rust:
69
69
70
70
* F is * covariant* over ` T ` if ` T ` being a subtype of ` U ` implies
71
71
` F<T> ` is a subtype of ` F<U> ` (subtyping "passes through")
72
72
* F is * contravariant* over ` T ` if ` T ` being a subtype of ` U ` implies
73
- ` F<U> ` is a subtype of ` F<U > ` (subtyping is "inverted")
73
+ ` F<U> ` is a subtype of ` F<T > ` (subtyping is "inverted")
74
74
* F is * invariant* over ` T ` otherwise (no subtyping relation can be derived)
75
75
76
76
It should be noted that covariance is * far* more common and important than
You can’t perform that action at this time.
0 commit comments