diff options
| author | bors <bors@rust-lang.org> | 2013-10-17 11:06:31 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-10-17 11:06:31 -0700 |
| commit | d773a024a2976f2759235551a52101cd08b37cce (patch) | |
| tree | 3751e8ff14bf7860fd49850a1d6c8db4e7205ce4 /src/libstd/vec.rs | |
| parent | d4a32386f3b61a4997de54ed00c0a80fd07ecc75 (diff) | |
| parent | 0adb41d0eb44ef74e897c22d9f1fcd8f97ef3458 (diff) | |
| download | rust-d773a024a2976f2759235551a52101cd08b37cce.tar.gz rust-d773a024a2976f2759235551a52101cd08b37cce.zip | |
auto merge of #9908 : alexcrichton/rust/snapshots, r=thestinger
Diffstat (limited to 'src/libstd/vec.rs')
| -rw-r--r-- | src/libstd/vec.rs | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/src/libstd/vec.rs b/src/libstd/vec.rs index 17dcced9485..60c569e75d0 100644 --- a/src/libstd/vec.rs +++ b/src/libstd/vec.rs @@ -975,22 +975,6 @@ pub trait ImmutableVector<'self, T> { impl<'self,T> ImmutableVector<'self, T> for &'self [T] { #[inline] - #[cfg(stage0)] - fn slice(&self, start: uint, end: uint) -> &'self [T] { - assert!(start <= end); - assert!(end <= self.len()); - do self.as_imm_buf |p, _len| { - unsafe { - cast::transmute(Slice { - data: ptr::offset(p, start as int), - len: (end - start) * sys::nonzero_size_of::<T>(), - }) - } - } - } - - #[inline] - #[cfg(not(stage0))] fn slice(&self, start: uint, end: uint) -> &'self [T] { assert!(start <= end); assert!(end <= self.len()); @@ -1149,14 +1133,6 @@ impl<'self,T> ImmutableVector<'self, T> for &'self [T] { } #[inline] - #[cfg(stage0)] - fn as_imm_buf<U>(&self, f: &fn(*T, uint) -> U) -> U { - let s = self.repr(); - f(s.data, s.len / sys::nonzero_size_of::<T>()) - } - - #[inline] - #[cfg(not(stage0))] fn as_imm_buf<U>(&self, f: &fn(*T, uint) -> U) -> U { let s = self.repr(); f(s.data, s.len) @@ -1944,22 +1920,6 @@ pub trait MutableVector<'self, T> { impl<'self,T> MutableVector<'self, T> for &'self mut [T] { #[inline] - #[cfg(stage0)] - fn mut_slice(self, start: uint, end: uint) -> &'self mut [T] { - assert!(start <= end); - assert!(end <= self.len()); - do self.as_mut_buf |p, _len| { - unsafe { - cast::transmute(Slice { - data: ptr::mut_offset(p, start as int) as *T, - len: (end - start) * sys::nonzero_size_of::<T>() - }) - } - } - } - - #[inline] - #[cfg(not(stage0))] fn mut_slice(self, start: uint, end: uint) -> &'self mut [T] { assert!(start <= end); assert!(end <= self.len()); @@ -2052,14 +2012,6 @@ impl<'self,T> MutableVector<'self, T> for &'self mut [T] { } #[inline] - #[cfg(stage0)] - fn as_mut_buf<U>(self, f: &fn(*mut T, uint) -> U) -> U { - let Slice{ data, len } = self.repr(); - f(data as *mut T, len / sys::nonzero_size_of::<T>()) - } - - #[inline] - #[cfg(not(stage0))] fn as_mut_buf<U>(self, f: &fn(*mut T, uint) -> U) -> U { let Slice{ data, len } = self.repr(); f(data as *mut T, len) @@ -2151,22 +2103,6 @@ pub mod raw { * not bytes). */ #[inline] - #[cfg(stage0)] - pub unsafe fn buf_as_slice<T,U>(p: *T, - len: uint, - f: &fn(v: &[T]) -> U) -> U { - f(cast::transmute(Slice { - data: p, - len: len * sys::nonzero_size_of::<T>() - })) - } - - /** - * Form a slice from a pointer and length (as a number of units, - * not bytes). - */ - #[inline] - #[cfg(not(stage0))] pub unsafe fn buf_as_slice<T,U>(p: *T, len: uint, f: &fn(v: &[T]) -> U) -> U { @@ -2181,22 +2117,6 @@ pub mod raw { * not bytes). */ #[inline] - #[cfg(stage0)] - pub unsafe fn mut_buf_as_slice<T,U>(p: *mut T, - len: uint, - f: &fn(v: &mut [T]) -> U) -> U { - f(cast::transmute(Slice { - data: p as *T, - len: len * sys::nonzero_size_of::<T>() - })) - } - - /** - * Form a slice from a pointer and length (as a number of units, - * not bytes). - */ - #[inline] - #[cfg(not(stage0))] pub unsafe fn mut_buf_as_slice<T,U>(p: *mut T, len: uint, f: &fn(v: &mut [T]) -> U) -> U { |
