diff --git a/src/arc-mutex/arc-layout.md b/src/arc-mutex/arc-layout.md index 3dae2cd..fabfdca 100644 --- a/src/arc-mutex/arc-layout.md +++ b/src/arc-mutex/arc-layout.md @@ -47,7 +47,7 @@ all the details on variance and drop check. To fix the first problem, we can use `NonNull`. Note that `NonNull` is a wrapper around a raw pointer that declares that: -* We are variant over `T` +* We are covariant over `T` * Our pointer is never null To fix the second problem, we can include a `PhantomData` marker containing an diff --git a/src/phantom-data.md b/src/phantom-data.md index 68ddb8f..a5e88bb 100644 --- a/src/phantom-data.md +++ b/src/phantom-data.md @@ -39,7 +39,7 @@ struct Iter<'a, T: 'a> { } ``` -and that's it. The lifetime will be bounded, and your iterator will be variant +and that's it. The lifetime will be bounded, and your iterator will be covariant over `'a` and `T`. Everything Just Works. Another important example is Vec, which is (approximately) defined as follows: diff --git a/src/subtyping.md b/src/subtyping.md index 1d892e6..c944c1e 100644 --- a/src/subtyping.md +++ b/src/subtyping.md @@ -443,7 +443,7 @@ struct MyType<'a, 'b, A: 'a, B: 'b, C, D, E, F, G, H, In, Out, Mixed> { f: Vec, // covariant over F g: Cell, // invariant over G - h1: H, // would also be variant over H except... + h1: H, // would also be covariant over H except... h2: Cell, // invariant over H, because invariance wins all conflicts i: fn(In) -> Out, // contravariant over In, covariant over Out