Skip to content

Commit

Permalink
Leave validity to the table
Browse files Browse the repository at this point in the history
  • Loading branch information
udoprog committed Jan 24, 2024
1 parent 188a38a commit 2288f13
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/expressions/operator-expr.md
Original file line number Diff line number Diff line change
Expand Up @@ -480,15 +480,12 @@ assert_eq!(values[1], 3);

#### Pointer-to-pointer cast

`*const T` / `*mut T` can be cast to `*const U` / `*mut U` under the following
conditions:
`*const T` / `*mut T` can be cast to `*const U` / `*mut U` with the following behavior:

- If both `T` and `U` are sized, the cast produces a value identical to the
original pointer.
- If both `T` and `U` are unsized, the cast produces a value identical to the
original pointer if `T` and `U` are compatible unsized types.
- If `T` is unsized and `U` is sized, the cast discards all metadata that
completes the wide pointer `T` and produces a thin base pointer `U`.
- Otherwise a cast from `T` to `U` produces a value identical to the original
pointer.

## Assignment expressions

Expand Down

0 comments on commit 2288f13

Please sign in to comment.