Skip to content

Commit 25e9e65

Browse files
crlf0710WaffleLapkin
authored andcommitted
Add trait_upcasting related languages changes
1 parent 183dd4b commit 25e9e65

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/type-coercions.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ r[coerce.unsize]
195195

196196
r[coerce.unsize.intro]
197197
The following coercions are called `unsized coercions`, since they
198-
relate to converting sized types to unsized types, and are permitted in a few
198+
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

@@ -211,6 +211,9 @@ r[coerce.unsize.slice]
211211
r[coerce.unsize.trait-object]
212212
* `T` to `dyn U`, when `T` implements `U + Sized`, and `U` is [dyn compatible].
213213

214+
r[coerce.unsize.trait-upcast]
215+
* `dyn T` to `dyn U`, when `T` has `U` as one of its ancestor trait.
216+
214217
r[coerce.unsized.composite]
215218
* `Foo<..., T, ...>` to `Foo<..., U, ...>`, when:
216219
* `Foo` is a struct.

0 commit comments

Comments
 (0)