Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/subtyping.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Variance of types is automatically determined as follows
| `fn(T) -> ()` | | contravariant |
| `std::cell::UnsafeCell<T>` | | invariant |
| `std::marker::PhantomData<T>` | | covariant |
| `Trait<T> + 'a` | covariant | invariant |
| `dyn Trait<T> + '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
Expand Down
4 changes: 2 additions & 2 deletions src/type-layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<Trait>`, etc.) to trait objects.
> Note: This is about the raw trait object types, not pointers (`&dyn Trait`,
> `Box<dyn Trait>`, etc.) to trait objects.

## Closure Layout

Expand Down