diff options
Diffstat (limited to 'src/libcore/slice.rs')
| -rw-r--r-- | src/libcore/slice.rs | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/src/libcore/slice.rs b/src/libcore/slice.rs index 02c0c9bf310..5847a6177d7 100644 --- a/src/libcore/slice.rs +++ b/src/libcore/slice.rs @@ -488,7 +488,6 @@ impl<'a,T> ImmutableSlice<'a, T> for &'a [T] { -#[cfg(not(stage0))] impl<T> ops::Slice<uint, [T]> for [T] { #[inline] fn as_slice_<'a>(&'a self) -> &'a [T] { @@ -516,36 +515,7 @@ impl<T> ops::Slice<uint, [T]> for [T] { } } } -#[cfg(stage0)] -impl<T> ops::Slice<uint, [T]> for [T] { - #[inline] - fn as_slice_<'a>(&'a self) -> &'a [T] { - self - } - - #[inline] - fn slice_from_<'a>(&'a self, start: &uint) -> &'a [T] { - self.slice_(start, &self.len()) - } - #[inline] - fn slice_to_<'a>(&'a self, end: &uint) -> &'a [T] { - self.slice_(&0, end) - } - #[inline] - fn slice_<'a>(&'a self, start: &uint, end: &uint) -> &'a [T] { - assert!(*start <= *end); - assert!(*end <= self.len()); - unsafe { - transmute(RawSlice { - data: self.as_ptr().offset(*start as int), - len: (*end - *start) - }) - } - } -} - -#[cfg(not(stage0))] impl<T> ops::SliceMut<uint, [T]> for [T] { #[inline] fn as_mut_slice_<'a>(&'a mut self) -> &'a mut [T] { @@ -574,35 +544,6 @@ impl<T> ops::SliceMut<uint, [T]> for [T] { } } } -#[cfg(stage0)] -impl<T> ops::SliceMut<uint, [T]> for [T] { - #[inline] - fn as_mut_slice_<'a>(&'a mut self) -> &'a mut [T] { - self - } - - #[inline] - fn slice_from_mut_<'a>(&'a mut self, start: &uint) -> &'a mut [T] { - let len = &self.len(); - self.slice_mut_(start, len) - } - - #[inline] - fn slice_to_mut_<'a>(&'a mut self, end: &uint) -> &'a mut [T] { - self.slice_mut_(&0, end) - } - #[inline] - fn slice_mut_<'a>(&'a mut self, start: &uint, end: &uint) -> &'a mut [T] { - assert!(*start <= *end); - assert!(*end <= self.len()); - unsafe { - transmute(RawSlice { - data: self.as_ptr().offset(*start as int), - len: (*end - *start) - }) - } - } -} /// Extension methods for slices such that their elements are /// mutable. |
