Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 8 pull requests #90426

Closed
wants to merge 19 commits into from
Closed
Changes from 4 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
081fe30
Add paragraph to ControlFlow docs to menion it works with the ? opera…
chrismit3s Oct 1, 2021
825cd81
Fix typo and change a word in ControlFlow docs
chrismit3s Oct 2, 2021
55663a7
Stabilize `is_symlink()` for `Metadata` and `Path`
maxwase Oct 8, 2021
36e050b
Update library/std/src/path.rs
maxwase Oct 12, 2021
3e0360f
Merge branch 'master' into is-symlink-stabilization
maxwase Oct 12, 2021
5bb99bb
Add #[must_use] to Rc::downgrade
jkugelman Oct 12, 2021
21f4677
Add #[must_use] to expensive computations
jkugelman Oct 12, 2021
14bb025
Partially stabilize `duration_consts_2`
jhpratt Oct 5, 2021
63d7882
Stabilize `option_result_unwrap_unchecked`
ojeda Oct 16, 2021
68b0d86
Add #[must_use] to remaining core functions
jkugelman Oct 14, 2021
887503a
Add #[must_use] to mem/ptr functions
jkugelman Oct 13, 2021
2ce7c36
Rollup merge of #89446 - chrismit3s:issue-88715-fix, r=joshtriplett
matthiaskrgr Oct 31, 2021
ae95ed5
Rollup merge of #89542 - jhpratt:stabilize-duration-const-fns, r=josh…
matthiaskrgr Oct 31, 2021
7306d1c
Rollup merge of #89677 - maxwase:is-symlink-stabilization, r=joshtrip…
matthiaskrgr Oct 31, 2021
c5b784a
Rollup merge of #89833 - jkugelman:must-use-rc-downgrade, r=joshtriplett
matthiaskrgr Oct 31, 2021
0d4fcd3
Rollup merge of #89835 - jkugelman:must-use-expensive-computations, r…
matthiaskrgr Oct 31, 2021
836c04c
Rollup merge of #89839 - jkugelman:must-use-mem-ptr-functions, r=josh…
matthiaskrgr Oct 31, 2021
f0a8a1d
Rollup merge of #89897 - jkugelman:must-use-core, r=joshtriplett
matthiaskrgr Oct 31, 2021
bbe133e
Rollup merge of #89951 - ojeda:stable-unwrap_unchecked, r=dtolnay
matthiaskrgr Oct 31, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions library/std/src/fs.rs
Original file line number Diff line number Diff line change
@@ -1046,7 +1046,6 @@ impl Metadata {
///
#[cfg_attr(unix, doc = "```no_run")]
#[cfg_attr(not(unix), doc = "```ignore")]
/// #![feature(is_symlink)]
/// use std::fs;
/// use std::path::Path;
/// use std::os::unix::fs::symlink;
@@ -1062,7 +1061,7 @@ impl Metadata {
/// }
/// ```
#[must_use]
#[unstable(feature = "is_symlink", issue = "85748")]
#[stable(feature = "is_symlink", since = "1.57.0")]
pub fn is_symlink(&self) -> bool {
self.file_type().is_symlink()
}
11 changes: 8 additions & 3 deletions library/std/src/path.rs
Original file line number Diff line number Diff line change
@@ -2751,7 +2751,7 @@ impl Path {
fs::metadata(self).map(|m| m.is_dir()).unwrap_or(false)
}

/// Returns true if the path exists on disk and is pointing at a symbolic link.
/// Returns `true` if the path exists on disk and is pointing at a symbolic link.
///
/// This function will not traverse symbolic links.
/// In case of a broken symbolic link this will also return true.
@@ -2763,7 +2763,6 @@ impl Path {
///
#[cfg_attr(unix, doc = "```no_run")]
#[cfg_attr(not(unix), doc = "```ignore")]
/// #![feature(is_symlink)]
/// use std::path::Path;
/// use std::os::unix::fs::symlink;
///
@@ -2772,8 +2771,14 @@ impl Path {
/// assert_eq!(link_path.is_symlink(), true);
/// assert_eq!(link_path.exists(), false);
/// ```
#[unstable(feature = "is_symlink", issue = "85748")]
///
/// # See Also
///
/// This is a convenience function that coerces errors to false. If you want to
/// check errors, call [`fs::symlink_metadata`] and handle its [`Result`]. Then call
/// [`fs::Metadata::is_symlink`] if it was [`Ok`].
#[must_use]
#[stable(feature = "is_symlink", since = "1.57.0")]
pub fn is_symlink(&self) -> bool {
fs::symlink_metadata(self).map(|m| m.is_symlink()).unwrap_or(false)
}