From: Guillaume Gomez Date: Fri, 2 Nov 2018 17:23:51 +0000 (+0100) Subject: Add precision for create_dir function X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=424fecdfb612f82527d8b74be3510b2171d0f5b3;p=rust.git Add precision for create_dir function --- diff --git a/src/libstd/fs.rs b/src/libstd/fs.rs index 017949291bc..49012a7d341 100644 --- a/src/libstd/fs.rs +++ b/src/libstd/fs.rs @@ -1755,12 +1755,19 @@ pub fn canonicalize>(path: P) -> io::Result { /// /// [changes]: ../io/index.html#platform-specific-behavior /// +/// **NOTE**: If a parent of the given path doesn't exist, this function will +/// return an error. To create a directory and all its missing parents at the +/// same time, use the [`create_dir_all`] function. +/// /// # Errors /// /// This function will return an error in the following situations, but is not /// limited to just these cases: /// /// * User lacks permissions to create directory at `path`. +/// * A parent of the given path doesn't exist. (To create a directory and all +/// its missing parents at the same time, use the [`create_dir_all`] +/// function.) /// * `path` already exists. /// /// # Examples