From ae5ad9b7ad59721be7ae6fc99b748a46254e9059 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Fri, 11 Jun 2021 03:07:10 +0900 Subject: [PATCH] Add a link for the variance table on the reference --- src/subtyping.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/subtyping.md b/src/subtyping.md index d2504bc..80e329e 100644 --- a/src/subtyping.md +++ b/src/subtyping.md @@ -188,6 +188,10 @@ some sense "fundamental". All the others can be understood by analogy to the oth * `*const T` follows the logic of `&T` * `*mut T` follows the logic of `&mut T` (or `UnsafeCell`) +For more types, see the ["Variance" section][variance-table] on the reference. + +[variance-table]: ../reference/subtyping.html#variance + > NOTE: the *only* source of contravariance in the language is the arguments to > a function, which is why it really doesn't come up much in practice. Invoking > contravariance involves higher-order programming with function pointers that