parent
2b45a0d908
commit
067ad9928f
1 changed files with 1 additions and 3 deletions
|
@ -831,9 +831,7 @@ is a size mismatch in one of the impls.
|
||||||
It is also possible to manually transmute:
|
It is also possible to manually transmute:
|
||||||
|
|
||||||
```
|
```
|
||||||
let result: SomeType = mem::uninitialized();
|
ptr::read(&v as *const _ as *const SomeType) // `v` transmuted to `SomeType`
|
||||||
unsafe { copy_nonoverlapping(&v, &result) };
|
|
||||||
result // `v` transmuted to type `SomeType`
|
|
||||||
```
|
```
|
||||||
"##,
|
"##,
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue