@@ -163,6 +163,9 @@ relate to converting types to unsized types, and are permitted in a few
163
163
cases where other coercions are not, as described above. They can still happen
164
164
anywhere else a coercion can occur.
165
165
166
+ > Note: "unsizing" is a bit of a misnomer,
167
+ > since this covers unsized->unsized coercions too.
168
+
166
169
Two traits, [ ` Unsize ` ] and [ ` CoerceUnsized ` ] , are used
167
170
to assist in this process and expose it for library use. The following
168
171
coercions are built-ins and, if ` T ` can be coerced to ` U ` with one of them, then
@@ -172,7 +175,8 @@ an implementation of `Unsize<U>` for `T` will be provided:
172
175
173
176
* ` T ` to ` dyn U ` , when ` T ` implements ` U + Sized ` , and ` U ` is [ object safe] .
174
177
175
- * ` dyn T ` to ` dyn U ` , when ` U ` is one of ` T ` 's supertraits.
178
+ * ` dyn T ` to ` dyn U ` when ` U ` is one of ` T ` 's [ supertraits] .
179
+ * This allows dropping auto traits, i.e. ` dyn T + Auto ` to ` dyn U ` is allowed.
176
180
177
181
* ` Foo<..., T, ...> ` to ` Foo<..., U, ...> ` , when:
178
182
* ` Foo ` is a struct.
@@ -276,3 +280,4 @@ precisely.
276
280
[ `Unsize` ] : std::marker::Unsize
277
281
[ `CoerceUnsized` ] : std::ops::CoerceUnsized
278
282
[ method-call expressions ] : expressions/method-call-expr.md
283
+ [ supertraits ] : items/traits.md#supertraits
0 commit comments