Rollup merge of #55621 - GuillaumeGomez:create-dir, r=QuietMisdreavus

Add precision for create_dir function

Took me a while to find the other equivalent so it seems to be necessary.

r? @QuietMisdreavus
This commit is contained in:
kennytm 2018-11-06 15:21:02 +08:00
commit 082156b2ac
No known key found for this signature in database
GPG key ID: FEF6C8051D0E013C

View file

@ -1755,12 +1755,19 @@ pub fn canonicalize<P: AsRef<Path>>(path: P) -> io::Result<PathBuf> {
///
/// [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