use uninit for cast::transmute_copy
This commit is contained in:
parent
d9c0f0f188
commit
f6023a01d4
1 changed files with 1 additions and 1 deletions
|
|
@ -15,7 +15,7 @@ use unstable::intrinsics;
|
|||
|
||||
/// Casts the value at `src` to U. The two types must have the same length.
|
||||
pub unsafe fn transmute_copy<T, U>(src: &T) -> U {
|
||||
let mut dest: U = intrinsics::init();
|
||||
let mut dest: U = intrinsics::uninit();
|
||||
{
|
||||
let dest_ptr: *mut u8 = transmute(&mut dest);
|
||||
let src_ptr: *u8 = transmute(src);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue