diff options
| author | kennytm <kennytm@gmail.com> | 2018-05-03 16:11:33 +0800 |
|---|---|---|
| committer | kennytm <kennytm@gmail.com> | 2018-05-04 02:12:51 +0800 |
| commit | cd6fa5f426195ad20448e402dc5224be69c9627d (patch) | |
| tree | b35ececbf7daeb1b159b145b8a8e122f8070d28c /src/libstd | |
| parent | 46bc2c28b98ecdd8fed030c060e85072dcb67fc0 (diff) | |
| parent | f6841470f1beb007052b12a090c1eb109c7259e8 (diff) | |
| download | rust-cd6fa5f426195ad20448e402dc5224be69c9627d.tar.gz rust-cd6fa5f426195ad20448e402dc5224be69c9627d.zip | |
Rollup merge of #50401 - alexcrichton:remove-path-from-str, r=sfackler
Revert "Implement FromStr for PathBuf" This reverts commit 05a9acc3b844ff284a3e3d85dde2d9798abfb215. The libs team was discussing https://github.com/rust-lang/rust/issues/44431 today and the changes originally added in https://github.com/rust-lang/rust/pull/48292 and the conclusion was that we'd like to revert this for now until `!` is stable. This'll provide us maximal flexibility to tweak the error type here in the future, and it looks like `!` is close-ish to stabilization so hopefully this won't be delayed for too long.
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/path.rs | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/src/libstd/path.rs b/src/libstd/path.rs index 955a6af1ae6..696711a70d4 100644 --- a/src/libstd/path.rs +++ b/src/libstd/path.rs @@ -87,7 +87,6 @@ use io; use iter::{self, FusedIterator}; use ops::{self, Deref}; use rc::Rc; -use str::FromStr; use sync::Arc; use ffi::{OsStr, OsString}; @@ -1441,32 +1440,6 @@ impl From<String> for PathBuf { } } -/// Error returned from [`PathBuf::from_str`][`from_str`]. -/// -/// Note that parsing a path will never fail. This error is just a placeholder -/// for implementing `FromStr` for `PathBuf`. -/// -/// [`from_str`]: struct.PathBuf.html#method.from_str -#[derive(Debug, Clone, PartialEq, Eq)] -#[stable(feature = "path_from_str", since = "1.26.0")] -pub enum ParsePathError {} - -#[stable(feature = "path_from_str", since = "1.26.0")] -impl fmt::Display for ParsePathError { - fn fmt(&self, _: &mut fmt::Formatter) -> fmt::Result { - match *self {} - } -} - -#[stable(feature = "path_from_str", since = "1.26.0")] -impl FromStr for PathBuf { - type Err = ParsePathError; - - fn from_str(s: &str) -> Result<Self, Self::Err> { - Ok(PathBuf::from(s)) - } -} - #[stable(feature = "rust1", since = "1.0.0")] impl<P: AsRef<Path>> iter::FromIterator<P> for PathBuf { fn from_iter<I: IntoIterator<Item = P>>(iter: I) -> PathBuf { |
