Skip to content

Commit 4949a09

Browse files
committed
Apply review comments to trait upcasting description
1 parent 7ae33aa commit 4949a09

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/type-coercions.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,10 @@ relate to converting types to unsized types, and are permitted in a few
195195
cases where other coercions are not, as described above. They can still happen
196196
anywhere else a coercion can occur.
197197

198+
r[coerce.unsize.misnomer]
199+
> Note: "unsizing" is a bit of a misnomer,
200+
> since this covers unsized->unsized coercions too.
201+
198202
r[coerce.unsize.trait]
199203
Two traits, [`Unsize`] and [`CoerceUnsized`], are used
200204
to assist in this process and expose it for library use. The following
@@ -208,7 +212,8 @@ r[coerce.unsize.trait-object]
208212
* `T` to `dyn U`, when `T` implements `U + Sized`, and `U` is [dyn compatible].
209213

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

213218
r[coerce.unsized.composite]
214219
* `Foo<..., T, ...>` to `Foo<..., U, ...>`, when:
@@ -325,3 +330,4 @@ precisely.
325330
[`Unsize`]: std::marker::Unsize
326331
[`CoerceUnsized`]: std::ops::CoerceUnsized
327332
[method-call expressions]: expressions/method-call-expr.md
333+
[supertraits]: items/traits.md#supertraits

0 commit comments

Comments
 (0)