diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-09-21 07:22:47 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-21 07:22:47 +0200 |
| commit | f2290c23fcc7101ca55b33012e89c4679c276e9b (patch) | |
| tree | ba2d70efd82dbe05e2047ea66bc5f1c815f291ae /library/std/src | |
| parent | c0838c8ebec23fb87855bb6de3a287981cb1df98 (diff) | |
| parent | c72264157b36e7333261e6524a457ee511e5e0b6 (diff) | |
| download | rust-f2290c23fcc7101ca55b33012e89c4679c276e9b.tar.gz rust-f2290c23fcc7101ca55b33012e89c4679c276e9b.zip | |
Rollup merge of #129718 - lolbinarycat:remove_dir-docs, r=Noratrieb
add guarantee about remove_dir and remove_file error kinds approved in ACP https://github.com/rust-lang/libs-team/issues/433
Diffstat (limited to 'library/std/src')
| -rw-r--r-- | library/std/src/fs.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/library/std/src/fs.rs b/library/std/src/fs.rs index 99689511854..55f3b628ce8 100644 --- a/library/std/src/fs.rs +++ b/library/std/src/fs.rs @@ -1991,6 +1991,11 @@ impl AsInner<fs_imp::DirEntry> for DirEntry { /// * The file doesn't exist. /// * The user lacks permissions to remove the file. /// +/// This function will only ever return an error of kind `NotFound` if the given +/// path does not exist. Note that the inverse is not true, +/// ie. if a path does not exist, its removal may fail for a number of reasons, +/// such as insufficient permissions. +/// /// # Examples /// /// ```no_run @@ -2448,6 +2453,11 @@ pub fn create_dir_all<P: AsRef<Path>>(path: P) -> io::Result<()> { /// * The user lacks permissions to remove the directory at the provided `path`. /// * The directory isn't empty. /// +/// This function will only ever return an error of kind `NotFound` if the given +/// path does not exist. Note that the inverse is not true, +/// ie. if a path does not exist, its removal may fail for a number of reasons, +/// such as insufficient permissions. +/// /// # Examples /// /// ```no_run |
