diff options
Diffstat (limited to 'src/libcore/at_vec.rs')
| -rw-r--r-- | src/libcore/at_vec.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libcore/at_vec.rs b/src/libcore/at_vec.rs index 532dcf6157b..e2bce1bd0f0 100644 --- a/src/libcore/at_vec.rs +++ b/src/libcore/at_vec.rs @@ -41,7 +41,7 @@ pub mod rustrt { pub fn capacity<T>(v: @[T]) -> uint { unsafe { let repr: **raw::VecRepr = - ::cast::reinterpret_cast(&addr_of(&v)); + ::cast::transmute(addr_of(&v)); (**repr).unboxed.alloc / sys::size_of::<T>() } } @@ -208,7 +208,7 @@ pub mod raw { */ #[inline(always)] pub unsafe fn set_len<T>(v: @[T], new_len: uint) { - let repr: **mut VecRepr = ::cast::reinterpret_cast(&addr_of(&v)); + let repr: **mut VecRepr = ::cast::transmute(addr_of(&v)); (**repr).unboxed.fill = new_len * sys::size_of::<T>(); } @@ -226,7 +226,7 @@ pub mod raw { #[inline(always)] // really pretty please pub unsafe fn push_fast<T>(v: &mut @[T], initval: T) { - let repr: **mut VecRepr = ::cast::reinterpret_cast(&v); + let repr: **mut VecRepr = ::cast::transmute(v); let fill = (**repr).unboxed.fill; (**repr).unboxed.fill += sys::size_of::<T>(); let p = addr_of(&((**repr).unboxed.data)); @@ -322,4 +322,4 @@ mod test { assert!(from_slice([@"abc", @"123"]) == @[@"abc", @"123"]); assert!(from_slice([@[42]]) == @[@[42]]); } -} \ No newline at end of file +} |
