Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f070e0b

Browse files
authoredFeb 4, 2022
Rollup merge of rust-lang#93555 - ChrisDenton:fs-try-exists-doc, r=Mark-Simulacrum
Link `try_exists` docs to `Path::exists` Links to the existing `Path::exists` method from both `std::Path::try_exists` and `std::fs:try_exists`. Tracking issue for `path_try_exists`: rust-lang#83186
2 parents 3876cb6 + 1bc8f0b commit f070e0b

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed
 

‎library/std/src/fs.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -2288,7 +2288,7 @@ impl AsInnerMut<fs_imp::DirBuilder> for DirBuilder {
22882288
/// This function will traverse symbolic links to query information about the
22892289
/// destination file. In case of broken symbolic links this will return `Ok(false)`.
22902290
///
2291-
/// As opposed to the `exists()` method, this one doesn't silently ignore errors
2291+
/// As opposed to the [`Path::exists`] method, this one doesn't silently ignore errors
22922292
/// unrelated to the path not existing. (E.g. it will return `Err(_)` in case of permission
22932293
/// denied on some of the parent directories.)
22942294
///
@@ -2301,6 +2301,8 @@ impl AsInnerMut<fs_imp::DirBuilder> for DirBuilder {
23012301
/// assert!(!fs::try_exists("does_not_exist.txt").expect("Can't check existence of file does_not_exist.txt"));
23022302
/// assert!(fs::try_exists("/root/secret_file.txt").is_err());
23032303
/// ```
2304+
///
2305+
/// [`Path::exists`]: crate::path::Path::exists
23042306
// FIXME: stabilization should modify documentation of `exists()` to recommend this method
23052307
// instead.
23062308
#[unstable(feature = "path_try_exists", issue = "83186")]

‎library/std/src/path.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -2730,7 +2730,7 @@ impl Path {
27302730
/// This function will traverse symbolic links to query information about the
27312731
/// destination file. In case of broken symbolic links this will return `Ok(false)`.
27322732
///
2733-
/// As opposed to the `exists()` method, this one doesn't silently ignore errors
2733+
/// As opposed to the [`exists()`] method, this one doesn't silently ignore errors
27342734
/// unrelated to the path not existing. (E.g. it will return `Err(_)` in case of permission
27352735
/// denied on some of the parent directories.)
27362736
///
@@ -2743,6 +2743,8 @@ impl Path {
27432743
/// assert!(!Path::new("does_not_exist.txt").try_exists().expect("Can't check existence of file does_not_exist.txt"));
27442744
/// assert!(Path::new("/root/secret_file.txt").try_exists().is_err());
27452745
/// ```
2746+
///
2747+
/// [`exists()`]: Self::exists
27462748
// FIXME: stabilization should modify documentation of `exists()` to recommend this method
27472749
// instead.
27482750
#[unstable(feature = "path_try_exists", issue = "83186")]

0 commit comments

Comments
 (0)
Failed to load comments.