Skip to content

Commit f2290c2

Browse files
authored
Rollup merge of #129718 - lolbinarycat:remove_dir-docs, r=Noratrieb
add guarantee about remove_dir and remove_file error kinds approved in ACP rust-lang/libs-team#433
2 parents c0838c8 + c722641 commit f2290c2

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

library/std/src/fs.rs

+10
Original file line numberDiff line numberDiff line change
@@ -1991,6 +1991,11 @@ impl AsInner<fs_imp::DirEntry> for DirEntry {
19911991
/// * The file doesn't exist.
19921992
/// * The user lacks permissions to remove the file.
19931993
///
1994+
/// This function will only ever return an error of kind `NotFound` if the given
1995+
/// path does not exist. Note that the inverse is not true,
1996+
/// ie. if a path does not exist, its removal may fail for a number of reasons,
1997+
/// such as insufficient permissions.
1998+
///
19941999
/// # Examples
19952000
///
19962001
/// ```no_run
@@ -2448,6 +2453,11 @@ pub fn create_dir_all<P: AsRef<Path>>(path: P) -> io::Result<()> {
24482453
/// * The user lacks permissions to remove the directory at the provided `path`.
24492454
/// * The directory isn't empty.
24502455
///
2456+
/// This function will only ever return an error of kind `NotFound` if the given
2457+
/// path does not exist. Note that the inverse is not true,
2458+
/// ie. if a path does not exist, its removal may fail for a number of reasons,
2459+
/// such as insufficient permissions.
2460+
///
24512461
/// # Examples
24522462
///
24532463
/// ```no_run

0 commit comments

Comments
 (0)