From a805a667ba8534b78b9587ba7644dac53ce0ab98 Mon Sep 17 00:00:00 2001 From: Alexis Beingessner Date: Fri, 9 Nov 2018 14:15:50 -0500 Subject: [PATCH] fixup --- src/subtyping.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/subtyping.md b/src/subtyping.md index f0caf71..0e33658 100644 --- a/src/subtyping.md +++ b/src/subtyping.md @@ -168,17 +168,17 @@ in Rust, though it does in fact exist. Here is a table of important variances which the rest of this section will be devoted to trying to explain: -| | | 'a | T | U | -|---|---------------|:---------:|:-----------------:|:---------:| -| * | &'a T | covariant | covariant | | -| * | &'a mut T | covariant | invariant | | -| * | Box | | covariant | | -| | Vec | | covariant | | -| * | UnsafeCell | | invariant | | -| | Cell | | invariant | | -| * | fn(T) -> U | | **contra**variant | covariant | -| | *const T | | covariant | | -| | *mut T | | invariant | | +| | | 'a | T | U | +|---|-----------------|:---------:|:-----------------:|:---------:| +| * | `&'a T ` | covariant | covariant | | +| * | `&'a mut T` | covariant | invariant | | +| * | `Box` | | covariant | | +| | `Vec` | | covariant | | +| * | `UnsafeCell` | | invariant | | +| | `Cell` | | 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: