From ecb53d2015ce93b3519ee0b358fc13fa9b3f723d Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 12 Aug 2020 12:10:11 -0700 Subject: [PATCH] Update to `dyn Trait` syntax in a couple places Bare `Trait` is deprecated, so these examples should use `dyn Trait`. --- src/subtyping.md | 2 +- src/type-layout.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/subtyping.md b/src/subtyping.md index 00764425a..26c98790d 100644 --- a/src/subtyping.md +++ b/src/subtyping.md @@ -63,7 +63,7 @@ Variance of types is automatically determined as follows | `fn(T) -> ()` | | contravariant | | `std::cell::UnsafeCell` | | invariant | | `std::marker::PhantomData` | | covariant | -| `Trait + 'a` | covariant | invariant | +| `dyn Trait + 'a` | covariant | invariant | The variance of other `struct`, `enum`, `union`, and tuple types is decided by looking at the variance of the types of their fields. If the parameter is used diff --git a/src/type-layout.md b/src/type-layout.md index 9c3f1fd68..3adbdc95f 100644 --- a/src/type-layout.md +++ b/src/type-layout.md @@ -95,8 +95,8 @@ zero-sized type to have a size of 0 and an alignment of 1. Trait objects have the same layout as the value the trait object is of. -> Note: This is about the raw trait object types, not pointers (`&Trait`, -> `Box`, etc.) to trait objects. +> Note: This is about the raw trait object types, not pointers (`&dyn Trait`, +> `Box`, etc.) to trait objects. ## Closure Layout