File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -335,7 +335,12 @@ following holds:
335335
336336where ` &.T ` and ` *T ` are references of either mutability,
337337and where unsize_kind(` T ` ) is the kind of the unsize info
338- in ` T ` - a vtable or a length (or ` () ` if ` T: Sized ` ).
338+ in ` T ` - the vtable for a trait definition (e.g. ` fmt::Display ` or
339+ ` Iterator ` , not ` Iterator<Item=u8> ` ) or a length (or ` () ` if ` T: Sized ` ).
340+
341+ Note that lengths are not adjusted when casting raw slices -
342+ ` T: *const [u16] as *const [u8] ` creates a slice that only includes
343+ half of the original memory.
339344
340345Casting is not transitive, that is, even if ` e as U1 as U2 ` is a valid
341346expression, ` e as U2 ` is not necessarily so (in fact it will only be valid if
You can’t perform that action at this time.
0 commit comments