diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2015-03-27 22:37:12 +0530 |
|---|---|---|
| committer | Manish Goregaokar <manishsmail@gmail.com> | 2015-03-27 22:37:12 +0530 |
| commit | 82b375b44d408e7ddd1e3b2c1e64b0bf0c4376d1 (patch) | |
| tree | 21a5333e58e0434e9310251d1bdbc9429ecfa7bf /src/libstd/sys | |
| parent | 242ed0b7c0f6a21096f2cc3e1ad1bdb176d02545 (diff) | |
| parent | 36ef29abf7fa14dc9361d6b30ff7f8d18bfb4157 (diff) | |
| download | rust-82b375b44d408e7ddd1e3b2c1e64b0bf0c4376d1.tar.gz rust-82b375b44d408e7ddd1e3b2c1e64b0bf0c4376d1.zip | |
Rollup merge of #23738 - alexcrichton:snapshots, r=cmr
Diffstat (limited to 'src/libstd/sys')
| -rw-r--r-- | src/libstd/sys/common/wtf8.rs | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/src/libstd/sys/common/wtf8.rs b/src/libstd/sys/common/wtf8.rs index 9f3dae34c7a..0d83e4497f7 100644 --- a/src/libstd/sys/common/wtf8.rs +++ b/src/libstd/sys/common/wtf8.rs @@ -634,30 +634,6 @@ impl Wtf8 { /// /// Panics when `begin` and `end` do not point to code point boundaries, /// or point beyond the end of the string. -#[cfg(stage0)] -impl ops::Index<ops::Range<usize>> for Wtf8 { - type Output = Wtf8; - - #[inline] - fn index(&self, range: &ops::Range<usize>) -> &Wtf8 { - // is_code_point_boundary checks that the index is in [0, .len()] - if range.start <= range.end && - is_code_point_boundary(self, range.start) && - is_code_point_boundary(self, range.end) { - unsafe { slice_unchecked(self, range.start, range.end) } - } else { - slice_error_fail(self, range.start, range.end) - } - } -} - -/// Return a slice of the given string for the byte range [`begin`..`end`). -/// -/// # Panics -/// -/// Panics when `begin` and `end` do not point to code point boundaries, -/// or point beyond the end of the string. -#[cfg(not(stage0))] impl ops::Index<ops::Range<usize>> for Wtf8 { type Output = Wtf8; @@ -680,28 +656,6 @@ impl ops::Index<ops::Range<usize>> for Wtf8 { /// /// Panics when `begin` is not at a code point boundary, /// or is beyond the end of the string. -#[cfg(stage0)] -impl ops::Index<ops::RangeFrom<usize>> for Wtf8 { - type Output = Wtf8; - - #[inline] - fn index(&self, range: &ops::RangeFrom<usize>) -> &Wtf8 { - // is_code_point_boundary checks that the index is in [0, .len()] - if is_code_point_boundary(self, range.start) { - unsafe { slice_unchecked(self, range.start, self.len()) } - } else { - slice_error_fail(self, range.start, self.len()) - } - } -} - -/// Return a slice of the given string from byte `begin` to its end. -/// -/// # Panics -/// -/// Panics when `begin` is not at a code point boundary, -/// or is beyond the end of the string. -#[cfg(not(stage0))] impl ops::Index<ops::RangeFrom<usize>> for Wtf8 { type Output = Wtf8; @@ -722,28 +676,6 @@ impl ops::Index<ops::RangeFrom<usize>> for Wtf8 { /// /// Panics when `end` is not at a code point boundary, /// or is beyond the end of the string. -#[cfg(stage0)] -impl ops::Index<ops::RangeTo<usize>> for Wtf8 { - type Output = Wtf8; - - #[inline] - fn index(&self, range: &ops::RangeTo<usize>) -> &Wtf8 { - // is_code_point_boundary checks that the index is in [0, .len()] - if is_code_point_boundary(self, range.end) { - unsafe { slice_unchecked(self, 0, range.end) } - } else { - slice_error_fail(self, 0, range.end) - } - } -} - -/// Return a slice of the given string from its beginning to byte `end`. -/// -/// # Panics -/// -/// Panics when `end` is not at a code point boundary, -/// or is beyond the end of the string. -#[cfg(not(stage0))] impl ops::Index<ops::RangeTo<usize>> for Wtf8 { type Output = Wtf8; @@ -758,17 +690,6 @@ impl ops::Index<ops::RangeTo<usize>> for Wtf8 { } } -#[cfg(stage0)] -impl ops::Index<ops::RangeFull> for Wtf8 { - type Output = Wtf8; - - #[inline] - fn index(&self, _range: &ops::RangeFull) -> &Wtf8 { - self - } -} - -#[cfg(not(stage0))] impl ops::Index<ops::RangeFull> for Wtf8 { type Output = Wtf8; |
