Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
e374c91
Stabilize Windows `FileTypeExt` with `is_symlink_dir` and `is_symlink…
joshtriplett Jun 27, 2022
a4cb0b9
Seal Windows `FileTypeExt` extension trait to allow adding future met…
joshtriplett Jun 27, 2022
6d1100f
Add failing test
In-line Dec 21, 2021
42a4419
Do not prefer module parents which are `doc(hidden)` in visibility map
compiler-errors Jul 24, 2022
76cf6bd
passes: port more of `check_attr` module
davidtwco Jul 19, 2022
5fcd2f7
Add a clickable link to the layout section
est31 Jul 24, 2022
15db418
Simplify test
est31 Jul 26, 2022
017e172
Remove dead code from cg_llvm
bjorn3 Jul 26, 2022
05c1a4a
Don't build std for *-uefi targets
nicholasbishop Jul 26, 2022
7f78a9a
Update pulldown-cmark version
GuillaumeGomez Jul 26, 2022
b8fb6e1
rustdoc: do not allocate String when writing path full name
notriddle Jul 26, 2022
1ff84f0
Rollup merge of #98583 - joshtriplett:stabilize-windows-symlink-types…
JohnTitor Jul 27, 2022
3ca1c31
Rollup merge of #99698 - compiler-errors:no-doc-hidden, r=cjgillot
JohnTitor Jul 27, 2022
181bf05
Rollup merge of #99700 - est31:rustdoc_layout_heading, r=GuillaumeGomez
JohnTitor Jul 27, 2022
fe51d07
Rollup merge of #99712 - davidtwco:translation-migrate-passes-2, r=co…
JohnTitor Jul 27, 2022
7f608e9
Rollup merge of #99759 - bjorn3:remove_llvm_dead_code, r=nikic
JohnTitor Jul 27, 2022
a76f2fe
Rollup merge of #99765 - nicholasbishop:bishop-disable-uefi-std-build…
JohnTitor Jul 27, 2022
f8f07de
Rollup merge of #99771 - GuillaumeGomez:update-pulldown-cmark, r=Urgau
JohnTitor Jul 27, 2022
0d5bdca
Rollup merge of #99775 - notriddle:notriddle/as-str, r=camelid
JohnTitor Jul 27, 2022
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
Next Next commit
Stabilize Windows FileTypeExt with is_symlink_dir and `is_symlink…
…_file`

These calls allow detecting whether a symlink is a file or a directory,
a distinction Windows maintains, and one important to software that
wants to do further operations on the symlink (e.g. removing it).
  • Loading branch information
joshtriplett committed Jun 27, 2022
commit e374c911af9a723e513d947244e5e5b0c847f006
8 changes: 4 additions & 4 deletions library/std/src/os/windows/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -502,17 +502,17 @@ impl MetadataExt for Metadata {
/// Windows-specific extensions to [`fs::FileType`].
///
/// On Windows, a symbolic link knows whether it is a file or directory.
#[unstable(feature = "windows_file_type_ext", issue = "none")]
#[stable(feature = "windows_file_type_ext", since = "1.64.0")]
pub trait FileTypeExt {
/// Returns `true` if this file type is a symbolic link that is also a directory.
#[unstable(feature = "windows_file_type_ext", issue = "none")]
#[stable(feature = "windows_file_type_ext", since = "1.64.0")]
fn is_symlink_dir(&self) -> bool;
/// Returns `true` if this file type is a symbolic link that is also a file.
#[unstable(feature = "windows_file_type_ext", issue = "none")]
#[stable(feature = "windows_file_type_ext", since = "1.64.0")]
fn is_symlink_file(&self) -> bool;
}

#[unstable(feature = "windows_file_type_ext", issue = "none")]
#[stable(feature = "windows_file_type_ext", since = "1.64.0")]
impl FileTypeExt for fs::FileType {
fn is_symlink_dir(&self) -> bool {
self.as_inner().is_symlink_dir()
Expand Down