summary refs log tree commit diff
path: root/src/libstd/path.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2016-03-07 15:42:29 -0800
committerAlex Crichton <alex@alexcrichton.com>2016-03-12 12:31:13 -0800
commitb53764c73bd722ea22142bace6249d5950066253 (patch)
treeecf0066dbdb65bf0cf4600c4560d06edcacff707 /src/libstd/path.rs
parent083db64d9050ae6f92628aa869171ac4affb016f (diff)
downloadrust-b53764c73bd722ea22142bace6249d5950066253.tar.gz
rust-b53764c73bd722ea22142bace6249d5950066253.zip
std: Clean out deprecated APIs
Removes all unstable and deprecated APIs prior to the 1.8 release. All APIs that
are deprecated in the 1.8 release are sticking around for the rest of this
cycle.

Some notable changes are:

* The `dynamic_lib` module was moved into `rustc_back` as the compiler still
  relies on a few bits and pieces.
* The `DebugTuple` formatter now special-cases an empty struct name with only
  one field to append a trailing comma.
Diffstat (limited to 'src/libstd/path.rs')
-rw-r--r--src/libstd/path.rs71
1 files changed, 2 insertions, 69 deletions
diff --git a/src/libstd/path.rs b/src/libstd/path.rs
index 94967bfb96a..5309cc3c858 100644
--- a/src/libstd/path.rs
+++ b/src/libstd/path.rs
@@ -100,8 +100,7 @@
 #![stable(feature = "rust1", since = "1.0.0")]
 
 use ascii::*;
-#[allow(deprecated)]
-use borrow::{Borrow, IntoCow, ToOwned, Cow};
+use borrow::{Borrow, ToOwned, Cow};
 use cmp;
 use error::Error;
 use fmt;
@@ -781,14 +780,6 @@ impl<'a> Components<'a> {
             }
         }
     }
-
-    /// Examine the next component without consuming it.
-    #[unstable(feature = "path_components_peek", issue = "27727")]
-    #[rustc_deprecated(reason = "use peekable() instead",
-                       since = "1.6.0")]
-    pub fn peek(&self) -> Option<Component<'a>> {
-        self.clone().next()
-    }
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]
@@ -1218,22 +1209,6 @@ impl Borrow<Path> for PathBuf {
     }
 }
 
-#[stable(feature = "rust1", since = "1.0.0")]
-#[allow(deprecated)]
-impl IntoCow<'static, Path> for PathBuf {
-    fn into_cow(self) -> Cow<'static, Path> {
-        Cow::Owned(self)
-    }
-}
-
-#[stable(feature = "rust1", since = "1.0.0")]
-#[allow(deprecated)]
-impl<'a> IntoCow<'a, Path> for &'a Path {
-    fn into_cow(self) -> Cow<'a, Path> {
-        Cow::Borrowed(self)
-    }
-}
-
 #[stable(feature = "cow_from_path", since = "1.6.0")]
 impl<'a> From<&'a Path> for Cow<'a, Path> {
     #[inline]
@@ -1474,17 +1449,7 @@ impl Path {
         !self.is_absolute()
     }
 
-    /// Returns the *prefix* of a path, if any.
-    ///
-    /// Prefixes are relevant only for Windows paths, and consist of volumes
-    /// like `C:`, UNC prefixes like `\\server`, and others described in more
-    /// detail in `std::os::windows::PathExt`.
-    #[unstable(feature = "path_prefix",
-               reason = "uncertain whether to expose this convenience",
-               issue = "27722")]
-    #[rustc_deprecated(since = "1.7.0",
-                       reason = "inspect components().next() instead")]
-    pub fn prefix(&self) -> Option<Prefix> {
+    fn prefix(&self) -> Option<Prefix> {
         self.components().prefix
     }
 
@@ -1568,17 +1533,6 @@ impl Path {
 
     /// Returns a path that, when joined onto `base`, yields `self`.
     ///
-    /// If `base` is not a prefix of `self` (i.e. `starts_with`
-    /// returns false), then `relative_from` returns `None`.
-    #[unstable(feature = "path_relative_from", reason = "see #23284",
-               issue = "23284")]
-    #[rustc_deprecated(since = "1.7.0", reason = "renamed to strip_prefix")]
-    pub fn relative_from<'a, P: ?Sized + AsRef<Path>>(&'a self, base: &'a P) -> Option<&Path> {
-        self._strip_prefix(base.as_ref()).ok()
-    }
-
-    /// Returns a path that, when joined onto `base`, yields `self`.
-    ///
     /// # Errors
     ///
     /// If `base` is not a prefix of `self` (i.e. `starts_with`
@@ -2237,27 +2191,6 @@ mod tests {
     );
 
     #[test]
-    #[allow(deprecated)]
-    fn into_cow() {
-        use borrow::{Cow, IntoCow};
-
-        let static_path = Path::new("/home/foo");
-        let static_cow_path: Cow<'static, Path> = static_path.into_cow();
-        let pathbuf = PathBuf::from("/home/foo");
-
-        {
-            let path: &Path = &pathbuf;
-            let borrowed_cow_path: Cow<Path> = path.into_cow();
-
-            assert_eq!(static_cow_path, borrowed_cow_path);
-        }
-
-        let owned_cow_path: Cow<'static, Path> = pathbuf.into_cow();
-
-        assert_eq!(static_cow_path, owned_cow_path);
-    }
-
-    #[test]
     fn into() {
         use borrow::Cow;