]> git.lizzy.rs Git - rust.git/blob - src/docs/crosspointer_transmute.txt
Auto merge of #9421 - xphoniex:fix-#9420, r=giraffate
[rust.git] / src / docs / crosspointer_transmute.txt
1 ### What it does
2 Checks for transmutes between a type `T` and `*T`.
3
4 ### Why is this bad?
5 It's easy to mistakenly transmute between a type and a
6 pointer to that type.
7
8 ### Example
9 ```
10 core::intrinsics::transmute(t) // where the result type is the same as
11                                // `*t` or `&t`'s
12 ```