Rollup merge of #150677 - improve-doc, r=Mark-Simulacrum

Improve std::path::Path::join documentation

Adapt `PathBuf::push` documentation for `Path::join` and add it to `join`'s docs

rust-lang/rust#146447
This commit is contained in:
Guillaume Gomez 2026-01-13 23:39:08 +01:00 committed by GitHub
commit 7fc878cb82
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2972,6 +2972,15 @@ impl Path {
///
/// If `path` is absolute, it replaces the current path.
///
/// On Windows:
///
/// * if `path` has a root but no prefix (e.g., `\windows`), it
/// replaces and returns everything except for the prefix (if any) of `self`.
/// * if `path` has a prefix but no root, `self` is ignored and `path` is returned.
/// * if `self` has a verbatim prefix (e.g. `\\?\C:\windows`)
/// and `path` is not empty, the new path is normalized: all references
/// to `.` and `..` are removed.
///
/// See [`PathBuf::push`] for more details on what it means to adjoin a path.
///
/// # Examples