Skip to content

Commit

Permalink
use uninit for cast::transmute_copy
Browse files Browse the repository at this point in the history
  • Loading branch information
thestinger committed May 26, 2013
1 parent d9c0f0f commit f6023a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libstd/cast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f6023a0

Please sign in to comment.