about summary refs log tree commit diff
path: root/src/libstd/ffi
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd/ffi')
-rw-r--r--src/libstd/ffi/os_str.rs11
1 files changed, 11 insertions, 0 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;