From d37282bfff2aa2147c5e1b00c98cb31cad360e08 Mon Sep 17 00:00:00 2001 From: Youngsuk Kim Date: Thu, 6 Feb 2020 20:08:44 -0500 Subject: [PATCH 1/2] (minor) Add backticks around type names Added backticks around type names for consistency of document. --- src/subtyping.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/subtyping.md b/src/subtyping.md index 9c362a2..d253daf 100644 --- a/src/subtyping.md +++ b/src/subtyping.md @@ -183,8 +183,8 @@ to trying to explain: 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: -* Vec and all other owning pointers and collections follow the same logic as Box -* Cell and all other interior mutability types follow the same logic as UnsafeCell +* `Vec` and all other owning pointers and collections follow the same logic as `Box` +* `Cell` and all other interior mutability types follow the same logic as `UnsafeCell` * `*const` follows the logic of `&T` * `*mut` follows the logic of `&mut T` (or `UnsafeCell`) From e3812150ddc825f9b744adafe8e41897ff86c0d8 Mon Sep 17 00:00:00 2001 From: Youngsuk Kim Date: Mon, 17 Feb 2020 11:12:30 -0500 Subject: [PATCH 2/2] follow-up to review from Centril --- src/subtyping.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/subtyping.md b/src/subtyping.md index d253daf..79b6408 100644 --- a/src/subtyping.md +++ b/src/subtyping.md @@ -183,10 +183,10 @@ to trying to explain: 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: -* `Vec` and all other owning pointers and collections follow the same logic as `Box` -* `Cell` and all other interior mutability types follow the same logic as `UnsafeCell` -* `*const` follows the logic of `&T` -* `*mut` follows the logic of `&mut T` (or `UnsafeCell`) +* `Vec` and all other owning pointers and collections follow the same logic as `Box` +* `Cell` and all other interior mutability types follow the same logic as `UnsafeCell` +* `*const T` follows the logic of `&T` +* `*mut T` follows the logic of `&mut T` (or `UnsafeCell`) > 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