Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define raw pointer transmute behavior #1661

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/expressions/operator-expr.md
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,10 @@ assert_eq!(values[1], 3);
such as `struct Foo(i32, [u8])` or `(u64, Foo)`.
- If `T` is unsized and `U` is sized, the cast discards all metadata that completes the wide pointer `T` and produces a thin pointer `U` consisting of the data part of the unsized pointer.

For any `*const T` / `*mut T` to `*const U` / `*mut U` cast which is well-defined as described
in this section, `core::mem::transmute<*const T, *const U>` / `core::mem::transmute<*mut T, *mut U>`
has the same behavior as the corresponding cast.

## Assignment expressions

> **<sup>Syntax</sup>**\
Expand Down