Skip to content

Commit e6c04de

Browse files
committedMay 27, 2013
fix casts on 32-bit
1 parent 1484661 commit e6c04de

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed
 

‎src/libstd/cast.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub unsafe fn transmute_copy<T, U>(src: &T) -> U {
3333
let mut dest: U = intrinsics::uninit();
3434
let dest_ptr: *mut u8 = transmute(&mut dest);
3535
let src_ptr: *u8 = transmute(src);
36-
intrinsics::memcpy32(dest_ptr, src_ptr, sys::size_of::<U>() as u64);
36+
intrinsics::memcpy32(dest_ptr, src_ptr, sys::size_of::<U>() as u32);
3737
dest
3838
}
3939

‎src/libstd/ptr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ pub unsafe fn copy_memory<T>(dst: *mut T, src: *const T, count: uint) {
109109
#[cfg(target_word_size = "32", not(stage0))]
110110
pub unsafe fn copy_memory<T>(dst: *mut T, src: *const T, count: uint) {
111111
use unstable::intrinsics::memmove32;
112-
memmove32(dst, src, count as u32);
112+
memmove32(dst, src as *T, count as u32);
113113
}
114114

115115
#[inline(always)]

5 commit comments

Comments
 (5)

bors commented on May 27, 2013

@bors
Collaborator

bors commented on May 27, 2013

@bors
Collaborator

merging thestinger/rust/swap_fast = e6c04de into auto

bors commented on May 27, 2013

@bors
Collaborator

thestinger/rust/swap_fast = e6c04de merged ok, testing candidate = dbc5758

bors commented on May 27, 2013

@bors
Collaborator

fast-forwarding incoming to auto = dbc5758

Please sign in to comment.