From 82fe082ef14c2e2b2c1c29ed9873c2ca6e6109ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=9D=A8=E5=B8=86?= <39647285+leno23@users.noreply.github.com> Date: Thu, 21 May 2026 21:43:17 +0800 Subject: [PATCH] fs: clarify `create_dir_all` succeeds if path exists (#8149) --- tokio/src/fs/create_dir_all.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tokio/src/fs/create_dir_all.rs b/tokio/src/fs/create_dir_all.rs index 1256469b5..ce9e46f94 100644 --- a/tokio/src/fs/create_dir_all.rs +++ b/tokio/src/fs/create_dir_all.rs @@ -26,6 +26,9 @@ use std::path::Path; /// when a directory is being created (after it is determined to not exist) are /// outlined by [`fs::create_dir`]. /// +/// If the final component at `path` already exists and is a directory, this +/// function will also return successfully without error. +/// /// Notable exception is made for situations where any of the directories /// specified in the `path` could not be created as it was being created concurrently. /// Such cases are considered to be successful. That is, calling `create_dir_all`