Skip to content

Commit 721a948

Browse files
Update text/0000-dyn-upcasting.md
Co-authored-by: teor <teor@riseup.net>
1 parent 6ea5706 commit 721a948

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

text/0000-dyn-upcasting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Note that you cannot, currently, upcast to *multiple* supertraits. That is, an `
9090

9191
The `Unsize` trait is the (unstable) way that Rust controls coercions into unsized values. We currently permit `dyn Trait1: Unsize<dyn Trait2>` precisely for the case where there is the same "principal trait" (i.e., non-auto-trait) and the set of auto-traits differ. This RFC extends that coercion to permit `dyn Trait1` to be unsized to `dyn Trait2` if `Trait2` is a (transitive) supertrait of `Trait1`.
9292

93-
The *supertraits* of a trait `X` are defined as any trait `Y` such taht `X` has a where-clause `where Self: Y` (note that `trait X: Y` is short for `trait X where Self: Y`). This definition already exists in the compiler, and we already prohibit the supertrait relationship from being cyclic.
93+
The *supertraits* of a trait `X` are defined as any trait `Y` such that `X` has a where-clause `where Self: Y` (note that `trait X: Y` is short for `trait X where Self: Y`). This definition already exists in the compiler, and we already prohibit the supertrait relationship from being cyclic.
9494

9595
Note that this is a *coercion* and not a *subtyping* rule. That is observable because it means, for example, that `Vec<Box<dyn Trait>>` cannot be upcast to `Vec<Box<dyn Supertrait>>`. Coercion is required because vtable cocercion, in general, requires changes to the vtable, as described in the vtable layout section that comes next.
9696

0 commit comments

Comments
 (0)