mirror of https://github.com/rust-lang/reference
Update src/expressions/operator-expr.md
Co-authored-by: Niko Matsakis <niko@alum.mit.edu>
This commit is contained in:
parent
2fe40f8ae5
commit
ed4811da2d
|
@ -480,8 +480,7 @@ assert_eq!(values[1], 3);
|
|||
|
||||
#### Slice DST pointer to pointer cast
|
||||
|
||||
When `T` and `U` are both "slice DSTs" - i.e., slice types or types whose trailing field
|
||||
is a slice type - the raw pointer types `*const T`, `*mut T`, `*const U`, and `*mut U`
|
||||
For slice types like `[T]` and `[U]`, the raw pointer types `*const [T]`, `*mut [T]`, `*const [U]`, and `*mut [U]`
|
||||
encode the number of elements in this slice. Casts between these raw pointer types
|
||||
preserve the number of elements. Note that, as a consequence, such casts do *not*
|
||||
necessarily preserve the size of the pointer's referent (e.g., casting `*const [u16]`
|
||||
|
|
Loading…
Reference in New Issue