Skip to content

Commit 97b4810

Browse files
WaffleLapkincompiler-errorscrlf0710
authored andcommitted
Apply review comments to trait upcasting description
Co-authored-by: Michael Goulet <[email protected]> Co-authored-by: Charles Lew <[email protected]>
1 parent 341f188 commit 97b4810

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/type-coercions.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,8 @@ r[coerce.unsize.trait-object]
208208
* `T` to `dyn U`, when `T` implements `U + Sized`, and `U` is [dyn compatible].
209209

210210
r[coerce.unsize.trait-upcast]
211-
* `dyn T` to `dyn U`, when `T` has `U` as one of its ancestor trait.
211+
* `dyn T` to `dyn U`, when `U` is one of `T`'s [supertraits].
212+
* This allows dropping auto traits, i.e. `dyn T + Auto` to `dyn U` is allowed.
212213

213214
r[coerce.unsized.composite]
214215
* `Foo<..., T, ...>` to `Foo<..., U, ...>`, when:
@@ -325,3 +326,4 @@ precisely.
325326
[`Unsize`]: std::marker::Unsize
326327
[`CoerceUnsized`]: std::ops::CoerceUnsized
327328
[method-call expressions]: expressions/method-call-expr.md
329+
[supertraits]: items/traits.md#supertraits

0 commit comments

Comments
 (0)