Skip to content

Commit a7c967f

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

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/type-coercions.md

+7
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
@@ -213,6 +217,8 @@ r[coerce.unsize.trait-object]
213217

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

217223
r[coerce.unsized.composite]
218224
* `Foo<..., T, ...>` to `Foo<..., U, ...>`, when:
@@ -330,3 +336,4 @@ precisely.
330336
[`Unsize`]: std::marker::Unsize
331337
[`CoerceUnsized`]: std::ops::CoerceUnsized
332338
[method-call expressions]: expressions/method-call-expr.md
339+
[supertraits]: items/traits.md#supertraits

0 commit comments

Comments
 (0)