Skip to content

Commit f021dfe

Browse files
committed
Apply review comments to trait upcasting description
1 parent d07f7f0 commit f021dfe

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/type-coercions.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,9 @@ relate to converting types to unsized types, and are permitted in a few
163163
cases where other coercions are not, as described above. They can still happen
164164
anywhere else a coercion can occur.
165165

166+
> Note: "unsizing" is a bit of a misnomer,
167+
> since this covers unsized->unsized coercions too.
168+
166169
Two traits, [`Unsize`] and [`CoerceUnsized`], are used
167170
to assist in this process and expose it for library use. The following
168171
coercions are built-ins and, if `T` can be coerced to `U` with one of them, then
@@ -172,7 +175,8 @@ an implementation of `Unsize<U>` for `T` will be provided:
172175

173176
* `T` to `dyn U`, when `T` implements `U + Sized`, and `U` is [object safe].
174177

175-
* `dyn T` to `dyn U`, when `U` is one of `T`'s supertraits.
178+
* `dyn T` to `dyn U` when `U` is one of `T`'s [supertraits].
179+
* This allows dropping auto traits, i.e. `dyn T + Auto` to `dyn U` is allowed.
176180

177181
* `Foo<..., T, ...>` to `Foo<..., U, ...>`, when:
178182
* `Foo` is a struct.
@@ -276,3 +280,4 @@ precisely.
276280
[`Unsize`]: std::marker::Unsize
277281
[`CoerceUnsized`]: std::ops::CoerceUnsized
278282
[method-call expressions]: expressions/method-call-expr.md
283+
[supertraits]: items/traits.md#supertraits

0 commit comments

Comments
 (0)