Skip to content

Commit cd6fa5f

Browse files
committed
Rollup merge of rust-lang#50401 - alexcrichton:remove-path-from-str, r=sfackler
Revert "Implement FromStr for PathBuf" This reverts commit 05a9acc. The libs team was discussing rust-lang#44431 today and the changes originally added in rust-lang#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.
2 parents 46bc2c2 + f684147 commit cd6fa5f

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

src/libstd/path.rs

-27
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ use io;
8787
use iter::{self, FusedIterator};
8888
use ops::{self, Deref};
8989
use rc::Rc;
90-
use str::FromStr;
9190
use sync::Arc;
9291

9392
use ffi::{OsStr, OsString};
@@ -1441,32 +1440,6 @@ impl From<String> for PathBuf {
14411440
}
14421441
}
14431442

1444-
/// Error returned from [`PathBuf::from_str`][`from_str`].
1445-
///
1446-
/// Note that parsing a path will never fail. This error is just a placeholder
1447-
/// for implementing `FromStr` for `PathBuf`.
1448-
///
1449-
/// [`from_str`]: struct.PathBuf.html#method.from_str
1450-
#[derive(Debug, Clone, PartialEq, Eq)]
1451-
#[stable(feature = "path_from_str", since = "1.26.0")]
1452-
pub enum ParsePathError {}
1453-
1454-
#[stable(feature = "path_from_str", since = "1.26.0")]
1455-
impl fmt::Display for ParsePathError {
1456-
fn fmt(&self, _: &mut fmt::Formatter) -> fmt::Result {
1457-
match *self {}
1458-
}
1459-
}
1460-
1461-
#[stable(feature = "path_from_str", since = "1.26.0")]
1462-
impl FromStr for PathBuf {
1463-
type Err = ParsePathError;
1464-
1465-
fn from_str(s: &str) -> Result<Self, Self::Err> {
1466-
Ok(PathBuf::from(s))
1467-
}
1468-
}
1469-
14701443
#[stable(feature = "rust1", since = "1.0.0")]
14711444
impl<P: AsRef<Path>> iter::FromIterator<P> for PathBuf {
14721445
fn from_iter<I: IntoIterator<Item = P>>(iter: I) -> PathBuf {

0 commit comments

Comments
 (0)