Update src/expressions/operator-expr.md

Co-authored-by: Niko Matsakis <niko@alum.mit.edu>
This commit is contained in:
Joshua Liebow-Feeser 2023-10-25 21:42:18 -07:00 committed by GitHub
parent 2fe40f8ae5
commit ed4811da2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -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]`