diff --git a/src/libstd/path.rs b/src/libstd/path.rs index 1ad1508ae2d07..0a13c77018f71 100644 --- a/src/libstd/path.rs +++ b/src/libstd/path.rs @@ -1249,6 +1249,14 @@ impl Path { /// /// Path::new("foo.txt"); /// ``` + /// + /// You can create `Path`s from `String`s, or even other `Path`s: + /// + /// ``` + /// let s = String::from("bar.txt"); + /// let p = Path::new(&s); + /// Path::new(&p); + /// ``` #[stable(feature = "rust1", since = "1.0.0")] pub fn new + ?Sized>(s: &S) -> &Path { unsafe { mem::transmute(s.as_ref()) }