File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -255,12 +255,16 @@ The macro sets the following requirements on its input:
255
255
` #[pointee] ` derive helper attribute.
256
256
3 . The struct must not be ` #[repr(packed)] ` or ` #[repr(C)] ` .
257
257
4 . Other than one-aligned, zero-sized fields, the struct must have exactly one
258
- field and that field’s type must be must implement ` DispatchFromDyn<F> `
259
- where ` F ` is the type of ` T ` ’s field type.
258
+ field.
259
+ 5 . Assume that ` T ` is a type that can be unsized to ` U ` , and let ` FT ` and ` FU `
260
+ be the type of the struct's field when the pointee is equal to ` T ` and ` U `
261
+ respectively. If the struct's trait bounds are satisfied for both ` T ` and
262
+ ` U ` , then it must be possible to convert ` FT ` to ` FU ` using an unsizing
263
+ coercion.
260
264
261
265
(Adapted from the docs for [ ` DispatchFromDyn ` ] .)
262
266
263
- Point 1 and 2 are verified syntactically by the derive macro, whereas 3 and 4
267
+ Point 1 and 2 are verified syntactically by the derive macro, whereas 3, 4 and 5
264
268
are verified semantically by the compiler when checking the generated
265
269
[ ` DispatchFromDyn ` ] implementation as it does today.
266
270
You can’t perform that action at this time.
0 commit comments