From 4b5d0e02ca2647bf1efb2ecd3303c21ead64d2ea Mon Sep 17 00:00:00 2001 From: Soroush Mirzaei Date: Sun, 7 Sep 2025 11:14:00 -0400 Subject: [PATCH] docs(std): add error docs for path canonicalize --- library/std/src/path.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/library/std/src/path.rs b/library/std/src/path.rs index 19663e4a9df62..70ba502d68421 100644 --- a/library/std/src/path.rs +++ b/library/std/src/path.rs @@ -3037,6 +3037,14 @@ impl Path { /// /// This is an alias to [`fs::canonicalize`]. /// + /// # Errors + /// + /// This method will return an error in the following situations, but is not + /// limited to just these cases: + /// + /// * `path` does not exist. + /// * A non-final component in path is not a directory. + /// /// # Examples /// /// ```no_run