about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorNick Cameron <ncameron@mozilla.com>2015-01-28 17:06:46 +1300
committerNick Cameron <ncameron@mozilla.com>2015-01-30 12:01:08 +1300
commitbf2b4738163b196685198e91d7ce4e2761bb718e (patch)
tree84d15b7a762f4b8ef5517d05b5963a448e4d8414 /src/libstd
parentc64a96d385fb3b23c6744cf8d927c9c175936b5f (diff)
downloadrust-bf2b4738163b196685198e91d7ce4e2761bb718e.tar.gz
rust-bf2b4738163b196685198e91d7ce4e2761bb718e.zip
Rename FullRange to RangeFull
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/ffi/os_str.rs11
-rw-r--r--src/libstd/path/mod.rs1
-rw-r--r--src/libstd/path/windows.rs1
-rw-r--r--src/libstd/prelude/v1.rs2
-rw-r--r--src/libstd/sys/common/wtf8.rs11
5 files changed, 25 insertions, 1 deletions
diff --git a/src/libstd/ffi/os_str.rs b/src/libstd/ffi/os_str.rs
index 8fdc5547e46..18e2aa8c098 100644
--- a/src/libstd/ffi/os_str.rs
+++ b/src/libstd/ffi/os_str.rs
@@ -82,6 +82,7 @@ impl OsString {
     }
 }
 
+#[cfg(stage0)]
 impl ops::Index<ops::FullRange> for OsString {
     type Output = OsStr;
 
@@ -91,6 +92,16 @@ impl ops::Index<ops::FullRange> for OsString {
     }
 }
 
+#[cfg(not(stage0))]
+impl ops::Index<ops::RangeFull> for OsString {
+    type Output = OsStr;
+
+    #[inline]
+    fn index(&self, _index: &ops::RangeFull) -> &OsStr {
+        unsafe { mem::transmute(self.inner.as_slice()) }
+    }
+}
+
 impl ops::Deref for OsString {
     type Target = OsStr;
 
diff --git a/src/libstd/path/mod.rs b/src/libstd/path/mod.rs
index b42353e964c..b5409da9c9c 100644
--- a/src/libstd/path/mod.rs
+++ b/src/libstd/path/mod.rs
@@ -68,6 +68,7 @@ use fmt;
 use iter::IteratorExt;
 use option::Option;
 use option::Option::{None, Some};
+#[cfg(stage0)]
 use ops::FullRange;
 use str;
 use str::StrExt;
diff --git a/src/libstd/path/windows.rs b/src/libstd/path/windows.rs
index 2e6b9d50553..88db27013ac 100644
--- a/src/libstd/path/windows.rs
+++ b/src/libstd/path/windows.rs
@@ -25,6 +25,7 @@ use iter::{AdditiveIterator, Extend};
 use iter::{Iterator, IteratorExt, Map, repeat};
 use mem;
 use option::Option::{self, Some, None};
+#[cfg(stage0)]
 use ops::FullRange;
 use slice::{SliceExt, SliceConcatExt};
 use str::{SplitTerminator, FromStr, StrExt};
diff --git a/src/libstd/prelude/v1.rs b/src/libstd/prelude/v1.rs
index 51c9f9de83c..b3c4ffa5120 100644
--- a/src/libstd/prelude/v1.rs
+++ b/src/libstd/prelude/v1.rs
@@ -18,7 +18,7 @@
 #[stable(feature = "rust1", since = "1.0.0")]
 #[doc(no_inline)] pub use ops::{Drop, Fn, FnMut, FnOnce};
 
-// TEMPORARY
+#[cfg(stage0)]
 #[unstable(feature = "std_misc")]
 #[doc(no_inline)] pub use ops::FullRange;
 
diff --git a/src/libstd/sys/common/wtf8.rs b/src/libstd/sys/common/wtf8.rs
index bc072155063..fdcb0c19f30 100644
--- a/src/libstd/sys/common/wtf8.rs
+++ b/src/libstd/sys/common/wtf8.rs
@@ -680,6 +680,7 @@ impl ops::Index<ops::RangeTo<usize>> for Wtf8 {
     }
 }
 
+#[cfg(stage0)]
 impl ops::Index<ops::FullRange> for Wtf8 {
     type Output = Wtf8;
 
@@ -689,6 +690,16 @@ impl ops::Index<ops::FullRange> for Wtf8 {
     }
 }
 
+#[cfg(not(stage0))]
+impl ops::Index<ops::RangeFull> for Wtf8 {
+    type Output = Wtf8;
+
+    #[inline]
+    fn index(&self, _range: &ops::RangeFull) -> &Wtf8 {
+        self
+    }
+}
+
 #[inline]
 fn decode_surrogate(second_byte: u8, third_byte: u8) -> u16 {
     // The first byte is assumed to be 0xED