From 110e67c9c27f7846b96675866133e947f4312b6b Mon Sep 17 00:00:00 2001 From: Chris Denton Date: Wed, 22 Apr 2026 15:41:20 +0000 Subject: [PATCH] Expand `Path::is_empty` docs --- library/std/src/path.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/library/std/src/path.rs b/library/std/src/path.rs index 6b894f6bf424..da3d9c2454a7 100644 --- a/library/std/src/path.rs +++ b/library/std/src/path.rs @@ -2828,6 +2828,10 @@ fn _ends_with(&self, child: &Path) -> bool { /// Checks whether the `Path` is empty. /// + /// Passing an empty path to most OS filesystem APIs will always result in an error. + /// + /// [Pushing][PathBuf::push] an empty path to an existing path will append a directory separator unless it already ends with a separator or the existing path is itself empty. + /// /// # Examples /// /// ```