about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-10-28 16:00:00 +0000
committerbors <bors@rust-lang.org>2018-10-28 16:00:00 +0000
commitd492c6792c4fa24fb542bf457667f45b55b7c093 (patch)
tree9892c6dda3a4ea5cbc0317ff8725ea1929c47d2e /src/libstd
parent4f5cfa611d392e87166dfe053ca253c3e822d835 (diff)
parentdb4e77ce91e7cd2b87d217d479658e27f9b0a2db (diff)
downloadrust-d492c6792c4fa24fb542bf457667f45b55b7c093.tar.gz
rust-d492c6792c4fa24fb542bf457667f45b55b7c093.zip
Auto merge of #55433 - kennytm:rollup, r=kennytm
Rollup of 11 pull requests

Successful merges:

 - #55148 (Implement FromStr for PathBuf)
 - #55185 (path suggestions in Rust 2018 should point out the change in semantics)
 - #55191 (Fix sub-variant doc display)
 - #55199 (Impl items have generics)
 - #55244 (Don't rerun MIR passes when inlining)
 - #55252 (Add MaybeUninit::new)
 - #55257 (Allow extern statics with an extern type)
 - #55389 (Remove unnecessary mut in iterator.find_map documentation example, R…)
 - #55406 (Update string.rs)
 - #55412 (Fix an ICE in the min_const_fn analysis)
 - #55421 (Add ManuallyDrop::take)
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/path.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/libstd/path.rs b/src/libstd/path.rs
index ca8be75fab5..a153456370c 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<String> for PathBuf {
     }
 }
 
+#[stable(feature = "path_from_str", since = "1.26.0")]
+impl FromStr for PathBuf {
+    type Err = ParseError;
+
+    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 {