diff --git a/src/libstd/path.rs b/src/libstd/path.rs index ca8be75fab5be..a153456370c6f 100644 --- a/src/libstd/path.rs +++ b/src/libstd/path.rs @@ -87,6 +87,8 @@ use io; use iter::{self, FusedIterator}; use ops::{self, Deref}; use rc::Rc; +use str::FromStr; +use string::ParseError; use sync::Arc; use ffi::{OsStr, OsString}; @@ -1443,6 +1445,15 @@ impl From for PathBuf { } } +#[stable(feature = "path_from_str", since = "1.26.0")] +impl FromStr for PathBuf { + type Err = ParseError; + + fn from_str(s: &str) -> Result { + Ok(PathBuf::from(s)) + } +} + #[stable(feature = "rust1", since = "1.0.0")] impl> iter::FromIterator

for PathBuf { fn from_iter>(iter: I) -> PathBuf {