File tree 1 file changed +7
-0
lines changed
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -1755,12 +1755,19 @@ pub fn canonicalize<P: AsRef<Path>>(path: P) -> io::Result<PathBuf> {
1755
1755
///
1756
1756
/// [changes]: ../io/index.html#platform-specific-behavior
1757
1757
///
1758
+ /// **NOTE**: If a parent of the given path doesn't exist, this function will
1759
+ /// return an error. To create a directory and all its missing parents at the
1760
+ /// same time, use the [`create_dir_all`] function.
1761
+ ///
1758
1762
/// # Errors
1759
1763
///
1760
1764
/// This function will return an error in the following situations, but is not
1761
1765
/// limited to just these cases:
1762
1766
///
1763
1767
/// * User lacks permissions to create directory at `path`.
1768
+ /// * A parent of the given path doesn't exist. (To create a directory and all
1769
+ /// its missing parents at the same time, use the [`create_dir_all`]
1770
+ /// function.)
1764
1771
/// * `path` already exists.
1765
1772
///
1766
1773
/// # Examples
You can’t perform that action at this time.
0 commit comments