Skip to content

Commit a2624a2

Browse files
committed
Apply review comments to trait upcasting description
1 parent 7451a0e commit a2624a2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/type-coercions.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,10 @@ relate to converting types to unsized types, and are permitted in a few
199199
cases where other coercions are not, as described above. They can still happen
200200
anywhere else a coercion can occur.
201201

202+
r[coerce.unsize.misnomer]
203+
> Note: "unsizing" is a bit of a misnomer,
204+
> since this covers unsized->unsized coercions too.
205+
202206
r[coerce.unsize.trait]
203207
Two traits, [`Unsize`] and [`CoerceUnsized`], are used
204208
to assist in this process and expose it for library use. The following
@@ -212,7 +216,8 @@ r[coerce.unsize.trait-object]
212216
* `T` to `dyn U`, when `T` implements `U + Sized`, and `U` is [dyn compatible].
213217

214218
r[coerce.unsize.trait-upcast]
215-
* `dyn T` to `dyn U`, when `U` is one of `T`'s supertraits.
219+
* `dyn T` to `dyn U`, when `U` is one of `T`'s [supertraits].
220+
* This allows dropping auto traits, i.e. `dyn T + Auto` to `dyn U` is allowed.
216221

217222
r[coerce.unsized.composite]
218223
* `Foo<..., T, ...>` to `Foo<..., U, ...>`, when:
@@ -330,3 +335,4 @@ precisely.
330335
[`Unsize`]: std::marker::Unsize
331336
[`CoerceUnsized`]: std::ops::CoerceUnsized
332337
[method-call expressions]: expressions/method-call-expr.md
338+
[supertraits]: items/traits.md#supertraits

0 commit comments

Comments
 (0)