Skip to content

Commit 8f92a7d

Browse files
authored
Update pointer.md
1 parent 80ec146 commit 8f92a7d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/types/pointer.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ Raw pointers can be created directly using [`core::ptr::addr_of!`] for `*const`
5050

5151
The standard library contains additional 'smart pointer' types beyond references and raw pointers.
5252

53+
## Bit validity
54+
55+
Despite pointers and references being similar to `usize`s in the machine code emitted on most platforms,
56+
the semantics of transmuting a reference or pointer type to a non-pointer type is currently undecided.
57+
Thus, it may not be valid to transmute a pointer or reference type, `P`, to a `[u8; size_of::<P>()]`.
58+
5359
[`core::ptr::addr_of!`]: ../../core/ptr/macro.addr_of.html
5460
[`core::ptr::addr_of_mut!`]: ../../core/ptr/macro.addr_of_mut.html
5561
[Interior mutability]: ../interior-mutability.md

0 commit comments

Comments
 (0)