X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=library%2Fstd%2Fsrc%2Fpath.rs;h=2f53cf83936910e1df1dc217f96a8884c6f53302;hb=36ef4f15d3eb03d6a99657d13ef06209263c2cf9;hp=c3593264e520b3243f98c01cbf80f12e9fa0b44c;hpb=f7066f79d7abbeb5c9e6531f3e459eafaddec4d8;p=rust.git diff --git a/library/std/src/path.rs b/library/std/src/path.rs index c3593264e52..2f53cf83936 100644 --- a/library/std/src/path.rs +++ b/library/std/src/path.rs @@ -2531,6 +2531,8 @@ pub fn extension(&self) -> Option<&OsStr> { /// Creates an owned [`PathBuf`] with `path` adjoined to `self`. /// + /// If `path` is absolute, it replaces the current path. + /// /// See [`PathBuf::push`] for more details on what it means to adjoin a path. /// /// # Examples @@ -2539,6 +2541,7 @@ pub fn extension(&self) -> Option<&OsStr> { /// use std::path::{Path, PathBuf}; /// /// assert_eq!(Path::new("/etc").join("passwd"), PathBuf::from("/etc/passwd")); + /// assert_eq!(Path::new("/etc").join("/bin/sh"), PathBuf::from("/bin/sh")); /// ``` #[stable(feature = "rust1", since = "1.0.0")] #[must_use]