summary refs log tree commit diff
path: root/src/libstd/ffi
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-04-17 14:49:49 -0700
committerAlex Crichton <alex@alexcrichton.com>2015-04-23 15:18:13 -0700
commit53dd775cf3de679cb13bea7ef91769ab9f215784 (patch)
treeb21c8aefd0b3ea2151d50b0be2ca538718468da6 /src/libstd/ffi
parentc0d2553914adffa9ebaab95358aad3a882632a70 (diff)
downloadrust-53dd775cf3de679cb13bea7ef91769ab9f215784.tar.gz
rust-53dd775cf3de679cb13bea7ef91769ab9f215784.zip
std: Remove deprecated AsOsStr/Str/AsSlice traits
Cleaning out more deprecated items

Conflicts:
	src/libcore/result.rs
Diffstat (limited to 'src/libstd/ffi')
-rw-r--r--src/libstd/ffi/mod.rs8
-rw-r--r--src/libstd/ffi/os_str.rs49
2 files changed, 0 insertions, 57 deletions
diff --git a/src/libstd/ffi/mod.rs b/src/libstd/ffi/mod.rs
index 99becb67a5a..dfe706e0773 100644
--- a/src/libstd/ffi/mod.rs
+++ b/src/libstd/ffi/mod.rs
@@ -20,11 +20,3 @@ pub use self::os_str::{OsString, OsStr};
 
 mod c_str;
 mod os_str;
-
-// FIXME (#21670): these should be defined in the os_str module
-/// Freely convertible to an `&OsStr` slice.
-#[unstable(feature = "std_misc")]
-pub trait AsOsStr {
-    /// Converts to an `&OsStr` slice.
-    fn as_os_str(&self) -> &OsStr;
-}
diff --git a/src/libstd/ffi/os_str.rs b/src/libstd/ffi/os_str.rs
index 08b41915d91..97bf33335b0 100644
--- a/src/libstd/ffi/os_str.rs
+++ b/src/libstd/ffi/os_str.rs
@@ -46,7 +46,6 @@ use vec::Vec;
 
 use sys::os_str::{Buf, Slice};
 use sys_common::{AsInner, IntoInner, FromInner};
-use super::AsOsStr;
 
 /// Owned, mutable OS strings.
 #[derive(Clone)]
@@ -226,14 +225,6 @@ impl OsStr {
         s.as_ref()
     }
 
-    /// Coerces directly from a `&str` slice to a `&OsStr` slice.
-    #[stable(feature = "rust1", since = "1.0.0")]
-    #[deprecated(since = "1.0.0",
-                 reason = "use `OsStr::new` instead")]
-    pub fn from_str(s: &str) -> &OsStr {
-        unsafe { mem::transmute(Slice::from_str(s)) }
-    }
-
     /// Yields a `&str` slice if the `OsStr` is valid unicode.
     ///
     /// This conversion may entail doing a check for UTF-8 validity.
@@ -379,46 +370,6 @@ impl ToOwned for OsStr {
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
-#[deprecated(since = "1.0.0", reason = "trait is deprecated")]
-impl<'a, T: AsOsStr + ?Sized> AsOsStr for &'a T {
-    fn as_os_str(&self) -> &OsStr {
-        (*self).as_os_str()
-    }
-}
-
-#[stable(feature = "rust1", since = "1.0.0")]
-#[deprecated(since = "1.0.0", reason = "trait is deprecated")]
-impl AsOsStr for OsStr {
-    fn as_os_str(&self) -> &OsStr {
-        self
-    }
-}
-
-#[stable(feature = "rust1", since = "1.0.0")]
-#[deprecated(since = "1.0.0", reason = "trait is deprecated")]
-impl AsOsStr for OsString {
-    fn as_os_str(&self) -> &OsStr {
-        &self[..]
-    }
-}
-
-#[stable(feature = "rust1", since = "1.0.0")]
-#[deprecated(since = "1.0.0", reason = "trait is deprecated")]
-impl AsOsStr for str {
-    fn as_os_str(&self) -> &OsStr {
-        unsafe { mem::transmute(Slice::from_str(self)) }
-    }
-}
-
-#[stable(feature = "rust1", since = "1.0.0")]
-#[deprecated(since = "1.0.0", reason = "trait is deprecated")]
-impl AsOsStr for String {
-    fn as_os_str(&self) -> &OsStr {
-        unsafe { mem::transmute(Slice::from_str(self)) }
-    }
-}
-
-#[stable(feature = "rust1", since = "1.0.0")]
 impl AsRef<OsStr> for OsStr {
     fn as_ref(&self) -> &OsStr {
         self