@@ -2751,7 +2751,7 @@ impl Path {
2751
2751
fs:: metadata ( self ) . map ( |m| m. is_dir ( ) ) . unwrap_or ( false )
2752
2752
}
2753
2753
2754
- /// Returns true if the path exists on disk and is pointing at a symbolic link.
2754
+ /// Returns ` true` if the path exists on disk and is pointing at a symbolic link.
2755
2755
///
2756
2756
/// This function will not traverse symbolic links.
2757
2757
/// In case of a broken symbolic link this will also return true.
@@ -2763,7 +2763,6 @@ impl Path {
2763
2763
///
2764
2764
#[ cfg_attr( unix, doc = "```no_run" ) ]
2765
2765
#[ cfg_attr( not( unix) , doc = "```ignore" ) ]
2766
- /// #![feature(is_symlink)]
2767
2766
/// use std::path::Path;
2768
2767
/// use std::os::unix::fs::symlink;
2769
2768
///
@@ -2772,8 +2771,14 @@ impl Path {
2772
2771
/// assert_eq!(link_path.is_symlink(), true);
2773
2772
/// assert_eq!(link_path.exists(), false);
2774
2773
/// ```
2775
- #[ unstable( feature = "is_symlink" , issue = "85748" ) ]
2774
+ ///
2775
+ /// # See Also
2776
+ ///
2777
+ /// This is a convenience function that coerces errors to false. If you want to
2778
+ /// check errors, call [`fs::symlink_metadata`] and handle its [`Result`]. Then call
2779
+ /// [`fs::Metadata::is_symlink`] if it was [`Ok`].
2776
2780
#[ must_use]
2781
+ #[ stable( feature = "is_symlink" , since = "1.57.0" ) ]
2777
2782
pub fn is_symlink ( & self ) -> bool {
2778
2783
fs:: symlink_metadata ( self ) . map ( |m| m. is_symlink ( ) ) . unwrap_or ( false )
2779
2784
}
0 commit comments